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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<com.yahoo.document.Document>voidonDocument(com.yahoo.document.Document doc, long timestamp) Called when a document is received.voidonRemove(com.yahoo.document.DocumentId docId) Called when a remove is received.voidreset()Called before the visitor starts.Methods inherited from class com.yahoo.documentapi.DumpVisitorDataHandler
onMessageMethods 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:VisitorDataHandlerCalled before the visitor starts. Override this method if you need to reset local data. Remember to call the superclass' method as well.- Overrides:
resetin classVisitorDataHandler
-
onDocument
public void onDocument(com.yahoo.document.Document doc, long timestamp) Description copied from class:DumpVisitorDataHandlerCalled when a document is received. May be called from multiple threads concurrently.- Specified by:
onDocumentin 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:DumpVisitorDataHandlerCalled when a remove is received. May be called from multiple threads concurrently.- Specified by:
onRemovein classDumpVisitorDataHandler- Parameters:
docId- The document id that was removed.
-
getDocuments
- Returns:
- a list of all documents retrieved so far
-