Package com.yahoo.documentapi
Class SimpleVisitorDocumentQueue
java.lang.Object
com.yahoo.documentapi.VisitorDataHandler
com.yahoo.documentapi.DumpVisitorDataHandler
com.yahoo.documentapi.SimpleVisitorDocumentQueue
A simple document queue that queues up all results and automatically acks
them.
Retrieving the list is not thread safe, so wait until visitor is done. This is a simple class merely meant for testing.
- Author:
- HÃ¥kon Humberset
-
Field Summary
Fields inherited from class com.yahoo.documentapi.VisitorDataHandler
session
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionList<com.yahoo.document.Document>
void
onDocument
(com.yahoo.document.Document doc, long timestamp) Called when a document is received.void
onRemove
(com.yahoo.document.DocumentId docId) Called when a remove is received.void
reset()
Called before the visitor starts.Methods inherited from class com.yahoo.documentapi.DumpVisitorDataHandler
onMessage
Methods inherited from class com.yahoo.documentapi.VisitorDataHandler
ack, getNext, getNext, onDone, setSession
-
Constructor Details
-
SimpleVisitorDocumentQueue
public SimpleVisitorDocumentQueue()
-
-
Method Details
-
reset
public void reset()Description copied from class:VisitorDataHandler
Called before the visitor starts. Override this method if you need to reset local data. Remember to call the superclass' method as well.- Overrides:
reset
in classVisitorDataHandler
-
onDocument
public void onDocument(com.yahoo.document.Document doc, long timestamp) Description copied from class:DumpVisitorDataHandler
Called when a document is received. May be called from multiple threads concurrently.- Specified by:
onDocument
in classDumpVisitorDataHandler
- Parameters:
doc
- The document foundtimestamp
- The time when the document was stored.
-
onRemove
public void onRemove(com.yahoo.document.DocumentId docId) Description copied from class:DumpVisitorDataHandler
Called when a remove is received. May be called from multiple threads concurrently.- Specified by:
onRemove
in classDumpVisitorDataHandler
- Parameters:
docId
- The document id that was removed.
-
getDocuments
- Returns:
- a list of all documents retrieved so far
-