public class MessageSerializer extends Object
| Constructor and Description |
|---|
MessageSerializer() |
| Modifier and Type | Method and Description |
|---|---|
static int |
bytesToInt(byte[] bytes) |
static ArrowDictionaryBatch |
deserializeDictionaryBatch(MessageReader reader,
Message message,
BufferAllocator alloc)
Deserializes a DictionaryBatch.
|
static ArrowDictionaryBatch |
deserializeDictionaryBatch(ReadChannel in,
ArrowBlock block,
BufferAllocator alloc)
Deserializes a DictionaryBatch knowing the size of the entire message up front.
|
static ArrowMessage |
deserializeMessageBatch(MessageReader reader,
BufferAllocator alloc)
Deserialize a message that is either an ArrowDictionaryBatch or ArrowRecordBatch.
|
static ArrowMessage |
deserializeMessageBatch(ReadChannel in,
BufferAllocator alloc)
Deserialize a message that is either an ArrowDictionaryBatch or ArrowRecordBatch.
|
static ArrowRecordBatch |
deserializeRecordBatch(MessageReader reader,
Message message,
BufferAllocator alloc)
Deserializes a RecordBatch.
|
static ArrowRecordBatch |
deserializeRecordBatch(ReadChannel in,
ArrowBlock block,
BufferAllocator alloc)
Deserializes a RecordBatch knowing the size of the entire message up front.
|
static ArrowRecordBatch |
deserializeRecordBatch(RecordBatch recordBatchFB,
ArrowBuf body)
Deserializes a record batch given the Flatbuffer metadata and in-memory body.
|
static Schema |
deserializeSchema(MessageReader reader)
Deserializes a schema object.
|
static Schema |
deserializeSchema(ReadChannel in)
Deserializes a schema object.
|
static ArrowBlock |
serialize(WriteChannel out,
ArrowDictionaryBatch batch)
Serializes a dictionary ArrowRecordBatch.
|
static ArrowBlock |
serialize(WriteChannel out,
ArrowRecordBatch batch)
Serializes an ArrowRecordBatch.
|
static long |
serialize(WriteChannel out,
Schema schema)
Serialize a schema object.
|
static ByteBuffer |
serializeMessage(com.google.flatbuffers.FlatBufferBuilder builder,
byte headerType,
int headerOffset,
int bodyLength)
Serializes a message header.
|
static long |
writeBatchBuffers(WriteChannel out,
ArrowRecordBatch batch) |
public static int bytesToInt(byte[] bytes)
public static long serialize(WriteChannel out, Schema schema) throws IOException
out - where to write the schemaschema - the object to serialize to outIOException - if something went wrongpublic static Schema deserializeSchema(MessageReader reader) throws IOException
reader - the reader interface to deserialize fromIOException - if something went wrongpublic static Schema deserializeSchema(ReadChannel in) throws IOException
in - the channel to deserialize fromIOException - if something went wrongpublic static ArrowBlock serialize(WriteChannel out, ArrowRecordBatch batch) throws IOException
out - where to write the batchbatch - the object to serialize to outIOException - if something went wrongpublic static long writeBatchBuffers(WriteChannel out, ArrowRecordBatch batch) throws IOException
IOExceptionpublic static ArrowRecordBatch deserializeRecordBatch(MessageReader reader, Message message, BufferAllocator alloc) throws IOException
reader - the reader interface to deserialize frommessage - the object to derialize toalloc - to allocate buffersIOException - if something went wrongpublic static ArrowRecordBatch deserializeRecordBatch(ReadChannel in, ArrowBlock block, BufferAllocator alloc) throws IOException
in - the channel to deserialize fromblock - the object to derialize toalloc - to allocate buffersIOException - if something went wrongpublic static ArrowRecordBatch deserializeRecordBatch(RecordBatch recordBatchFB, ArrowBuf body) throws IOException
recordBatchFB - Deserialized FlatBuffer record batchbody - Read body of the record batchIOExceptionpublic static ArrowBlock serialize(WriteChannel out, ArrowDictionaryBatch batch) throws IOException
out - where to serializebatch - the batch to serializeIOException - if something went wrongpublic static ArrowDictionaryBatch deserializeDictionaryBatch(MessageReader reader, Message message, BufferAllocator alloc) throws IOException
reader - where to read frommessage - the message message metadata to deserializealloc - the allocator for new buffersIOException - if something went wrongpublic static ArrowDictionaryBatch deserializeDictionaryBatch(ReadChannel in, ArrowBlock block, BufferAllocator alloc) throws IOException
in - where to read fromblock - block metadata for deserializingalloc - to allocate new buffersIOException - if something went wrongpublic static ArrowMessage deserializeMessageBatch(MessageReader reader, BufferAllocator alloc) throws IOException
reader - Interface to read messages fromalloc - Allocator for message dataIOException - if the message is not an ArrowDictionaryBatch or ArrowRecordBatchpublic static ArrowMessage deserializeMessageBatch(ReadChannel in, BufferAllocator alloc) throws IOException
in - ReadChannel to read messages fromalloc - Allocator for message dataIOException - if the message is not an ArrowDictionaryBatch or ArrowRecordBatchpublic static ByteBuffer serializeMessage(com.google.flatbuffers.FlatBufferBuilder builder, byte headerType, int headerOffset, int bodyLength)
builder - to write the flatbuf toheaderType - headerType fieldheaderOffset - header offset fieldbodyLength - body length fieldCopyright © 2017 The Apache Software Foundation. All rights reserved.