Class AppendBatchSizeTrackerImpl
- java.lang.Object
-
- io.pravega.client.connection.impl.AppendBatchSizeTrackerImpl
-
- All Implemented Interfaces:
io.pravega.shared.protocol.netty.AppendBatchSizeTracker
public class AppendBatchSizeTrackerImpl extends java.lang.Object implements io.pravega.shared.protocol.netty.AppendBatchSizeTrackerSeeAppendBatchSizeTracker. 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 nextAppendBatchSizeTracker.MAX_BATCH_TIME_MILLISor half the server round trip time (whichever is less)
-
-
Constructor Summary
Constructors Constructor Description AppendBatchSizeTrackerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAppendBlockSize()Returns a block size that is an estimate of how much data will be written in the nextAppendBatchSizeTracker.MAX_BATCH_TIME_MILLISor half the server round trip time (whichever is less).intgetBatchTimeout()longrecordAck(long eventNumber)voidrecordAppend(long eventNumber, int size)
-
-
-
Method Detail
-
recordAppend
public void recordAppend(long eventNumber, int size)- Specified by:
recordAppendin interfaceio.pravega.shared.protocol.netty.AppendBatchSizeTracker
-
recordAck
public long recordAck(long eventNumber)
- Specified by:
recordAckin interfaceio.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 nextAppendBatchSizeTracker.MAX_BATCH_TIME_MILLISor half the server round trip time (whichever is less).- Specified by:
getAppendBlockSizein interfaceio.pravega.shared.protocol.netty.AppendBatchSizeTracker
-
getBatchTimeout
public int getBatchTimeout()
- Specified by:
getBatchTimeoutin interfaceio.pravega.shared.protocol.netty.AppendBatchSizeTracker
-
-