Package org.apache.iotdb.rpc
Class ConfigurableTByteBuffer
- java.lang.Object
-
- org.apache.thrift.transport.TTransport
-
- org.apache.thrift.transport.TEndpointTransport
-
- org.apache.iotdb.rpc.ConfigurableTByteBuffer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ConfigurableTByteBuffer extends org.apache.thrift.transport.TEndpointTransportSource code of this class is a copy ofTByteBuffer. However, TByteBuffer is a final class and has only one construction method which uses the default TConfiguration. In some cases, the capacity of our ByteBuffer could be so large that it reaches the MaxMessageSize of thrift. We need to customize the TConfiguration and that is why we use this class.
-
-
Constructor Summary
Constructors Constructor Description ConfigurableTByteBuffer(java.nio.ByteBuffer byteBuffer)ConfigurableTByteBuffer(java.nio.ByteBuffer byteBuffer, org.apache.thrift.TConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurableTByteBufferclear()voidclose()ConfigurableTByteBufferflip()java.nio.ByteBuffergetByteBuffer()booleanisOpen()voidopen()intread(byte[] buf, int off, int len)byte[]toByteArray()voidwrite(byte[] buf, int off, int len)-
Methods inherited from class org.apache.thrift.transport.TEndpointTransport
checkReadBytesAvailable, countConsumedMessageBytes, getConfiguration, getMaxMessageSize, resetConsumedMessageSize, updateKnownMessageSize
-
-
-
-
Constructor Detail
-
ConfigurableTByteBuffer
public ConfigurableTByteBuffer(java.nio.ByteBuffer byteBuffer) throws org.apache.thrift.transport.TTransportException- Throws:
org.apache.thrift.transport.TTransportException
-
ConfigurableTByteBuffer
public ConfigurableTByteBuffer(java.nio.ByteBuffer byteBuffer, org.apache.thrift.TConfiguration configuration) throws org.apache.thrift.transport.TTransportException- Throws:
org.apache.thrift.transport.TTransportException
-
-
Method Detail
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin classorg.apache.thrift.transport.TTransport
-
open
public void open()
- Specified by:
openin classorg.apache.thrift.transport.TTransport
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classorg.apache.thrift.transport.TTransport
-
read
public int read(byte[] buf, int off, int len) throws org.apache.thrift.transport.TTransportException- Specified by:
readin classorg.apache.thrift.transport.TTransport- Throws:
org.apache.thrift.transport.TTransportException
-
write
public void write(byte[] buf, int off, int len) throws org.apache.thrift.transport.TTransportException- Specified by:
writein classorg.apache.thrift.transport.TTransport- Throws:
org.apache.thrift.transport.TTransportException
-
getByteBuffer
public java.nio.ByteBuffer getByteBuffer()
-
clear
public ConfigurableTByteBuffer clear()
-
flip
public ConfigurableTByteBuffer flip()
-
toByteArray
public byte[] toByteArray()
-
-