You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2014/10/30 17:57:36 UTC

svn commit: r1635547 - /qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java

Author: kwall
Date: Thu Oct 30 16:57:36 2014
New Revision: 1635547

URL: http://svn.apache.org/r1635547
Log:
QPID-6201: [Java Broker] HA use separate single thread executor to deliver JE state change events

Modified:
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java?rev=1635547&r1=1635546&r2=1635547&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java Thu Oct 30 16:57:36 2014
@@ -167,6 +167,7 @@ public class ReplicatedEnvironmentFacade
     private final File _environmentDirectory;
 
     private final ExecutorService _environmentJobExecutor;
+    private final ExecutorService _stateChangeExecutor;
     private final ScheduledExecutorService _groupChangeExecutor;
     private final AtomicReference<State> _state = new AtomicReference<State>(State.OPENING);
     private final ConcurrentMap<String, ReplicationNode> _remoteReplicationNodes = new ConcurrentHashMap<String, ReplicationNode>();
@@ -216,6 +217,7 @@ public class ReplicatedEnvironmentFacade
 
         // we relay on this executor being single-threaded as we need to restart and mutate the environment in one thread
         _environmentJobExecutor = Executors.newSingleThreadExecutor(new DaemonThreadFactory("Environment-" + _prettyGroupNodeName));
+        _stateChangeExecutor = Executors.newSingleThreadExecutor(new DaemonThreadFactory("StateChange-" + _prettyGroupNodeName));
         _groupChangeExecutor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() + 1, new DaemonThreadFactory("Group-Change-Learner:" + _prettyGroupNodeName));
 
         // create environment in a separate thread to avoid renaming of the current thread by JE
@@ -298,6 +300,7 @@ public class ReplicatedEnvironmentFacade
                                                 timeout,
                                                 TimeUnit.MILLISECONDS);
                 shutdownAndAwaitExecutorService(_groupChangeExecutor, _executorShutdownTimeout, TimeUnit.MILLISECONDS);
+                shutdownAndAwaitExecutorService(_stateChangeExecutor, _executorShutdownTimeout, TimeUnit.MILLISECONDS);
 
                 try
                 {
@@ -562,7 +565,7 @@ public class ReplicatedEnvironmentFacade
 
         if (_state.get() != State.CLOSING && _state.get() != State.CLOSED)
         {
-            _groupChangeExecutor.submit(new Runnable()
+            _stateChangeExecutor.submit(new Runnable()
             {
                 @Override
                 public void run()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org