qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lqu...@apache.org
Subject qpid-broker-j git commit: QPID-7775: [Java Broker] Separate flowToDiskCheckPeriod from housekeepingCheckPeriod
Date Wed, 24 May 2017 09:07:26 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 529ed43b6 -> d1b534892


QPID-7775: [Java Broker] Separate flowToDiskCheckPeriod from housekeepingCheckPeriod


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/d1b53489
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/d1b53489
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/d1b53489

Branch: refs/heads/master
Commit: d1b534892147b49fd27834fb09596cf6372530d0
Parents: 529ed43
Author: Lorenz Quack <lquack@apache.org>
Authored: Wed May 24 09:26:26 2017 +0100
Committer: Lorenz Quack <lquack@apache.org>
Committed: Wed May 24 09:26:58 2017 +0100

----------------------------------------------------------------------
 .../server/virtualhost/AbstractVirtualHost.java | 28 ++++++++++++++------
 .../virtualhost/QueueManagingVirtualHost.java   |  9 +++++++
 2 files changed, 29 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/d1b53489/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
index 67bee82..a7e74c6 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
@@ -273,6 +273,7 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
     private int _fileSystemMaxUsagePercent;
     private Collection<VirtualHostLogger> _virtualHostLoggersToClose;
     private PreferenceStore _preferenceStore;
+    private long _flowToDiskCheckPeriod;
 
     public AbstractVirtualHost(final Map<String, Object> attributes, VirtualHostNode<?>
virtualHostNode)
     {
@@ -583,6 +584,7 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
         _messageStore.addEventListener(this, Event.PERSISTENT_MESSAGE_SIZE_UNDERFULL);
 
         _fileSystemMaxUsagePercent = getContextValue(Integer.class, Broker.STORE_FILESYSTEM_MAX_USAGE_PERCENT);
+        _flowToDiskCheckPeriod = getContextValue(Long.class, FLOW_TO_DISK_CHECK_PERIOD);
 
 
         QpidServiceLoader serviceLoader = new QpidServiceLoader();
@@ -1156,17 +1158,20 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
         return true;
     }
 
-    /**
-     * Initialise a housekeeping task to iterate over queues cleaning expired messages with
no consumers
-     * and checking for idle or open transactions that have exceeded the permitted thresholds.
-     *
-     * @param period
-     */
-    private void initialiseHouseKeeping(long period)
+    private void initialiseHouseKeeping()
     {
+        final long period = getHousekeepingCheckPeriod();
         if (period > 0L)
         {
             scheduleHouseKeepingTask(period, new VirtualHostHouseKeepingTask());
+        }
+    }
+
+    private void initialiseFlowToDiskChecking()
+    {
+        final long period = getFlowToDiskCheckPeriod();
+        if (period > 0L)
+        {
             scheduleHouseKeepingTask(period, new FlowToDiskCheckingTask());
         }
     }
@@ -2124,6 +2129,12 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
     }
 
     @Override
+    public long getFlowToDiskCheckPeriod()
+    {
+        return _flowToDiskCheckPeriod;
+    }
+
+    @Override
     public long getStoreTransactionIdleTimeoutClose()
     {
         return _storeTransactionIdleTimeoutClose;
@@ -2672,7 +2683,8 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>>
exte
         State finalState = State.ERRORED;
         try
         {
-            initialiseHouseKeeping(getHousekeepingCheckPeriod());
+            initialiseHouseKeeping();
+            initialiseFlowToDiskChecking();
             finalState = State.ACTIVE;
             _acceptsConnections.set(true);
         }

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/d1b53489/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
index 77289d0..4f47f9f 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
@@ -37,6 +37,7 @@ import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.Connection;
 import org.apache.qpid.server.model.Content;
+import org.apache.qpid.server.model.DerivedAttribute;
 import org.apache.qpid.server.model.ManageableMessage;
 import org.apache.qpid.server.model.ManagedAttribute;
 import org.apache.qpid.server.model.ManagedContextDefault;
@@ -86,6 +87,10 @@ public interface QueueManagingVirtualHost<X extends QueueManagingVirtualHost<X>>
     @ManagedContextDefault( name = "virtualhost.housekeepingCheckPeriod")
     long DEFAULT_HOUSEKEEPING_CHECK_PERIOD = 30000l;
 
+    String FLOW_TO_DISK_CHECK_PERIOD = "virtualhost.flowToDiskCheckPeriod";
+    @ManagedContextDefault(name = FLOW_TO_DISK_CHECK_PERIOD)
+    long DEFAULT_FLOW_TO_DISK_CHECK_PERIOD = 30000L;
+
     String CONNECTION_THREAD_POOL_KEEP_ALIVE_TIMEOUT = "connectionThreadPoolKeepAliveTimeout";
     @SuppressWarnings("unused")
     @ManagedContextDefault(name = QueueManagingVirtualHost.CONNECTION_THREAD_POOL_KEEP_ALIVE_TIMEOUT)
@@ -137,6 +142,10 @@ public interface QueueManagingVirtualHost<X extends QueueManagingVirtualHost<X>>
     @ManagedAttribute( defaultValue = "${virtualhost.housekeepingCheckPeriod}")
     long getHousekeepingCheckPeriod();
 
+    @DerivedAttribute( description = "Time (in milliseconds) between checks whether existing
messages "
+                                     + "need to be flowed to disk in order to free memory."
)
+    long getFlowToDiskCheckPeriod();
+
     String VIRTUALHOST_CONNECTION_THREAD_POOL_SIZE = "virtualhost.connectionThreadPool.size";
     @SuppressWarnings("unused")
     @ManagedContextDefault( name = VIRTUALHOST_CONNECTION_THREAD_POOL_SIZE)


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


Mime
View raw message