Class VeniceKafkaDecodedRecord

java.lang.Object
org.apache.avro.specific.SpecificRecordBase
com.linkedin.venice.etl.VeniceKafkaDecodedRecord
All Implemented Interfaces:
Externalizable, Serializable, Comparable<org.apache.avro.specific.SpecificRecord>, org.apache.avro.generic.GenericContainer, org.apache.avro.generic.GenericRecord, org.apache.avro.generic.IndexedRecord, org.apache.avro.specific.SpecificRecord

public class VeniceKafkaDecodedRecord extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord
See Also:
  • Field Details

    • SCHEMA$

      public static final org.apache.avro.Schema SCHEMA$
    • key

      public ByteBuffer key
      Raw bytes of the key
    • value

      public ByteBuffer value
      Raw bytes of the value
    • offset

      public long offset
      The offset of this record in Kafka
    • DELETED_TS

      public Long DELETED_TS
      If the current record is a PUT, this field will be null; if it's a DELETE, this field will be the offset of the record in Kafka
    • metadata

      public Map<CharSequence,CharSequence> metadata
      Metadata of the record; currently it contains the schemaId of the record
  • Constructor Details

    • VeniceKafkaDecodedRecord

      public VeniceKafkaDecodedRecord()
      Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should use newBuilder().
    • VeniceKafkaDecodedRecord

      public VeniceKafkaDecodedRecord(ByteBuffer key, ByteBuffer value, Long offset, Long DELETED_TS, Map<CharSequence,CharSequence> metadata)
      All-args constructor.
      Parameters:
      key - Raw bytes of the key
      value - Raw bytes of the value
      offset - The offset of this record in Kafka
      DELETED_TS - If the current record is a PUT, this field will be null; if it's a DELETE, this field will be the offset of the record in Kafka
      metadata - Metadata of the record; currently it contains the schemaId of the record
  • Method Details

    • getClassSchema

      public static org.apache.avro.Schema getClassSchema()
    • getSpecificData

      public org.apache.avro.specific.SpecificData getSpecificData()
      Overrides:
      getSpecificData in class org.apache.avro.specific.SpecificRecordBase
    • getSchema

      public org.apache.avro.Schema getSchema()
      Specified by:
      getSchema in interface org.apache.avro.generic.GenericContainer
      Specified by:
      getSchema in class org.apache.avro.specific.SpecificRecordBase
    • get

      public Object get(int field$)
      Specified by:
      get in interface org.apache.avro.generic.IndexedRecord
      Specified by:
      get in class org.apache.avro.specific.SpecificRecordBase
    • put

      public void put(int field$, Object value$)
      Specified by:
      put in interface org.apache.avro.generic.IndexedRecord
      Specified by:
      put in class org.apache.avro.specific.SpecificRecordBase
    • getKey

      public ByteBuffer getKey()
      Gets the value of the 'key' field.
      Returns:
      Raw bytes of the key
    • setKey

      public void setKey(ByteBuffer value)
      Sets the value of the 'key' field. Raw bytes of the key
      Parameters:
      value - the value to set.
    • getValue

      public ByteBuffer getValue()
      Gets the value of the 'value' field.
      Returns:
      Raw bytes of the value
    • setValue

      public void setValue(ByteBuffer value)
      Sets the value of the 'value' field. Raw bytes of the value
      Parameters:
      value - the value to set.
    • getOffset

      public long getOffset()
      Gets the value of the 'offset' field.
      Returns:
      The offset of this record in Kafka
    • setOffset

      public void setOffset(long value)
      Sets the value of the 'offset' field. The offset of this record in Kafka
      Parameters:
      value - the value to set.
    • getDELETEDTS

      public Long getDELETEDTS()
      Gets the value of the 'DELETED_TS' field.
      Returns:
      If the current record is a PUT, this field will be null; if it's a DELETE, this field will be the offset of the record in Kafka
    • setDELETEDTS

      public void setDELETEDTS(Long value)
      Sets the value of the 'DELETED_TS' field. If the current record is a PUT, this field will be null; if it's a DELETE, this field will be the offset of the record in Kafka
      Parameters:
      value - the value to set.
    • getMetadata

      public Map<CharSequence,CharSequence> getMetadata()
      Gets the value of the 'metadata' field.
      Returns:
      Metadata of the record; currently it contains the schemaId of the record
    • setMetadata

      public void setMetadata(Map<CharSequence,CharSequence> value)
      Sets the value of the 'metadata' field. Metadata of the record; currently it contains the schemaId of the record
      Parameters:
      value - the value to set.
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Overrides:
      writeExternal in class org.apache.avro.specific.SpecificRecordBase
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException
      Specified by:
      readExternal in interface Externalizable
      Overrides:
      readExternal in class org.apache.avro.specific.SpecificRecordBase
      Throws:
      IOException