Class AppendBatchSizeTrackerImpl

  • All Implemented Interfaces:
    io.pravega.shared.protocol.netty.AppendBatchSizeTracker

    public class AppendBatchSizeTrackerImpl
    extends java.lang.Object
    implements io.pravega.shared.protocol.netty.AppendBatchSizeTracker
    See AppendBatchSizeTracker. This implementation tracks three things: 1. The time between appends 2. The size of each append 3. The number of unackedAppends there are outstanding If the number of unacked appends is <= 1 batching is disabled. This improves latency for low volume and synchronous writers. Otherwise the batch size is set to the amount of data that will be written in the next AppendBatchSizeTracker.MAX_BATCH_TIME_MILLIS or half the server round trip time (whichever is less)
    • Field Summary

      • Fields inherited from interface io.pravega.shared.protocol.netty.AppendBatchSizeTracker

        MAX_BATCH_TIME_MILLIS
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAppendBlockSize()
      Returns a block size that is an estimate of how much data will be written in the next AppendBatchSizeTracker.MAX_BATCH_TIME_MILLIS or half the server round trip time (whichever is less).
      int getBatchTimeout()  
      long recordAck​(long eventNumber)  
      void recordAppend​(long eventNumber, int size)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AppendBatchSizeTrackerImpl

        public AppendBatchSizeTrackerImpl()
    • Method Detail

      • recordAppend

        public void recordAppend​(long eventNumber,
                                 int size)
        Specified by:
        recordAppend in interface io.pravega.shared.protocol.netty.AppendBatchSizeTracker
      • recordAck

        public long recordAck​(long eventNumber)
        Specified by:
        recordAck in interface io.pravega.shared.protocol.netty.AppendBatchSizeTracker
      • getAppendBlockSize

        public int getAppendBlockSize()
        Returns a block size that is an estimate of how much data will be written in the next AppendBatchSizeTracker.MAX_BATCH_TIME_MILLIS or half the server round trip time (whichever is less).
        Specified by:
        getAppendBlockSize in interface io.pravega.shared.protocol.netty.AppendBatchSizeTracker
      • getBatchTimeout

        public int getBatchTimeout()
        Specified by:
        getBatchTimeout in interface io.pravega.shared.protocol.netty.AppendBatchSizeTracker