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
ConstructorsConstructorDescriptionVectorAccessibleSerializable(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 TypeMethodDescriptionvoidclear()get()getSv2()longvoidvoidvoidreadFromStream(InputStream input) Reads from an InputStream and parses a RecordBatchDef.voidreadFromStreamWithContainer(VectorContainer myContainer, InputStream input) voidwrite(DataOutput output) voidvoidwriteToStream(OutputStream output) Serializes the VectorAccessible va and writes it to an output streamvoidwriteToStreamAndRetain(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:
readFromStreamin interfaceDrillSerializable- Specified by:
readFromStreamin 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:
writeToStreamin interfaceDrillSerializable- Specified by:
writeToStreamin classAbstractStreamSerializable- Parameters:
output- the OutputStream to write to- Throws:
IOException
-
clear
public void clear() -
get
-
getSv2
-
getTimeNs
public long getTimeNs() -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
read
- Specified by:
readin interfaceDrillSerializable- Throws:
IOException
-
write
- Specified by:
writein interfaceDrillSerializable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-