public class ErrorCache
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,CollectionConfiguration.FailDoc> |
cache |
private Fulltext |
fulltext |
private static ConcurrentLog |
log |
private static int |
maxStackSize |
Constructor and Description |
---|
ErrorCache(Fulltext fulltext) |
Modifier and Type | Method and Description |
---|---|
private void |
checkStackSize() |
void |
clear() |
void |
clearCache() |
void |
clearStack() |
java.util.ArrayList<CollectionConfiguration.FailDoc> |
list(int max) |
void |
push(DigestURL url,
int crawldepth,
CrawlProfile profile,
FailCategory failCategory,
java.lang.String anycause,
int httpcode)
Adds a error document to the Solr index (marked as failed by httpstatus_i <> 200)
and caches recently added failed docs (up to maxStackSize = 1000)
|
void |
removeHosts(java.util.Set<java.lang.String> hosthashes) |
int |
stackSize() |
private static final ConcurrentLog log
private static final int maxStackSize
private final java.util.Map<java.lang.String,CollectionConfiguration.FailDoc> cache
private final Fulltext fulltext
public ErrorCache(Fulltext fulltext)
public void clearCache()
public void clear() throws java.io.IOException
java.io.IOException
public void removeHosts(java.util.Set<java.lang.String> hosthashes)
public void push(DigestURL url, int crawldepth, CrawlProfile profile, FailCategory failCategory, java.lang.String anycause, int httpcode)
url
- failed urlcrawldepth
- info crawldepthprofile
- info of collectionfailCategory
- .store to index otherwise cache onlyanycause
- info cause-stringhttpcode
- http response codeprivate void checkStackSize()
public java.util.ArrayList<CollectionConfiguration.FailDoc> list(int max)
public void clearStack()
public int stackSize()