java.lang.Object
com.gpudb.RecordBase
com.gpudb.RecordObject
All Implemented Interfaces:
Abstract base class for objects that contain
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.Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceIndicates that a public field is a GPUdb type column.static @interfaceProvides additional information about a GPUdb type.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionstatic StringcreateType(Class<? extends RecordObject> type, GPUdb gpudb) Creates a type in GPUdb based on the metadata in the specifiedRecordObjectclass and returns the type ID for reference.get(int index) Returns the value of the specified field.static org.apache.avro.SchemagetSchema(Class<? extends RecordObject> type) Gets the Avro record schema corresponding to the metadata in the specifiedRecordObjectclass.getType()Returns the GPUdbTypeof the record.static TypegetType(Class<? extends RecordObject> type) Gets theRecordObject.Typeobject corresponding to the metadata in the specifiedRecordObjectclass.voidSets the value of the specified field.Methods inherited from class com.gpudb.RecordBase
equals, get, getArray, getArray, getBytes, getBytes, getDataMap, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getJson, getJson, getLong, getLong, getSchema, getString, getString, getVector, getVector, hashCode, put, putArray, putArray, putBytes, putBytes, putDateTime, putDateTime, putDateTime, putDateTime, putDecimal, putJson, putJson, putVector, putVector, toString
Method Details
getType
Gets theRecordObject.Typeobject corresponding to the metadata in the specifiedRecordObjectclass.Parameters:type- theRecordObjectclass from which to obtain metadataReturns:the correspondingRecordObject.TypeobjectgetSchema
Gets the Avro record schema corresponding to the metadata in the specifiedRecordObjectclass.Parameters:type- theRecordObjectclass from which to obtain metadataReturns:the corresponding Avro record schemacreateType
public static String createType(Class<? extends RecordObject> type, GPUdb gpudb) throws GPUdbException Creates a type in GPUdb based on the metadata in the specifiedRecordObjectclass 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 aknown typein the specifiedGPUdbinstance.Parameters:type- theRecordObjectclass from which to obtain metadatagpudb- theGPUdbinstance in which to create the typeReturns:the type ID of the type in GPUdbThrows:GPUdbException- if an error occurs while creating the type