public abstract class RecordObject extends RecordBase
Record
data with a
schema defined at compile time. Derived classes should correspond to a GPUdb
type and contain public fields, annotated with RecordObject.Column
,
that correspond to columns in that type. The RecordObject.Type
annotation may also be applied to derived classes to provide additional
information about the type.Modifier and Type | Class and Description |
---|---|
static interface |
RecordObject.Column
Indicates that a public field is a GPUdb type column.
|
static interface |
RecordObject.Type
Provides additional information about a GPUdb type.
|
Modifier | Constructor and Description |
---|---|
protected |
RecordObject()
Creates a new record object instance.
|
Modifier and Type | Method and Description |
---|---|
static String |
createType(Class<? extends RecordObject> type,
GPUdb gpudb)
Creates a type in GPUdb based on the metadata in the specified
RecordObject class and returns the type ID for reference. |
Object |
get(int index)
Returns the value of the specified field.
|
static org.apache.avro.Schema |
getSchema(Class<? extends RecordObject> type)
Gets the Avro record schema corresponding to the metadata in the
specified
RecordObject class. |
Type |
getType()
Returns the GPUdb
Type of the record. |
static Type |
getType(Class<? extends RecordObject> type)
Gets the
Type object corresponding to the metadata in the
specified RecordObject class. |
void |
put(int index,
Object value)
Sets the value of the specified field.
|
public static Type getType(Class<? extends RecordObject> type)
Type
object corresponding to the metadata in the
specified RecordObject
class.type
- the RecordObject
class from which to obtain metadataType
objectpublic static org.apache.avro.Schema getSchema(Class<? extends RecordObject> type)
RecordObject
class.type
- the RecordObject
class from which to obtain metadatapublic static String createType(Class<? extends RecordObject> type, GPUdb gpudb) throws GPUdbException
RecordObject
class and returns the type ID for reference. If an
identical type already exists in GPUdb, the type ID of the existing type
will be returned and no new type will be created. The specified class
will also automatically be added as a known type
in the specified GPUdb
instance.type
- the RecordObject
class from which to obtain
metadatagpudb
- the GPUdb
instance in which to create the typeGPUdbException
- if an error occurs while creating the typepublic Type getType()
Record
Type
of the record.public Object get(int index)
Record
index
- the index of the fieldCopyright © 2020. All rights reserved.