You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/12/17 03:08:31 UTC

svn commit: r1551442 - in /manifoldcf/branches/CONNECTORS-829/framework: agents/src/main/java/org/apache/manifoldcf/agents/system/ core/src/main/java/org/apache/manifoldcf/core/interfaces/ core/src/main/java/org/apache/manifoldcf/core/throttler/

Author: kwright
Date: Tue Dec 17 02:08:31 2013
New Revision: 1551442

URL: http://svn.apache.org/r1551442
Log:
Hook up throttle groups to polling

Modified:
    manifoldcf/branches/CONNECTORS-829/framework/agents/src/main/java/org/apache/manifoldcf/agents/system/IdleCleanupThread.java
    manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IThrottleGroups.java
    manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/ThrottleGroups.java
    manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/Throttler.java

Modified: manifoldcf/branches/CONNECTORS-829/framework/agents/src/main/java/org/apache/manifoldcf/agents/system/IdleCleanupThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-829/framework/agents/src/main/java/org/apache/manifoldcf/agents/system/IdleCleanupThread.java?rev=1551442&r1=1551441&r2=1551442&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-829/framework/agents/src/main/java/org/apache/manifoldcf/agents/system/IdleCleanupThread.java (original)
+++ manifoldcf/branches/CONNECTORS-829/framework/agents/src/main/java/org/apache/manifoldcf/agents/system/IdleCleanupThread.java Tue Dec 17 02:08:31 2013
@@ -55,6 +55,8 @@ public class IdleCleanupThread extends T
       ICacheManager cacheManager = CacheManagerFactory.make(threadContext);
       // Get the output connector pool handle
       IOutputConnectorPool outputConnectorPool = OutputConnectorPoolFactory.make(threadContext);
+      // Throttler subsystem
+      IThrottleGroups throttleGroups = ThrottleGroupsFactory.make(threadContext);
       
       /* For HSQLDB debugging...
       IDBInterface database = DBInterfaceFactory.make(threadContext,
@@ -88,6 +90,9 @@ public class IdleCleanupThread extends T
           
           // Do the cleanup
           outputConnectorPool.pollAllConnectors();
+          // Poll connection bins
+          throttleGroups.poll();
+          // Expire objects
           cacheManager.expireObjects(System.currentTimeMillis());
           
           // Sleep for the retry interval.

Modified: manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IThrottleGroups.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IThrottleGroups.java?rev=1551442&r1=1551441&r2=1551442&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IThrottleGroups.java (original)
+++ manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IThrottleGroups.java Tue Dec 17 02:08:31 2013
@@ -67,7 +67,12 @@ public interface IThrottleGroups
   */
   public void poll(String throttleGroupType)
     throws ManifoldCFException;
-  
+
+  /** Poll periodically, to update ALL cluster-wide statistics and allocation.
+  */
+  public void poll()
+    throws ManifoldCFException;
+
   /** Free all unused resources.
   */
   public void freeUnusedResources()

Modified: manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/ThrottleGroups.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/ThrottleGroups.java?rev=1551442&r1=1551441&r2=1551442&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/ThrottleGroups.java (original)
+++ manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/ThrottleGroups.java Tue Dec 17 02:08:31 2013
@@ -104,6 +104,15 @@ public class ThrottleGroups implements I
     throttler.poll(threadContext, throttleGroupType);
   }
   
+  /** Poll periodically, to update ALL cluster-wide statistics and allocation.
+  */
+  @Override
+  public void poll()
+    throws ManifoldCFException
+  {
+    throttler.poll(threadContext);
+  }
+
   /** Free unused resources.
   */
   @Override

Modified: manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/Throttler.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/Throttler.java?rev=1551442&r1=1551441&r2=1551442&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/Throttler.java (original)
+++ manifoldcf/branches/CONNECTORS-829/framework/core/src/main/java/org/apache/manifoldcf/core/throttler/Throttler.java Tue Dec 17 02:08:31 2013
@@ -150,6 +150,22 @@ public class Throttler
     }
       
   }
+
+  /** Poll ALL bins periodically.
+  */
+  public void poll(IThreadContext threadContext)
+    throws ManifoldCFException
+  {
+    // No waiting, so lock the entire tree.
+    synchronized (throttleGroupsHash)
+    {
+      for (ThrottlingGroups tg : throttleGroupsHash.values())
+      {
+        tg.poll(threadContext);
+      }
+    }
+      
+  }
   
   /** Free unused resources.
   */