Class 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, io.pravega.shared.protocol.netty.ReplyProcessor callback, io.pravega.shared.protocol.netty.PravegaNodeUri location)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long batchTimeout​(long token)
      This method is called periodically to close any open batches which exceed their timeouts.
      void write​(io.pravega.shared.protocol.netty.Append append)  
      void write​(io.pravega.shared.protocol.netty.WireCommand msg)  
      • Methods inherited from class java.lang.Object

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

      • CommandEncoder

        @ConstructorProperties({"appendTracker","metricNotifier","output","callback","location"})
        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,
                              io.pravega.shared.protocol.netty.ReplyProcessor callback,
                              io.pravega.shared.protocol.netty.PravegaNodeUri location)
    • 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.