manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1637998 - in /manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler: interfaces/IReprioritizationTracker.java reprioritizationtracker/ReprioritizationTracker.java
Date Tue, 11 Nov 2014 00:27:23 GMT
Author: kwright
Date: Tue Nov 11 00:27:23 2014
New Revision: 1637998

URL: http://svn.apache.org/r1637998
Log:
No longer track a timestamp in reprioritizationtracker

Modified:
    manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IReprioritizationTracker.java
    manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/reprioritizationtracker/ReprioritizationTracker.java

Modified: manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IReprioritizationTracker.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IReprioritizationTracker.java?rev=1637998&r1=1637997&r2=1637998&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IReprioritizationTracker.java
(original)
+++ manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IReprioritizationTracker.java
Tue Nov 11 00:27:23 2014
@@ -31,21 +31,13 @@ public interface IReprioritizationTracke
   public static final String _rcsid = "@(#)$Id$";
 
   /** Start a reprioritization activity.
-  *@param prioritizationTime is the timestamp of the prioritization.
   *@param processID is the process ID of the process performing/waiting for the prioritization
   * to complete.
   *@param reproID is the reprocessing thread ID
   */
-  public void startReprioritization(long prioritizationTime, String processID, String reproID)
+  public void startReprioritization(String processID, String reproID)
     throws ManifoldCFException;
   
-  /** Retrieve the current reprioritization time stamp.  This should be obtained before
-  * performing any prioritization steps.
-  *@return the current prioritization timestamp, or null if no prioritization is in effect.
-  */
-  public Long checkReprioritizationInProgress()
-    throws ManifoldCFException;
-
   /** Complete a reprioritization activity.  Prioritization will be marked as complete
   * only if the processID matches the one that started the current reprioritization.
   *@param processID is the process ID of the process completing the prioritization.

Modified: manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/reprioritizationtracker/ReprioritizationTracker.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/reprioritizationtracker/ReprioritizationTracker.java?rev=1637998&r1=1637997&r2=1637998&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/reprioritizationtracker/ReprioritizationTracker.java
(original)
+++ manifoldcf/branches/CONNECTORS-1100/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/reprioritizationtracker/ReprioritizationTracker.java
Tue Nov 11 00:27:23 2014
@@ -39,7 +39,6 @@ public class ReprioritizationTracker imp
   protected final static String trackerWriteLock = "_REPR_TRACKER_LOCK_";
   protected final static String trackerProcessIDResource = "_REPR_TRACKER_PID_";
   protected final static String trackerReproIDResource = "_REPR_TRACKER_RID_";
-  protected final static String trackerTimestampResource = "_REPR_TIMESTAMP_";
   protected final static String trackerMinimumDepthResource = "_REPR_MINDEPTH_";
   
   /** Lock manager */
@@ -67,21 +66,18 @@ public class ReprioritizationTracker imp
   *@param reproID is the reprocessing thread ID
   */
   @Override
-  public void startReprioritization(long prioritizationTime, String processID, String reproID)
+  public void startReprioritization(String processID, String reproID)
     throws ManifoldCFException
   {
     lockManager.enterWriteLock(trackerWriteLock);
     try
     {
-      Long currentTime = readTime();
       String currentProcessID = readProcessID();
-      if (currentTime != null && currentProcessID != null)
+      if (currentProcessID != null)
       {
         // Already a reprioritization in progress.
-        if (prioritizationTime <= currentTime.longValue())
-          return;
+        return;
       }
-      writeTime(new Long(prioritizationTime));
       writeProcessID(processID);
       writeReproID(reproID);
       try
@@ -90,7 +86,6 @@ public class ReprioritizationTracker imp
       }
       catch (Throwable e)
       {
-        writeTime(null);
         writeProcessID(null);
         writeReproID(null);
         if (e instanceof Error)
@@ -111,30 +106,6 @@ public class ReprioritizationTracker imp
   }
   
   
-  /** Retrieve the current reprioritization time stamp.  This should be obtained before
-  * performing any prioritization steps.
-  *@return the current prioritization timestamp, or null if no prioritization is in effect.
-  */
-  @Override
-  public Long checkReprioritizationInProgress()
-    throws ManifoldCFException
-  {
-    lockManager.enterWriteLock(trackerWriteLock);
-    try
-    {
-      Long currentTime = readTime();
-      String currentProcessID = readProcessID();
-      String currentReproID = readReproID();
-      if (currentTime == null || currentProcessID == null || currentReproID == null)
-        return null;
-      return currentTime;
-    }
-    finally
-    {
-      lockManager.leaveWriteLock(trackerWriteLock);
-    }
-  }
-
   /** Complete a reprioritization activity.  Prioritization will be marked as complete
   * only if the processID matches the one that started the current reprioritization.
   *@param processID is the process ID of the process completing the prioritization.
@@ -146,13 +117,11 @@ public class ReprioritizationTracker imp
     lockManager.enterWriteLock(trackerWriteLock);
     try
     {
-      Long currentTime = readTime();
       String currentProcessID = readProcessID();
       String currentReproID = readReproID();
-      if (currentTime != null && currentProcessID != null && currentReproID
!= null && currentReproID.equals(reproID))
+      if (currentProcessID != null && currentReproID != null && currentReproID.equals(reproID))
       {
         // Null out the fields
-        writeTime(null);
         writeProcessID(null);
         writeReproID(null);
       }
@@ -174,10 +143,9 @@ public class ReprioritizationTracker imp
     lockManager.enterWriteLock(trackerWriteLock);
     try
     {
-      Long currentTime = readTime();
       String currentProcessID = readProcessID();
       String currentReproID = readReproID();
-      if (currentTime != null && currentProcessID != null && currentReproID
!= null && currentProcessID.equals(processID))
+      if (currentProcessID != null && currentReproID != null && currentProcessID.equals(processID))
         return currentReproID;
       return null;
     }
@@ -211,9 +179,8 @@ public class ReprioritizationTracker imp
       lockManager.enterWriteLock(trackerWriteLock);
       try
       {
-        Long reproTime = readTime();
         String processID = readProcessID();
-        if (reproTime == null || processID == null)
+        if (processID == null)
         {
           double currentMinimumDepth = readMinimumDepth();
 
@@ -330,55 +297,6 @@ public class ReprioritizationTracker imp
   
   // Protected methods
   
-  /** Read time.
-  *@return the time, or null if none.
-  */
-  protected Long readTime()
-    throws ManifoldCFException
-  {
-    byte[] timeData = lockManager.readData(trackerTimestampResource);
-    if (timeData == null || timeData.length != 8)
-    {
-      return null;
-    }
-    
-    long rval = (((long)timeData[0]) & 0xffL) +
-      ((((long)timeData[1]) << 8) & 0xff00L) +
-      ((((long)timeData[2]) << 16) & 0xff0000L) +
-      ((((long)timeData[3]) << 24) & 0xff000000L) +
-      ((((long)timeData[4]) << 32) & 0xff00000000L) +
-      ((((long)timeData[5]) << 40) & 0xff0000000000L) +
-      ((((long)timeData[6]) << 48) & 0xff000000000000L) +
-      ((((long)timeData[7]) << 56) & 0xff00000000000000L);
-    
-    return new Long(rval);
-  }
-  
-  /** Write time.
-  *@param time is the time to write.
-  */
-  protected void writeTime(Long timeValue)
-    throws ManifoldCFException
-  {
-    if (timeValue == null)
-      lockManager.writeData(trackerTimestampResource, null);
-    else
-    {
-      long time = timeValue.longValue();
-      byte[] timeData = new byte[8];
-      timeData[0] = (byte)(time & 0xffL);
-      timeData[1] = (byte)((time >> 8) & 0xffL);
-      timeData[2] = (byte)((time >> 16) & 0xffL);
-      timeData[3] = (byte)((time >> 24) & 0xffL);
-      timeData[4] = (byte)((time >> 32) & 0xffL);
-      timeData[5] = (byte)((time >> 40) & 0xffL);
-      timeData[6] = (byte)((time >> 48) & 0xffL);
-      timeData[7] = (byte)((time >> 56) & 0xffL);
-      
-      lockManager.writeData(trackerTimestampResource, timeData);
-    }
-  }
-  
   /** Read process ID.
   *@return processID, or null if none.
   */



Mime
View raw message