Class SimpleVisitorDocumentQueue


  • public class SimpleVisitorDocumentQueue
    extends DumpVisitorDataHandler
    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
    • Constructor Detail

      • SimpleVisitorDocumentQueue

        public SimpleVisitorDocumentQueue()
    • Method Detail

      • 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 class VisitorDataHandler
      • 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 class DumpVisitorDataHandler
        Parameters:
        doc - The document found
        timestamp - 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 class DumpVisitorDataHandler
        Parameters:
        docId - The document id that was removed.
      • getDocuments

        public java.util.List<com.yahoo.document.Document> getDocuments()
        Returns:
        a list of all documents retrieved so far