public final class Avro extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
decode(Object typeDescriptor,
ByteBuffer encodedObject)
Decodes an Avro binary object.
|
static <T> List<T> |
decode(Object typeDescriptor,
List<ByteBuffer> encodedObjects)
Decodes a homogeneous list of Avro binary objects.
|
static <T> List<T> |
decode(Object typeDescriptor,
List<ByteBuffer> encodedObjects,
int threadCount,
ExecutorService executor)
Decodes a homogeneous list of Avro binary objects, optionally using
multiple threads and/or a supplied executor.
|
static <T> List<T> |
decode(Object typeDescriptor,
List<ByteBuffer> encodedObjects,
int start,
int count)
Decodes a homogeneous portion of a list of Avro binary objects.
|
static <T> List<T> |
decode(Object typeDescriptor,
List<ByteBuffer> encodedObjects,
int start,
int count,
int threadCount,
ExecutorService executor)
Decodes a homogeneous portion of a list of Avro binary objects,
optionally using multiple threads, with or without a supplied executor.
|
static <T extends org.apache.avro.generic.IndexedRecord> |
decode(T object,
ByteBuffer encodedObject)
Decodes an Avro binary object into a pre-created destination object.
|
static <T extends org.apache.avro.generic.IndexedRecord> |
encode(List<T> objects)
Encodes a list of Avro-compatible objects into Avro binary format.
|
static <T extends org.apache.avro.generic.IndexedRecord> |
encode(List<T> objects,
int threadCount,
ExecutorService executor)
Encodes a list of Avro-compatible objects into Avro binary format,
optionally using multiple threads, with or without a supplied executor.
|
static <T extends org.apache.avro.generic.IndexedRecord> |
encode(List<T> objects,
int start,
int count)
Encodes a portion of list of Avro-compatible objects into Avro binary
format.
|
static <T extends org.apache.avro.generic.IndexedRecord> |
encode(List<T> objects,
int start,
int count,
int threadCount,
ExecutorService executor)
Encodes a portion of list of Avro-compatible objects into Avro binary
format, optionally using multiple threads, with or without a supplied
executor.
|
static <T extends org.apache.avro.generic.IndexedRecord> |
encode(T object)
Encodes an Avro-compatible object into Avro binary format.
|
static <T> List<ByteBuffer> |
encode(TypeObjectMap<T> typeObjectMap,
List<T> objects)
Encodes a list of non-Avro-compatible objects into Avro binary format
using the specified type object map.
|
static <T> List<ByteBuffer> |
encode(TypeObjectMap<T> typeObjectMap,
List<T> objects,
int threadCount,
ExecutorService executor)
Encodes a list of non-Avro-compatible objects into Avro binary format
using the specified type object map, optionally using multiple threads,
with or without a supplied executor.
|
static <T> List<ByteBuffer> |
encode(TypeObjectMap<T> typeObjectMap,
List<T> objects,
int start,
int count)
Encodes a portion of list of non-Avro-compatible objects into Avro binary
format using the specified type object map.
|
static <T> List<ByteBuffer> |
encode(TypeObjectMap<T> typeObjectMap,
List<T> objects,
int start,
int count,
int threadCount,
ExecutorService executor)
Encodes a portion of list of Avro-compatible objects into Avro binary
format using the specified type object map, optionally using multiple
threads, with or without a supplied executor.
|
static <T> ByteBuffer |
encode(TypeObjectMap<T> typeObjectMap,
T object)
Encodes a non-Avro-compatible object into Avro binary format using the
specified type object map.
|
public static <T extends org.apache.avro.generic.IndexedRecord> T decode(T object,
ByteBuffer encodedObject)
throws GPUdbException
T - the type of object being decodedobject - the destination objectencodedObject - the Avro binary objectobject
parameter)GPUdbException - if a decoding error occurspublic static <T> T decode(Object typeDescriptor, ByteBuffer encodedObject) throws GPUdbException
T - the type of object being decodedtypeDescriptor - type descriptor for the type of object being
decodedencodedObject - the Avro binary objectIllegalArgumentException - if typeDescriptor is not a
Schema, Type, TypeObjectMap, or Class
that implements IndexedRecordGPUdbException - if a decoding error occursGPUdbRuntimeException - if unable to instantiate the class
specified by typeDescriptorpublic static <T> List<T> decode(Object typeDescriptor, List<ByteBuffer> encodedObjects, int start, int count) throws GPUdbException
T - the type of objects being decodedtypeDescriptor - type descriptor for the type of objects being
decodedencodedObjects - list of Avro binary objectsstart - index of first object within
encodedObjects to decodecount - number of objects within encodedObjects to
decodeIndexOutOfBoundsException - if start is less than zero,
count is less than zero, or start plus count
exceeds the length of encodedObjectsIllegalArgumentException - if typeDescriptor is not a
Schema, Type, TypeObjectMap, or Class
that implements IndexedRecordGPUdbException - if a decoding error occursGPUdbRuntimeException - if unable to instantiate the class
specified by typeDescriptorpublic static <T> List<T> decode(Object typeDescriptor, List<ByteBuffer> encodedObjects, int start, int count, int threadCount, ExecutorService executor) throws GPUdbException
T - the type of objects being decodedtypeDescriptor - type descriptor for the type of objects being
decodedencodedObjects - list of Avro binary objectsstart - index of first object within
encodedObjects to decodecount - number of objects within encodedObjects to
decodethreadCount - number of threads to use for decoding.executor - optional executor responsible for managing
threads; null to create threads on
demandIndexOutOfBoundsException - if start is less than zero,
count is less than zero, or start plus count
exceeds the length of encodedObjectsIllegalArgumentException - if threadCount is less than one
or typeDescriptor is not a Schema, Type, TypeObjectMap, or Class that implements IndexedRecordGPUdbException - if a decoding error occursGPUdbRuntimeException - if unable to instantiate the class
specified by typeDescriptorpublic static <T> List<T> decode(Object typeDescriptor, List<ByteBuffer> encodedObjects) throws GPUdbException
T - the type of objects being decodedtypeDescriptor - type descriptor for the type of objects being
decodedencodedObjects - list of Avro binary objectsIllegalArgumentException - if typeDescriptor is not a
Type, a TypeObjectMap, a Schema, or a Class that implements IndexedRecordGPUdbException - if a decoding error occursGPUdbRuntimeException - if unable to instantiate the class
specified by typeDescriptorpublic static <T> List<T> decode(Object typeDescriptor, List<ByteBuffer> encodedObjects, int threadCount, ExecutorService executor) throws GPUdbException
T - the type of objects being decodedtypeDescriptor - type descriptor for the type of objects being
decodedencodedObjects - list of Avro binary objectsthreadCount - number of threads to use for decoding.executor - optional executor responsible for managing
threads; null to create threads on
demandIllegalArgumentException - if threadCount is less than one
or typeDescriptor is not a Type, a TypeObjectMap,
a Schema, or a Class that implements IndexedRecordGPUdbException - if a decoding error occursGPUdbRuntimeException - if unable to instantiate the class
specified by typeDescriptorpublic static <T extends org.apache.avro.generic.IndexedRecord> ByteBuffer encode(T object) throws GPUdbException
T - the type of object being encodedobject - the object to encodeGPUdbException - if an encoding error occurspublic static <T> ByteBuffer encode(TypeObjectMap<T> typeObjectMap, T object) throws GPUdbException
T - the type of object being encodedtypeObjectMap - the type object mapobject - the object to encodeGPUdbException - if an encoding error occurspublic static <T extends org.apache.avro.generic.IndexedRecord> List<ByteBuffer> encode(List<T> objects, int start, int count) throws GPUdbException
T - the type of objects being encodedobjects - list of objects to encodestart - index of first object within objects to
encodecount - number of objects within objects to encodeIndexOutOfBoundsException - if start is less than zero,
count is less than zero, or start plus count
exceeds the length of objectsGPUdbException - if an encoding error occurspublic static <T> List<ByteBuffer> encode(TypeObjectMap<T> typeObjectMap, List<T> objects, int start, int count) throws GPUdbException
T - the type of objects being encodedtypeObjectMap - the type object mapobjects - list of objects to encodestart - index of first object within objects to
encodecount - number of objects within objects to encodeIndexOutOfBoundsException - if start is less than zero,
count is less than zero, or start plus count
exceeds the length of objectsGPUdbException - if an encoding error occurspublic static <T extends org.apache.avro.generic.IndexedRecord> List<ByteBuffer> encode(List<T> objects, int start, int count, int threadCount, ExecutorService executor) throws GPUdbException
T - the type of objects being encodedobjects - list of objects to encodestart - index of first object within objects to
encodecount - number of objects within objects to encodethreadCount - number of threads to use for decoding.executor - optional executor responsible for managing
threads; null to create threads on
demandIndexOutOfBoundsException - if start is less than zero,
count is less than zero, or start plus count
exceeds the length of objectsIllegalArgumentException - if threadCount is less than oneGPUdbException - if an encoding error occurspublic static <T> List<ByteBuffer> encode(TypeObjectMap<T> typeObjectMap, List<T> objects, int start, int count, int threadCount, ExecutorService executor) throws GPUdbException
T - the type of objects being encodedtypeObjectMap - the type object mapobjects - list of objects to encodestart - index of first object within objects to
encodecount - number of objects within objects to encodethreadCount - number of threads to use for decoding.executor - optional executor responsible for managing
threads; null to create threads on
demandIndexOutOfBoundsException - if start is less than zero,
count is less than zero, or start plus count
exceeds the length of objectsIllegalArgumentException - if threadCount is less than oneGPUdbException - if an encoding error occurspublic static <T extends org.apache.avro.generic.IndexedRecord> List<ByteBuffer> encode(List<T> objects) throws GPUdbException
T - the type of objects being encodedobjects - list of objects to encodeGPUdbException - if an encoding error occurspublic static <T> List<ByteBuffer> encode(TypeObjectMap<T> typeObjectMap, List<T> objects) throws GPUdbException
T - the type of objects being encodedtypeObjectMap - the type object mapobjects - list of objects to encodeGPUdbException - if an encoding error occurspublic static <T extends org.apache.avro.generic.IndexedRecord> List<ByteBuffer> encode(List<T> objects, int threadCount, ExecutorService executor) throws GPUdbException
T - the type of objects being encodedobjects - list of objects to encodethreadCount - number of threads to use for decoding.executor - optional executor responsible for managing
threads; null to create threads on
demandIllegalArgumentException - if threadCount is less than oneGPUdbException - if an encoding error occurspublic static <T> List<ByteBuffer> encode(TypeObjectMap<T> typeObjectMap, List<T> objects, int threadCount, ExecutorService executor) throws GPUdbException
T - the type of objects being encodedtypeObjectMap - the type object mapobjects - list of objects to encodethreadCount - number of threads to use for decoding.executor - optional executor responsible for managing
threads; null to create threads on
demandIllegalArgumentException - if threadCount is less than oneGPUdbException - if an encoding error occursCopyright © 2020. All rights reserved.