Class StoreVersionState

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, java.lang.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 StoreVersionState
    extends org.apache.avro.specific.SpecificRecordBase
    implements org.apache.avro.specific.SpecificRecord
    This record maintains store-version level state, such as the StartOfBufferReplay Control Message, in the case of Hybrid Stores.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int batchConflictResolutionPolicy
      The policy to determine timestamps of batch push records.
      boolean chunked
      Whether the messages inside current store-version are encoded with chunking support.
      java.nio.ByteBuffer compressionDictionary
      The raw bytes of dictionary used to compress/decompress records.
      int compressionStrategy
      What type of compression strategy the current push are used.
      long endOfPushTimestamp
      The messageTimestamp from the producerMetadata of EndOfPush control message.
      static org.apache.avro.Schema SCHEMA$  
      boolean sorted
      Whether the messages inside the current store-version, between the 'StartOfPush' and 'EndOfPush' control messages, are lexicographically sorted by key bytes.
      StartOfBufferReplay startOfBufferReplay
      If a StartOfBufferReplay has been consumed, then it is stored in its entirety here, otherwise, this field is null.
      long startOfPushTimestamp
      The messageTimestamp from the producerMetadata of StartOfPush control message.
      TopicSwitch topicSwitch
      If a TopicSwitch has been consumed, then it is stored in its entirety here, otherwise, this field is null.
    • Constructor Summary

      Constructors 
      Constructor Description
      StoreVersionState()
      Default constructor.
      StoreVersionState​(java.lang.Boolean sorted, StartOfBufferReplay startOfBufferReplay, java.lang.Boolean chunked, java.lang.Integer compressionStrategy, TopicSwitch topicSwitch, java.nio.ByteBuffer compressionDictionary, java.lang.Integer batchConflictResolutionPolicy, java.lang.Long startOfPushTimestamp, java.lang.Long endOfPushTimestamp)
      All-args constructor.
    • Field Detail

      • SCHEMA$

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

        public boolean sorted
        Whether the messages inside the current store-version, between the 'StartOfPush' and 'EndOfPush' control messages, are lexicographically sorted by key bytes. N.B.: This field used to be stored in v2 of the PartitionState schema, but it has now been removed from there.
      • startOfBufferReplay

        public StartOfBufferReplay startOfBufferReplay
        If a StartOfBufferReplay has been consumed, then it is stored in its entirety here, otherwise, this field is null.
      • chunked

        public boolean chunked
        Whether the messages inside current store-version are encoded with chunking support. If true, this means keys will be prefixed with ChunkId, and values may contain a ChunkedValueManifest (if schema is defined as -1).
      • compressionStrategy

        public int compressionStrategy
        What type of compression strategy the current push are used. Using int because Avro Enums are not evolvable. The mapping is the following: 0 => NO_OP, 1 => GZIP
      • topicSwitch

        public TopicSwitch topicSwitch
        If a TopicSwitch has been consumed, then it is stored in its entirety here, otherwise, this field is null.
      • compressionDictionary

        public java.nio.ByteBuffer compressionDictionary
        The raw bytes of dictionary used to compress/decompress records.
      • batchConflictResolutionPolicy

        public int batchConflictResolutionPolicy
        The policy to determine timestamps of batch push records. 0 => no per record replication metadata is stored, hybrid writes always win over batch, 1 => no per record replication metadata is stored, Start-Of-Push Control message's timestamp is treated as the last update replication timestamp for all batch records, and hybrid writes wins only when their own logicalTimestamp are higher, 2 => per record replication metadata is provided by the push job and stored for each key, enabling full conflict resolution granularity on a per field basis, just like when merging concurrent update operations.
      • startOfPushTimestamp

        public long startOfPushTimestamp
        The messageTimestamp from the producerMetadata of StartOfPush control message.
      • endOfPushTimestamp

        public long endOfPushTimestamp
        The messageTimestamp from the producerMetadata of EndOfPush control message.
    • Constructor Detail

      • StoreVersionState

        public StoreVersionState()
        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().
      • StoreVersionState

        public StoreVersionState​(java.lang.Boolean sorted,
                                 StartOfBufferReplay startOfBufferReplay,
                                 java.lang.Boolean chunked,
                                 java.lang.Integer compressionStrategy,
                                 TopicSwitch topicSwitch,
                                 java.nio.ByteBuffer compressionDictionary,
                                 java.lang.Integer batchConflictResolutionPolicy,
                                 java.lang.Long startOfPushTimestamp,
                                 java.lang.Long endOfPushTimestamp)
        All-args constructor.
        Parameters:
        sorted - Whether the messages inside the current store-version, between the 'StartOfPush' and 'EndOfPush' control messages, are lexicographically sorted by key bytes. N.B.: This field used to be stored in v2 of the PartitionState schema, but it has now been removed from there.
        startOfBufferReplay - If a StartOfBufferReplay has been consumed, then it is stored in its entirety here, otherwise, this field is null.
        chunked - Whether the messages inside current store-version are encoded with chunking support. If true, this means keys will be prefixed with ChunkId, and values may contain a ChunkedValueManifest (if schema is defined as -1).
        compressionStrategy - What type of compression strategy the current push are used. Using int because Avro Enums are not evolvable. The mapping is the following: 0 => NO_OP, 1 => GZIP
        topicSwitch - If a TopicSwitch has been consumed, then it is stored in its entirety here, otherwise, this field is null.
        compressionDictionary - The raw bytes of dictionary used to compress/decompress records.
        batchConflictResolutionPolicy - The policy to determine timestamps of batch push records. 0 => no per record replication metadata is stored, hybrid writes always win over batch, 1 => no per record replication metadata is stored, Start-Of-Push Control message's timestamp is treated as the last update replication timestamp for all batch records, and hybrid writes wins only when their own logicalTimestamp are higher, 2 => per record replication metadata is provided by the push job and stored for each key, enabling full conflict resolution granularity on a per field basis, just like when merging concurrent update operations.
        startOfPushTimestamp - The messageTimestamp from the producerMetadata of StartOfPush control message.
        endOfPushTimestamp - The messageTimestamp from the producerMetadata of EndOfPush control message.
    • Method Detail

      • 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 java.lang.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$,
                        java.lang.Object value$)
        Specified by:
        put in interface org.apache.avro.generic.IndexedRecord
        Specified by:
        put in class org.apache.avro.specific.SpecificRecordBase
      • getSorted

        public boolean getSorted()
        Gets the value of the 'sorted' field.
        Returns:
        Whether the messages inside the current store-version, between the 'StartOfPush' and 'EndOfPush' control messages, are lexicographically sorted by key bytes. N.B.: This field used to be stored in v2 of the PartitionState schema, but it has now been removed from there.
      • setSorted

        public void setSorted​(boolean value)
        Sets the value of the 'sorted' field. Whether the messages inside the current store-version, between the 'StartOfPush' and 'EndOfPush' control messages, are lexicographically sorted by key bytes. N.B.: This field used to be stored in v2 of the PartitionState schema, but it has now been removed from there.
        Parameters:
        value - the value to set.
      • getStartOfBufferReplay

        public StartOfBufferReplay getStartOfBufferReplay()
        Gets the value of the 'startOfBufferReplay' field.
        Returns:
        If a StartOfBufferReplay has been consumed, then it is stored in its entirety here, otherwise, this field is null.
      • setStartOfBufferReplay

        public void setStartOfBufferReplay​(StartOfBufferReplay value)
        Sets the value of the 'startOfBufferReplay' field. If a StartOfBufferReplay has been consumed, then it is stored in its entirety here, otherwise, this field is null.
        Parameters:
        value - the value to set.
      • getChunked

        public boolean getChunked()
        Gets the value of the 'chunked' field.
        Returns:
        Whether the messages inside current store-version are encoded with chunking support. If true, this means keys will be prefixed with ChunkId, and values may contain a ChunkedValueManifest (if schema is defined as -1).
      • setChunked

        public void setChunked​(boolean value)
        Sets the value of the 'chunked' field. Whether the messages inside current store-version are encoded with chunking support. If true, this means keys will be prefixed with ChunkId, and values may contain a ChunkedValueManifest (if schema is defined as -1).
        Parameters:
        value - the value to set.
      • getCompressionStrategy

        public int getCompressionStrategy()
        Gets the value of the 'compressionStrategy' field.
        Returns:
        What type of compression strategy the current push are used. Using int because Avro Enums are not evolvable. The mapping is the following: 0 => NO_OP, 1 => GZIP
      • setCompressionStrategy

        public void setCompressionStrategy​(int value)
        Sets the value of the 'compressionStrategy' field. What type of compression strategy the current push are used. Using int because Avro Enums are not evolvable. The mapping is the following: 0 => NO_OP, 1 => GZIP
        Parameters:
        value - the value to set.
      • getTopicSwitch

        public TopicSwitch getTopicSwitch()
        Gets the value of the 'topicSwitch' field.
        Returns:
        If a TopicSwitch has been consumed, then it is stored in its entirety here, otherwise, this field is null.
      • setTopicSwitch

        public void setTopicSwitch​(TopicSwitch value)
        Sets the value of the 'topicSwitch' field. If a TopicSwitch has been consumed, then it is stored in its entirety here, otherwise, this field is null.
        Parameters:
        value - the value to set.
      • getCompressionDictionary

        public java.nio.ByteBuffer getCompressionDictionary()
        Gets the value of the 'compressionDictionary' field.
        Returns:
        The raw bytes of dictionary used to compress/decompress records.
      • setCompressionDictionary

        public void setCompressionDictionary​(java.nio.ByteBuffer value)
        Sets the value of the 'compressionDictionary' field. The raw bytes of dictionary used to compress/decompress records.
        Parameters:
        value - the value to set.
      • getBatchConflictResolutionPolicy

        public int getBatchConflictResolutionPolicy()
        Gets the value of the 'batchConflictResolutionPolicy' field.
        Returns:
        The policy to determine timestamps of batch push records. 0 => no per record replication metadata is stored, hybrid writes always win over batch, 1 => no per record replication metadata is stored, Start-Of-Push Control message's timestamp is treated as the last update replication timestamp for all batch records, and hybrid writes wins only when their own logicalTimestamp are higher, 2 => per record replication metadata is provided by the push job and stored for each key, enabling full conflict resolution granularity on a per field basis, just like when merging concurrent update operations.
      • setBatchConflictResolutionPolicy

        public void setBatchConflictResolutionPolicy​(int value)
        Sets the value of the 'batchConflictResolutionPolicy' field. The policy to determine timestamps of batch push records. 0 => no per record replication metadata is stored, hybrid writes always win over batch, 1 => no per record replication metadata is stored, Start-Of-Push Control message's timestamp is treated as the last update replication timestamp for all batch records, and hybrid writes wins only when their own logicalTimestamp are higher, 2 => per record replication metadata is provided by the push job and stored for each key, enabling full conflict resolution granularity on a per field basis, just like when merging concurrent update operations.
        Parameters:
        value - the value to set.
      • getStartOfPushTimestamp

        public long getStartOfPushTimestamp()
        Gets the value of the 'startOfPushTimestamp' field.
        Returns:
        The messageTimestamp from the producerMetadata of StartOfPush control message.
      • setStartOfPushTimestamp

        public void setStartOfPushTimestamp​(long value)
        Sets the value of the 'startOfPushTimestamp' field. The messageTimestamp from the producerMetadata of StartOfPush control message.
        Parameters:
        value - the value to set.
      • getEndOfPushTimestamp

        public long getEndOfPushTimestamp()
        Gets the value of the 'endOfPushTimestamp' field.
        Returns:
        The messageTimestamp from the producerMetadata of EndOfPush control message.
      • setEndOfPushTimestamp

        public void setEndOfPushTimestamp​(long value)
        Sets the value of the 'endOfPushTimestamp' field. The messageTimestamp from the producerMetadata of EndOfPush control message.
        Parameters:
        value - the value to set.
      • writeExternal

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

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