Package com.yahoo.documentapi
Class DumpVisitorDataHandler
java.lang.Object
com.yahoo.documentapi.VisitorDataHandler
com.yahoo.documentapi.DumpVisitorDataHandler
- Direct Known Subclasses:
SimpleVisitorDocumentQueue
Implementation of VisitorDataHandler which invokes onDocument() for each received document and onRemove() for each document id that was returned as part of a remove entry. The latter only applies if the visitor was run with visitRemoves enabled.
NOTE: onDocument and onRemove may be called in a re-entrant manner, as these run on top of a thread pool. Any mutation of shared state must be appropriately synchronized.
-
Field Summary
Fields inherited from class com.yahoo.documentapi.VisitorDataHandler
session
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
onDocument
(com.yahoo.document.Document doc, long timeStamp) Called when a document is received.void
Called when a data message is received.abstract void
onRemove
(com.yahoo.document.DocumentId id) Called when a remove is received.Methods inherited from class com.yahoo.documentapi.VisitorDataHandler
ack, getNext, getNext, onDone, reset, setSession
-
Constructor Details
-
DumpVisitorDataHandler
public DumpVisitorDataHandler()
-
-
Method Details
-
onMessage
Description copied from class:VisitorDataHandler
Called when a data message is received. IMPORTANT: May be called concurrently from multiple threads. Any internal state mutations MUST be done in a thread-safe manner.- Specified by:
onMessage
in classVisitorDataHandler
- Parameters:
m
- The message receivedtoken
- A token to reply with when finished processing the message.
-
onDocument
public abstract void onDocument(com.yahoo.document.Document doc, long timeStamp) Called when a document is received. May be called from multiple threads concurrently.- Parameters:
doc
- The document foundtimeStamp
- The time when the document was stored.
-
onRemove
public abstract void onRemove(com.yahoo.document.DocumentId id) Called when a remove is received. May be called from multiple threads concurrently.- Parameters:
id
- The document id that was removed.
-