Class JobManager.ThrottleLimit
- java.lang.Object
-
- org.apache.manifoldcf.crawler.jobs.JobManager.ThrottleLimit
-
- All Implemented Interfaces:
ILimitChecker
- Enclosing class:
- JobManager
protected static class JobManager.ThrottleLimit extends java.lang.Object implements ILimitChecker
This class provides the throttling limits for the job queueing query.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,IRepositoryConnector>activeConnectionsprotected java.util.List<DocumentDescription>blockingDocumentArrayprotected java.util.Map<java.lang.String,JobManager.ThrottleJobItem>connectionMapprotected intdocumentsProcessedprotected java.util.Map<java.lang.Long,java.lang.String>jobConnectionprotected java.util.Map<java.lang.Long,JobManager.QueueHashItem>jobQueueHashprotected java.util.Map<java.lang.String,JobManager.MutableInteger>maxConnectionCountsprotected intmaxSetSizeprotected intnprotected java.util.Map<java.lang.String,java.lang.Integer>setSizes-
Fields inherited from interface org.apache.manifoldcf.core.interfaces.ILimitChecker
_rcsid
-
-
Constructor Summary
Constructors Constructor Description ThrottleLimit(int n)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectionName(java.lang.String connectionName, IRepositoryConnector connectorInstance)Add an active connection.voidaddJob(java.lang.Long jobID, java.lang.String connectionName)Add a job/connection name map entry.voidaddLimit(java.lang.String connectionName, java.lang.String regexp, int upperLimit)Add a document limit for a specified connection.booleancheckContinue()See if we should examine another row.booleancheckInclude(IResultRow row)See if a result row should be included in the final result set.booleandoesCompareWork()See if this class can be legitimately compared against another of the same type.ILimitCheckerduplicate()Create a duplicate of this class instance.booleanequals(java.lang.Object object)Compare two objects and see if equal.intgetRemainingDocuments()Get the remaining documents we should query for.inthashCode()Find the hashcode for this class.JobManager.ThrottleLimitmakeDeepCopy()Make a deep copyvoidsetConnectionLimit(java.lang.String connectionName, int maxDocuments)Set a connection-based total document limit.voidtallyBlockingDocuments(BlockingDocuments blockingDocuments)Transfer blocking documents discovered to BlockingDocuments object
-
-
-
Field Detail
-
connectionMap
protected java.util.Map<java.lang.String,JobManager.ThrottleJobItem> connectionMap
-
n
protected final int n
-
jobQueueHash
protected final java.util.Map<java.lang.Long,JobManager.QueueHashItem> jobQueueHash
-
jobConnection
protected java.util.Map<java.lang.Long,java.lang.String> jobConnection
-
activeConnections
protected java.util.Map<java.lang.String,IRepositoryConnector> activeConnections
-
setSizes
protected java.util.Map<java.lang.String,java.lang.Integer> setSizes
-
maxConnectionCounts
protected java.util.Map<java.lang.String,JobManager.MutableInteger> maxConnectionCounts
-
maxSetSize
protected int maxSetSize
-
documentsProcessed
protected int documentsProcessed
-
blockingDocumentArray
protected final java.util.List<DocumentDescription> blockingDocumentArray
-
-
Method Detail
-
tallyBlockingDocuments
public void tallyBlockingDocuments(BlockingDocuments blockingDocuments)
Transfer blocking documents discovered to BlockingDocuments object
-
addJob
public void addJob(java.lang.Long jobID, java.lang.String connectionName)Add a job/connection name map entry.- Parameters:
jobID- is the job id.connectionName- is the connection name.
-
addConnectionName
public void addConnectionName(java.lang.String connectionName, IRepositoryConnector connectorInstance) throws ManifoldCFExceptionAdd an active connection. This is the pool of active connections that will be used for the lifetime of this operation.- Parameters:
connectionName- is the connection name.- Throws:
ManifoldCFException
-
addLimit
public void addLimit(java.lang.String connectionName, java.lang.String regexp, int upperLimit)Add a document limit for a specified connection. This is the limit across all matching bins; if any individual matching bin exceeds that limit, then documents that belong to that bin will be excluded.- Parameters:
connectionName- is the connection name.regexp- is the regular expression, which we will match against various bins.upperLimit- is the maximum count associated with the specified job.
-
setConnectionLimit
public void setConnectionLimit(java.lang.String connectionName, int maxDocuments)Set a connection-based total document limit.
-
doesCompareWork
public boolean doesCompareWork()
See if this class can be legitimately compared against another of the same type.- Specified by:
doesCompareWorkin interfaceILimitChecker- Returns:
- true if comparisons will ever return "true".
-
duplicate
public ILimitChecker duplicate()
Create a duplicate of this class instance. All current state should be preserved. NOTE: Since doesCompareWork() returns false, queries using this limit checker cannot be cached, and therefore duplicate() is never called from the query executor. But it can be called from other places.- Specified by:
duplicatein interfaceILimitChecker- Returns:
- the duplicate.
-
makeDeepCopy
public JobManager.ThrottleLimit makeDeepCopy()
Make a deep copy
-
hashCode
public int hashCode()
Find the hashcode for this class. This will only ever be used if doesCompareWork() returns true.- Specified by:
hashCodein interfaceILimitChecker- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode.
-
equals
public boolean equals(java.lang.Object object)
Compare two objects and see if equal. This will only ever be used if doesCompareWork() returns true.- Specified by:
equalsin interfaceILimitChecker- Overrides:
equalsin classjava.lang.Object- Parameters:
object- is the object to compare against.- Returns:
- true if equal.
-
getRemainingDocuments
public int getRemainingDocuments()
Get the remaining documents we should query for.- Returns:
- the maximal remaining count.
-
checkInclude
public boolean checkInclude(IResultRow row) throws ManifoldCFException
See if a result row should be included in the final result set.- Specified by:
checkIncludein interfaceILimitChecker- Parameters:
row- is the result row to check.- Returns:
- true if it should be included, false otherwise.
- Throws:
ManifoldCFException
-
checkContinue
public boolean checkContinue() throws ManifoldCFExceptionSee if we should examine another row.- Specified by:
checkContinuein interfaceILimitChecker- Returns:
- true if we need to keep going, or false if we are done.
- Throws:
ManifoldCFException
-
-