Package com.yahoo.documentapi
Class DumpVisitorDataHandler
- java.lang.Object
-
- com.yahoo.documentapi.VisitorDataHandler
-
- com.yahoo.documentapi.DumpVisitorDataHandler
-
- Direct Known Subclasses:
SimpleVisitorDocumentQueue
public abstract class DumpVisitorDataHandler extends VisitorDataHandler
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
Constructors Constructor Description DumpVisitorDataHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
onDocument(com.yahoo.document.Document doc, long timeStamp)
Called when a document is received.void
onMessage(com.yahoo.messagebus.Message m, AckToken token)
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
-
-
-
-
Method Detail
-
onMessage
public void onMessage(com.yahoo.messagebus.Message m, AckToken token)
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.
-
-