Package com.gpudb
Interface Record
-
- All Superinterfaces:
org.apache.avro.generic.GenericContainer,org.apache.avro.generic.IndexedRecord
- All Known Implementing Classes:
GenericRecord,RecordBase,RecordObject
public interface Record extends org.apache.avro.generic.IndexedRecordInterface for objects that contain record data. Includes methods for getting and setting fields by index or name and communicating with the Avro framework.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectget(int index)Returns the value of the specified field.Objectget(String name)Returns the value of the specified field.ByteBuffergetBytes(int index)Returns the value of the specified field cast to aByteBuffer.ByteBuffergetBytes(String name)Returns the value of the specified field cast to aByteBuffer.Map<String,Object>getDataMap()Returns aMapof field names to values that is bound to the record (updates made to the map are reflected in the record and vice versa).DoublegetDouble(int index)Returns the value of the specified field cast to aDouble.DoublegetDouble(String name)Returns the value of the specified field cast to aDouble.FloatgetFloat(int index)Returns the value of the specified field cast to aFloat.FloatgetFloat(String name)Returns the value of the specified field cast to aFloat.IntegergetInt(int index)Returns the value of the specified field cast to aInteger.IntegergetInt(String name)Returns the value of the specified field cast to aInteger.LonggetLong(int index)Returns the value of the specified field cast to aLong.LonggetLong(String name)Returns the value of the specified field cast to aLong.org.apache.avro.SchemagetSchema()Returns the Avro record schema of the record.StringgetString(int index)Returns the value of the specified field cast to aString.StringgetString(String name)Returns the value of the specified field cast to aString.TypegetType()Returns the GPUdbTypeof the record.voidput(int index, Object value)Sets the value of the specified field.voidput(String name, Object value)Sets the value of the specified field.
-
-
-
Method Detail
-
getSchema
org.apache.avro.Schema getSchema()
Returns the Avro record schema of the record.- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Returns:
- the Avro record schema of the record
-
get
Object get(int index)
Returns the value of the specified field.- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the index of the field- Returns:
- the value of the field
- Throws:
IndexOutOfBoundsException- if the specified index is not valid
-
get
Object get(String name)
Returns the value of the specified field.- Parameters:
name- the name of the field- Returns:
- the value of the field, or
nullif no field with the specified name exists
-
getBytes
ByteBuffer getBytes(int index)
Returns the value of the specified field cast to aByteBuffer. If the field is not of the correct type an exception will be thrown.- Parameters:
index- the index of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct typeIndexOutOfBoundsException- if the specified index is not valid
-
getBytes
ByteBuffer getBytes(String name)
Returns the value of the specified field cast to aByteBuffer. If the field is not of the correct type an exception will be thrown.- Parameters:
name- the name of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct type
-
getDouble
Double getDouble(int index)
Returns the value of the specified field cast to aDouble. If the field is not of the correct type an exception will be thrown.- Parameters:
index- the index of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct typeIndexOutOfBoundsException- if the specified index is not valid
-
getDouble
Double getDouble(String name)
Returns the value of the specified field cast to aDouble. If the field is not of the correct type an exception will be thrown.- Parameters:
name- the name of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct type
-
getFloat
Float getFloat(int index)
Returns the value of the specified field cast to aFloat. If the field is not of the correct type an exception will be thrown.- Parameters:
index- the index of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct typeIndexOutOfBoundsException- if the specified index is not valid
-
getFloat
Float getFloat(String name)
Returns the value of the specified field cast to aFloat. If the field is not of the correct type an exception will be thrown.- Parameters:
name- the name of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct type
-
getInt
Integer getInt(int index)
Returns the value of the specified field cast to aInteger. If the field is not of the correct type an exception will be thrown.- Parameters:
index- the index of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct typeIndexOutOfBoundsException- if the specified index is not valid
-
getInt
Integer getInt(String name)
Returns the value of the specified field cast to aInteger. If the field is not of the correct type an exception will be thrown.- Parameters:
name- the name of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct type
-
getLong
Long getLong(int index)
Returns the value of the specified field cast to aLong. If the field is not of the correct type an exception will be thrown.- Parameters:
index- the index of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct typeIndexOutOfBoundsException- if the specified index is not valid
-
getLong
Long getLong(String name)
Returns the value of the specified field cast to aLong. If the field is not of the correct type an exception will be thrown.- Parameters:
name- the name of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct type
-
getString
String getString(int index)
Returns the value of the specified field cast to aString. If the field is not of the correct type an exception will be thrown.- Parameters:
index- the index of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct typeIndexOutOfBoundsException- if the specified index is not valid
-
getString
String getString(String name)
Returns the value of the specified field cast to aString. If the field is not of the correct type an exception will be thrown.- Parameters:
name- the name of the field- Returns:
- the value of the field
- Throws:
ClassCastException- if the field is not of the correct type
-
put
void put(int index, Object value)Sets the value of the specified field.- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Parameters:
index- the index of the fieldvalue- the new value- Throws:
IllegalArgumentException- if the field cannot be set to the specified valueIndexOutOfBoundsException- if the specified index is not valid
-
put
void put(String name, Object value)
Sets the value of the specified field.- Parameters:
name- the name of the fieldvalue- the new value- Throws:
IllegalArgumentException- if no field exists with the specified name or the field cannot be set to the specified value
-
-