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.AppendBatchSizeTracker
SeeAppendBatchSizeTracker
. 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_MILLIS
or 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 int
getAppendBlockSize()
Returns a block size that is an estimate of how much data will be written in the nextAppendBatchSizeTracker.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)
-
-
-
Method Detail
-
recordAppend
public void recordAppend(long eventNumber, int size)
- Specified by:
recordAppend
in interfaceio.pravega.shared.protocol.netty.AppendBatchSizeTracker
-
recordAck
public long recordAck(long eventNumber)
- Specified by:
recordAck
in 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_MILLIS
or half the server round trip time (whichever is less).- Specified by:
getAppendBlockSize
in interfaceio.pravega.shared.protocol.netty.AppendBatchSizeTracker
-
getBatchTimeout
public int getBatchTimeout()
- Specified by:
getBatchTimeout
in interfaceio.pravega.shared.protocol.netty.AppendBatchSizeTracker
-
-