Package org.apache.drill.exec.cache
Class VectorAccessibleSerializable
java.lang.Object
org.apache.drill.exec.cache.AbstractStreamSerializable
org.apache.drill.exec.cache.VectorAccessibleSerializable
- All Implemented Interfaces:
Externalizable
,Serializable
,DrillSerializable
A wrapper around a VectorAccessible. Will serialize a VectorAccessible and
write to an OutputStream, or can read from an InputStream and construct a new
VectorContainer.
- See Also:
-
Field Summary
Fields inherited from interface org.apache.drill.exec.cache.DrillSerializable
logger
-
Constructor Summary
ConstructorDescriptionVectorAccessibleSerializable
(BufferAllocator allocator) VectorAccessibleSerializable
(WritableBatch batch, BufferAllocator allocator) VectorAccessibleSerializable
(WritableBatch batch, SelectionVector2 sv2, BufferAllocator allocator) Creates a wrapper around batch and sv2 for writing to a stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
get()
getSv2()
long
void
void
void
readFromStream
(InputStream input) Reads from an InputStream and parses a RecordBatchDef.void
readFromStreamWithContainer
(VectorContainer myContainer, InputStream input) void
write
(DataOutput output) void
void
writeToStream
(OutputStream output) Serializes the VectorAccessible va and writes it to an output streamvoid
writeToStreamAndRetain
(OutputStream output)
-
Constructor Details
-
VectorAccessibleSerializable
-
VectorAccessibleSerializable
-
VectorAccessibleSerializable
public VectorAccessibleSerializable(WritableBatch batch, SelectionVector2 sv2, BufferAllocator allocator) Creates a wrapper around batch and sv2 for writing to a stream. sv2 will never be released by this class, and ownership is maintained by caller.- Parameters:
batch
-sv2
-allocator
-
-
-
Method Details
-
readFromStream
Reads from an InputStream and parses a RecordBatchDef. From this, we construct a SelectionVector2 if it exits and construct the vectors and add them to a vector container- Specified by:
readFromStream
in interfaceDrillSerializable
- Specified by:
readFromStream
in classAbstractStreamSerializable
- Parameters:
input
- the InputStream to read from- Throws:
IOException
-
readFromStreamWithContainer
public void readFromStreamWithContainer(VectorContainer myContainer, InputStream input) throws IOException - Throws:
IOException
-
writeToStreamAndRetain
- Throws:
IOException
-
writeToStream
Serializes the VectorAccessible va and writes it to an output stream- Specified by:
writeToStream
in interfaceDrillSerializable
- Specified by:
writeToStream
in classAbstractStreamSerializable
- Parameters:
output
- the OutputStream to write to- Throws:
IOException
-
clear
public void clear() -
get
-
getSv2
-
getTimeNs
public long getTimeNs() -
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceDrillSerializable
- Throws:
IOException
-
write
- Specified by:
write
in interfaceDrillSerializable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-