Class TLayeredTransport

java.lang.Object
org.apache.thrift.transport.TTransport
org.apache.thrift.transport.layered.TLayeredTransport
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
TFastFramedTransport, TFramedTransport

public abstract class TLayeredTransport extends TTransport
  • Constructor Details

    • TLayeredTransport

      public TLayeredTransport(TTransport transport)
  • Method Details

    • getConfiguration

      public TConfiguration getConfiguration()
      Specified by:
      getConfiguration in class TTransport
    • updateKnownMessageSize

      public void updateKnownMessageSize(long size) throws TTransportException
      Specified by:
      updateKnownMessageSize in class TTransport
      Throws:
      TTransportException
    • checkReadBytesAvailable

      public void checkReadBytesAvailable(long numBytes) throws TTransportException
      Specified by:
      checkReadBytesAvailable in class TTransport
      Throws:
      TTransportException
    • resetMessageSizeAndConsumedBytes

      public void resetMessageSizeAndConsumedBytes(long newSize) throws TTransportException
      Description copied from class: TTransport
      Sets the read budget to newSize, discarding whatever has been consumed against the previous one. A negative size restores the configured maximum.

      This is the only way to widen a budget that an earlier, smaller message narrowed: updateKnownMessageSize() refuses to grow one, and carries the previous message's consumption forward besides. A caller that learns the real size of a message -- a framed transport reading a frame header, say -- wants this rather than updateKnownMessageSize(), because the reads that told it the size were themselves charged against the budget it is about to replace.

      Specified by:
      resetMessageSizeAndConsumedBytes in class TTransport
      Parameters:
      newSize - the size to bind the budget to, or a negative value for the configured maximum
      Throws:
      TTransportException
    • getInnerTransport

      public TTransport getInnerTransport()
    • configuredMaxFrameSize

      protected static int configuredMaxFrameSize(TTransport transport)
      The maximum frame size a transport is already configured with, or the library default if it carries no configuration at all. A layered transport that was not asked for a maximum of its own passes this back, so that wrapping a transport cannot raise a limit its owner lowered.