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
Modifier and TypeFieldDescriptionprotected long
protected long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkReadBytesAvailable
(long numBytes) Throws if there are not enough bytes in the input stream to satisfy a read of numBytes bytes of dataprotected void
countConsumedMessageBytes
(long numBytes) Consumes numBytes from the RemainingMessageSize.int
protected long
protected void
resetConsumedMessageSize
(long newSize) Resets RemainingMessageSize to the configured maximumvoid
setMaxFrameSize
(int maxFrameSize) void
updateKnownMessageSize
(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:
getConfiguration
in 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:
updateKnownMessageSize
in 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:
checkReadBytesAvailable
in classTTransport
- Parameters:
numBytes
-- Throws:
TTransportException
-
countConsumedMessageBytes
Consumes numBytes from the RemainingMessageSize.- Parameters:
numBytes
-- Throws:
TTransportException
-