Skip to main content
Package com.gpudb

Interface Record

All Superinterfaces:
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord
All Known Implementing Classes:

public interface Record extends org.apache.avro.generic.IndexedRecord
Interface for objects that contain record data. Includes methods for getting and setting fields by index or name and communicating with the Avro framework.
  • Method Details

    • getType

      Type getType()
      Returns the GPUdb Type of the record.
      Returns:
      the GPUdb type
    • getSchema

      org.apache.avro.Schema getSchema()
      Returns the Avro record schema of the record.
      Specified by:
      getSchema in interface org.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:
      get in interface org.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 null if no field with the specified name exists
    • getBytes

      ByteBuffer getBytes(int index)
      Returns the value of the specified field cast to a ByteBuffer. 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 type
      IndexOutOfBoundsException - if the specified index is not valid
    • getBytes

      ByteBuffer getBytes(String name)
      Returns the value of the specified field cast to a ByteBuffer. 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 a Double. 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 type
      IndexOutOfBoundsException - if the specified index is not valid
    • getDouble

      Double getDouble(String name)
      Returns the value of the specified field cast to a Double. 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 a Float. 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 type
      IndexOutOfBoundsException - if the specified index is not valid
    • getFloat

      Float getFloat(String name)
      Returns the value of the specified field cast to a Float. 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 a Integer. 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 type
      IndexOutOfBoundsException - if the specified index is not valid
    • getInt

      Integer getInt(String name)
      Returns the value of the specified field cast to a Integer. 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 a Long. 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 type
      IndexOutOfBoundsException - if the specified index is not valid
    • getLong

      Long getLong(String name)
      Returns the value of the specified field cast to a Long. 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 a String. 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 type
      IndexOutOfBoundsException - if the specified index is not valid
    • getString

      String getString(String name)
      Returns the value of the specified field cast to a String. 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:
      put in interface org.apache.avro.generic.IndexedRecord
      Parameters:
      index - the index of the field
      value - the new value
      Throws:
      IllegalArgumentException - if the field cannot be set to the specified value
      IndexOutOfBoundsException - 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 field
      value - the new value
      Throws:
      IllegalArgumentException - if no field exists with the specified name or the field cannot be set to the specified value
    • getDataMap

      Map<String,Object> getDataMap()
      Returns a Map of field names to values that is bound to the record (updates made to the map are reflected in the record and vice versa).
      Returns:
      the map