Class CommandEncoder
- java.lang.Object
-
- io.pravega.client.connection.impl.CommandEncoder
-
public class CommandEncoder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CommandEncoder(java.util.function.Function<java.lang.Long,io.pravega.shared.protocol.netty.AppendBatchSizeTracker> appendTracker, io.pravega.shared.metrics.MetricNotifier metricNotifier, java.io.OutputStream output)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longbatchTimeout(long token)This method is called periodically to close any open batches which exceed their timeouts.voidwrite(io.pravega.shared.protocol.netty.Append append)voidwrite(io.pravega.shared.protocol.netty.WireCommand msg)
-
-
-
Constructor Detail
-
CommandEncoder
@ConstructorProperties({"appendTracker","metricNotifier","output"}) public CommandEncoder(java.util.function.Function<java.lang.Long,io.pravega.shared.protocol.netty.AppendBatchSizeTracker> appendTracker, io.pravega.shared.metrics.MetricNotifier metricNotifier, java.io.OutputStream output)
-
-
Method Detail
-
write
public void write(io.pravega.shared.protocol.netty.WireCommand msg) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(io.pravega.shared.protocol.netty.Append append) throws java.io.IOException- Throws:
java.io.IOException
-
batchTimeout
public long batchTimeout(long token)
This method is called periodically to close any open batches which exceed their timeouts.- Parameters:
token- the token returned by the previous call to this method or -1 if this is the first call to this method.- Returns:
- a token which is used to identify which batch is open.
-
-