Package org.archive.crawler.prefetch
Class HostQuotaEnforcer
java.lang.Object
org.archive.modules.Processor
org.archive.crawler.prefetch.HostQuotaEnforcer
- All Implemented Interfaces:
org.archive.checkpointing.Checkpointable
,org.archive.spring.HasKeyedProperties
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.context.Lifecycle
Enforces quotas on a host. Should be configured early in
FetchChain
in
crawler-beans.cxml. Supports quotas on any of the fields tracked in
FetchStats
.- Author:
- nlevitt
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getHost()
protected void
innerProcess
(CrawlURI curi) protected ProcessResult
innerProcessResult
(CrawlURI curi) void
setApplyToSubdomains
(boolean applyToSubdomains) Whether to apply the quotas to each subdomain ofhost
(separately, not cumulatively).void
void
Keys can be any of theFetchStats
keys.void
setServerCache
(ServerCache serverCache) protected boolean
shouldProcess
(CrawlURI curi) Methods inherited from class org.archive.modules.Processor
doCheckpoint, finishCheckpoint, flattenVia, fromCheckpointJson, getBeanName, getEnabled, getKeyedProperties, getRecordedSize, getShouldProcessRule, getURICount, hasHttpAuthenticationCredential, innerRejectProcess, isRunning, isSuccess, process, report, setBeanName, setEnabled, setRecoveryCheckpoint, setShouldProcessRule, start, startCheckpoint, stop, toCheckpointJson
-
Field Details
-
serverCache
-
host
-
applyToSubdomains
protected boolean applyToSubdomains -
quotas
-
-
Constructor Details
-
HostQuotaEnforcer
public HostQuotaEnforcer()
-
-
Method Details
-
getServerCache
-
setServerCache
-
getHost
-
setHost
-
getApplyToSubdomains
public boolean getApplyToSubdomains() -
setApplyToSubdomains
public void setApplyToSubdomains(boolean applyToSubdomains) Whether to apply the quotas to each subdomain ofhost
(separately, not cumulatively). -
getQuotas
-
setQuotas
Keys can be any of theFetchStats
keys. -
shouldProcess
- Specified by:
shouldProcess
in classProcessor
-
innerProcess
- Specified by:
innerProcess
in classProcessor
- Throws:
InterruptedException
-
innerProcessResult
- Overrides:
innerProcessResult
in classProcessor
- Throws:
InterruptedException
-