Class SimpleLoggerResultCallback

  • All Implemented Interfaces:
    FeedClient.ResultCallback

    public class SimpleLoggerResultCallback
    extends Object
    implements FeedClient.ResultCallback
    Simple implementation of the ResultCallback that logs to std err for every X documents: "Result received: 34 (1 failed so far, 2003 sent, success rate 1999.23 docs/sec)." On each failure it will print the Result object content. If tracing is enabled, it will print trace messages to std err as well.
    Author:
    dybis
    • Constructor Detail

      • SimpleLoggerResultCallback

        public SimpleLoggerResultCallback​(AtomicInteger sentDocumentCounter,
                                          int printStatsForEveryXDocument,
                                          boolean ignoreConditionNotMet)
        Constructor
        Parameters:
        sentDocumentCounter - a counter that is increased outside this class, but can be nice to print here.
        printStatsForEveryXDocument - how often to print stats.
    • Method Detail

      • println

        protected void println​(String output)
      • printProgress

        public void printProgress()
        Prints how many documents that are received, failed and sent.
      • newSamplingPeriod

        protected com.yahoo.vespa.http.client.SimpleLoggerResultCallback.DocumentRate newSamplingPeriod​(Instant now)