From 790ce3196c5cef5a138bae29fa7ac9f03fee5b1b Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Tue, 8 Jul 2014 21:40:01 +0000 Subject: QPID-5885: [Java Broker] Virtualhostnode to replace real virtualhost with replica virtualhost in the event that the BDB HA goes into detached state git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1608956 13f79535-47bb-0310-9956-ffa450edef68 --- .../replication/ReplicatedEnvironmentFacade.java | 17 ----------------- .../berkeleydb/BDBHAVirtualHostNodeImpl.java | 22 +++++++++++++--------- .../store/berkeleydb/HAClusterTwoNodeTest.java | 20 ++++++++------------ 3 files changed, 21 insertions(+), 38 deletions(-) (limited to 'qpid/java/bdbstore') diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java index 8b9039c792..f8b9636c5d 100644 --- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java +++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java @@ -846,23 +846,6 @@ public class ReplicatedEnvironmentFacade implements EnvironmentFacade, StateChan { try { - if (environment.isValid()) - { - environment.setStateChangeListener(new StateChangeListener() - { - @Override - public void stateChange(StateChangeEvent stateChangeEvent) throws RuntimeException - { - if (LOGGER.isDebugEnabled()) - { - LOGGER.debug( - "When restarting a state change event is received on NOOP listener for state:" - + stateChangeEvent.getState()); - } - } - }); - } - try { closeSequences(); diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java index 3868025096..0bbbff0f98 100644 --- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java +++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhostnode/berkeleydb/BDBHAVirtualHostNodeImpl.java @@ -46,7 +46,6 @@ import com.sleepycat.je.rep.utilint.HostPortPair; import org.apache.log4j.Logger; import org.apache.qpid.server.configuration.updater.Task; -import org.apache.qpid.server.configuration.updater.VoidTask; import org.apache.qpid.server.logging.messages.ConfigStoreMessages; import org.apache.qpid.server.model.Broker; import org.apache.qpid.server.model.BrokerModel; @@ -104,6 +103,7 @@ public class BDBHAVirtualHostNodeImpl extends AbstractVirtualHostNode hostAttributes = new HashMap(); + Map hostAttributes = new HashMap<>(); hostAttributes.put(VirtualHost.MODEL_VERSION, BrokerModel.MODEL_VERSION); hostAttributes.put(VirtualHost.NAME, getGroupName()); hostAttributes.put(VirtualHost.TYPE, "BDB_HA_REPLICA"); @@ -442,11 +453,6 @@ public class BDBHAVirtualHostNodeImpl extends AbstractVirtualHostNode virtualHost = getVirtualHost(); @@ -478,11 +484,9 @@ public class BDBHAVirtualHostNodeImpl extends AbstractVirtualHostNode