Class TEndpointTransport

java.lang.Object
org.apache.thrift.transport.TTransport
org.apache.thrift.transport.TEndpointTransport
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
AutoExpandingBufferReadTransport, AutoExpandingBufferWriteTransport, TByteBuffer, THttpClient, TIOStreamTransport, TMemoryBuffer, TMemoryInputTransport, TMemoryTransport, TNonblockingTransport, TSaslClientTransport, TSaslServerTransport, TSimpleFileTransport

public abstract class TEndpointTransport extends TTransport
  • Field Details

    • knownMessageSize

      protected long knownMessageSize
    • remainingMessageSize

      protected long remainingMessageSize
  • Constructor Details

  • Method Details

    • getMaxMessageSize

      protected long getMaxMessageSize()
    • getMaxFrameSize

      public int getMaxFrameSize()
    • setMaxFrameSize

      public void setMaxFrameSize(int maxFrameSize)
    • getConfiguration

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

      protected void resetConsumedMessageSize(long newSize) throws TTransportException
      Resets RemainingMessageSize to the configured maximum
      Parameters:
      newSize -
      Throws:
      TTransportException
    • updateKnownMessageSize

      public void updateKnownMessageSize(long size) throws TTransportException
      Updates RemainingMessageSize to reflect then known real message size (e.g. framed transport). Will throw if we already consumed too many bytes or if the new size is larger than allowed.
      Specified by:
      updateKnownMessageSize in class TTransport
      Parameters:
      size -
      Throws:
      TTransportException
    • checkReadBytesAvailable

      public void checkReadBytesAvailable(long numBytes) throws TTransportException
      Throws if there are not enough bytes in the input stream to satisfy a read of numBytes bytes of data
      Specified by:
      checkReadBytesAvailable in class TTransport
      Parameters:
      numBytes -
      Throws:
      TTransportException
    • countConsumedMessageBytes

      protected void countConsumedMessageBytes(long numBytes) throws TTransportException
      Consumes numBytes from the RemainingMessageSize.
      Parameters:
      numBytes -
      Throws:
      TTransportException