Package com.norconex.crawler.core.ledger
Class CrawlerEntry
java.lang.Object
com.norconex.crawler.core.ledger.CrawlerEntry
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FsCrawlerEntry,WebCrawlerEntry
Holds minimal meta information and state necessary to the proper
(re)processing of a document in the context of a crawl.
Also persisted in the
CrawlerEntryLedger.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToReferenceTrail(String reference) Adds original references before normalization, redirect, etc.protected booleanbooleanintHow many documents were split off from or found embedded in this one the last time it was processed.Gets the content checksum.intgetDepth()Typically, the number of "hops" or directories to get to a file.The reference of the document this one was split off from or found embedded in (a chunk of a text, a zip entry, an attachment), ornullfor a document that stands on its own.Identifies the taking of this entry for processing bygetProcessingNode(), new each time it is taken.The name of the node that last took this entry for processing, set when the entry turnedProcessingStatus.PROCESSING.@NonNull ProcessingStatusGets the queued date.Gets original references before normalization, redirect, etc.inthashCode()booleanbooleanisOrphan()booleanWhether the node holding this entry for processing started sending it (or documents found in it) to committers.voidsetCharset(Charset charset) voidsetChildCount(int childCount) How many documents were split off from or found embedded in this one the last time it was processed.voidsetContentChecksum(String contentChecksum) Sets the content checksum.voidsetContentType(ContentType contentType) voidsetDeleted(boolean deleted) voidsetDepth(int depth) Typically, the number of "hops" or directories to get to a file.voidsetLastModified(ZonedDateTime lastModified) voidsetMetaChecksum(String metaChecksum) voidsetOrphan(boolean orphan) voidsetParentReference(String parentReference) The reference of the document this one was split off from or found embedded in (a chunk of a text, a zip entry, an attachment), ornullfor a document that stands on its own.voidsetProcessedAt(ZonedDateTime processedAt) voidsetProcessingAt(ZonedDateTime processingAt) voidsetProcessingClaim(String processingClaim) Identifies the taking of this entry for processing bygetProcessingNode(), new each time it is taken.voidsetProcessingNode(String processingNode) The name of the node that last took this entry for processing, set when the entry turnedProcessingStatus.PROCESSING.voidsetProcessingOutcome(ProcessingOutcome processingOutcome) voidsetProcessingStatus(@NonNull ProcessingStatus processingStatus) voidsetQueuedAt(ZonedDateTime queuedAt) Sets the queued date.voidsetReference(String reference) voidsetReferenceTrail(List<String> referenceTrail) Sets original references before normalization, redirect, etc.voidsetSending(boolean sending) Whether the node holding this entry for processing started sending it (or documents found in it) to committers.toString()withReference(String reference)
-
Constructor Details
-
CrawlerEntry
public CrawlerEntry() -
CrawlerEntry
-
-
Method Details
-
withReference
-
getReferenceTrail
Gets original references before normalization, redirect, etc.- Returns:
- reference trail up to, but excluding, the current one.
-
setReferenceTrail
Sets original references before normalization, redirect, etc.- Parameters:
referenceTrail- reference trail up to, but excluding, the current one.
-
addToReferenceTrail
Adds original references before normalization, redirect, etc.- Parameters:
reference- reference to append to the trail
-
getMetaChecksum
-
setMetaChecksum
-
getContentChecksum
Gets the content checksum.- Returns:
- the content checksum
-
setContentChecksum
Sets the content checksum.- Parameters:
contentChecksum- content checksum
-
getQueuedAt
Gets the queued date.- Returns:
- the queued date
-
setQueuedAt
Sets the queued date.- Parameters:
queuedAt- the queued date
-
getDepth
public int getDepth()Typically, the number of "hops" or directories to get to a file. -
getProcessingStatus
-
getProcessingOutcome
-
getProcessingAt
-
getProcessingNode
The name of the node that last took this entry for processing, set when the entry turnedProcessingStatus.PROCESSING. If that node leaves the crawl before finishing it, another node puts the entry back in the queue. -
getProcessingClaim
Identifies the taking of this entry for processing bygetProcessingNode(), new each time it is taken. Lets the node processing it tell whether it still holds it before sending it to committers or recording its outcome. -
isSending
public boolean isSending()Whether the node holding this entry for processing started sending it (or documents found in it) to committers. If that node stops working on the crawl after that, the entry is processed again and may reach committers twice. -
getProcessedAt
-
getLastModified
-
getContentType
-
getCharset
-
isOrphan
public boolean isOrphan() -
isDeleted
public boolean isDeleted() -
getReference
-
getParentReference
The reference of the document this one was split off from or found embedded in (a chunk of a text, a zip entry, an attachment), ornullfor a document that stands on its own. -
getChildCount
public int getChildCount()How many documents were split off from or found embedded in this one the last time it was processed. Zero for most documents. Only a count, never the references: a parent can have hundreds of thousands of children, and an entry is read and written many times in a crawl. When it is above zero, the children are found through theirgetParentReference(). -
setDepth
public void setDepth(int depth) Typically, the number of "hops" or directories to get to a file. -
setProcessingStatus
-
setProcessingOutcome
-
setProcessingAt
-
setProcessingNode
The name of the node that last took this entry for processing, set when the entry turnedProcessingStatus.PROCESSING. If that node leaves the crawl before finishing it, another node puts the entry back in the queue. -
setProcessingClaim
Identifies the taking of this entry for processing bygetProcessingNode(), new each time it is taken. Lets the node processing it tell whether it still holds it before sending it to committers or recording its outcome. -
setSending
public void setSending(boolean sending) Whether the node holding this entry for processing started sending it (or documents found in it) to committers. If that node stops working on the crawl after that, the entry is processed again and may reach committers twice. -
setProcessedAt
-
setLastModified
-
setContentType
-
setCharset
-
setOrphan
public void setOrphan(boolean orphan) -
setDeleted
public void setDeleted(boolean deleted) -
setReference
-
setParentReference
The reference of the document this one was split off from or found embedded in (a chunk of a text, a zip entry, an attachment), ornullfor a document that stands on its own. -
setChildCount
public void setChildCount(int childCount) How many documents were split off from or found embedded in this one the last time it was processed. Zero for most documents. Only a count, never the references: a parent can have hundreds of thousands of children, and an entry is read and written many times in a crawl. When it is above zero, the children are found through theirgetParentReference(). -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-