Package org.apache.thrift.transport
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckReadBytesAvailable(long numBytes) Throws if there are not enough bytes in the input stream to satisfy a read of numBytes bytes of dataprotected voidcountConsumedMessageBytes(long numBytes) Consumes numBytes from the RemainingMessageSize.intprotected longprotected voidresetConsumedMessageSize(long newSize) Resets RemainingMessageSize to the configured maximumvoidsetMaxFrameSize(int maxFrameSize) voidupdateKnownMessageSize(long size) Updates RemainingMessageSize to reflect then known real message size (e.g. framed transport).Methods inherited from class org.apache.thrift.transport.TTransport
close, consumeBuffer, flush, getBuffer, getBufferPosition, getBytesRemainingInBuffer, isOpen, open, peek, read, read, readAll, write, write, write
-
Field Details
-
knownMessageSize
protected long knownMessageSize -
remainingMessageSize
protected long remainingMessageSize
-
-
Constructor Details
-
TEndpointTransport
- Throws:
TTransportException
-
-
Method Details
-
getMaxMessageSize
protected long getMaxMessageSize() -
getMaxFrameSize
public int getMaxFrameSize() -
setMaxFrameSize
public void setMaxFrameSize(int maxFrameSize) -
getConfiguration
- Specified by:
getConfigurationin classTTransport
-
resetConsumedMessageSize
Resets RemainingMessageSize to the configured maximum- Parameters:
newSize-- Throws:
TTransportException
-
updateKnownMessageSize
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:
updateKnownMessageSizein classTTransport- Parameters:
size-- Throws:
TTransportException
-
checkReadBytesAvailable
Throws if there are not enough bytes in the input stream to satisfy a read of numBytes bytes of data- Specified by:
checkReadBytesAvailablein classTTransport- Parameters:
numBytes-- Throws:
TTransportException
-
countConsumedMessageBytes
Consumes numBytes from the RemainingMessageSize.- Parameters:
numBytes-- Throws:
TTransportException
-