public class ThrottledFetcher
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ThrottledFetcher.AbortChecker
This class furnishes an abort signal whenever the job activity says it should.
|
protected static class |
ThrottledFetcher.ExecuteMethodThread
This thread does the actual socket communication with the server.
|
protected static class |
ThrottledFetcher.ThrottledConnection
This class represents an established connection to a URL.
|
protected static class |
ThrottledFetcher.ThrottledInputstream
This class throttles an input stream based on the specified byte rate parameters.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
_rcsid |
protected static int |
globalHandleCount
This counter keeps track of the total outstanding handles across everything, because we do try to control that
|
protected static java.lang.Integer |
globalHandleCounterLock
This is the lock object for that global handle counter
|
protected static int |
READ_CHUNK_LENGTH
The read chunk length
|
protected static boolean |
recordEverything
This flag determines whether we record everything to the disk, as a means of doing a web snapshot
|
protected int |
refCount
Reference count for how many connections to this pool there are
|
protected java.util.Map<java.lang.String,org.apache.manifoldcf.connectorcommon.interfaces.IConnectionThrottler> |
serverMap
This hash maps the server string (without port) to a pool throttling object, where
we can track the statistics and make sure we throttle appropriately
|
| Constructor and Description |
|---|
ThrottledFetcher()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IThrottledConnection |
createConnection(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext,
java.lang.String throttleGroupName,
java.lang.String serverName,
int connectionLimit,
int connectionTimeoutMilliseconds,
java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyAuthDomain,
java.lang.String proxyAuthUsername,
java.lang.String proxyAuthPassword,
org.apache.manifoldcf.crawler.interfaces.IAbortActivity activities)
Establish a connection to a specified URL.
|
void |
noteConnectionEstablished()
Note that there is a repository connection that is using this object.
|
void |
noteConnectionReleased()
Connection pool no longer needed.
|
void |
poll()
Poll.
|
protected static void |
registerGlobalHandle(int maxHandles)
Note that we're about to need a handle (and make sure we have enough)
|
protected static void |
releaseGlobalHandle()
Note that we're done with a handle (so we can free it)
|
public static final java.lang.String _rcsid
protected static final boolean recordEverything
protected static final int READ_CHUNK_LENGTH
protected static int globalHandleCount
protected static java.lang.Integer globalHandleCounterLock
protected final java.util.Map<java.lang.String,org.apache.manifoldcf.connectorcommon.interfaces.IConnectionThrottler> serverMap
protected int refCount
protected static void registerGlobalHandle(int maxHandles)
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionprotected static void releaseGlobalHandle()
public IThrottledConnection createConnection(org.apache.manifoldcf.core.interfaces.IThreadContext threadContext, java.lang.String throttleGroupName, java.lang.String serverName, int connectionLimit, int connectionTimeoutMilliseconds, java.lang.String proxyHost, int proxyPort, java.lang.String proxyAuthDomain, java.lang.String proxyAuthUsername, java.lang.String proxyAuthPassword, org.apache.manifoldcf.crawler.interfaces.IAbortActivity activities) throws org.apache.manifoldcf.core.interfaces.ManifoldCFException, org.apache.manifoldcf.agents.interfaces.ServiceInterruption
serverName - is the FQDN of the server, e.g. foo.metacarta.comconnectionLimit - is the maximum desired outstanding connections at any one time.connectionTimeoutMilliseconds - is the number of milliseconds to wait for the connection before timing out.org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionorg.apache.manifoldcf.agents.interfaces.ServiceInterruptionpublic void poll()
throws org.apache.manifoldcf.core.interfaces.ManifoldCFException
org.apache.manifoldcf.core.interfaces.ManifoldCFExceptionpublic void noteConnectionEstablished()
public void noteConnectionReleased()