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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckReadBytesAvailable(long numBytes) protected static intconfiguredMaxFrameSize(TTransport transport) The maximum frame size a transport is already configured with, or the library default if it carries no configuration at all.voidresetMessageSizeAndConsumedBytes(long newSize) Sets the read budget tonewSize, discarding whatever has been consumed against the previous one.voidupdateKnownMessageSize(long size) Methods inherited from class org.apache.thrift.transport.TTransport
close, consumeBuffer, flush, getBuffer, getBufferPosition, getBytesRemainingInBuffer, isOpen, open, peek, read, read, readAll, resetMessageSizeAndConsumedBytes, write, write, write
-
Constructor Details
-
TLayeredTransport
-
-
Method Details
-
getConfiguration
- Specified by:
getConfigurationin classTTransport
-
updateKnownMessageSize
- Specified by:
updateKnownMessageSizein classTTransport- Throws:
TTransportException
-
checkReadBytesAvailable
- Specified by:
checkReadBytesAvailablein classTTransport- Throws:
TTransportException
-
resetMessageSizeAndConsumedBytes
Description copied from class:TTransportSets the read budget tonewSize, 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:
resetMessageSizeAndConsumedBytesin classTTransport- Parameters:
newSize- the size to bind the budget to, or a negative value for the configured maximum- Throws:
TTransportException
-
getInnerTransport
-
configuredMaxFrameSize
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.
-