Class 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.

    • Constructor Detail

      • DumpVisitorDataHandler

        public DumpVisitorDataHandler()
    • 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 class VisitorDataHandler
        Parameters:
        m - The message received
        token - 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 found
        timeStamp - 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.