Class CollectionTimestampMergeRecordHelper

java.lang.Object
com.linkedin.davinci.schema.merge.CollectionTimestampMergeRecordHelper
All Implemented Interfaces:
MergeRecordHelper

public class CollectionTimestampMergeRecordHelper extends Object
This class handles merges with replication metadata with collection metadata timestamp CollectionRmdTimestamp for collection field. If the replication does not have collection metadata timestamp for collection field, exceptions will be thrown. If a record does not have any collection field, this class behavior should be identical to PerFieldTimestampMergeRecordHelper
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    deleteRecord(org.apache.avro.generic.GenericRecord currRecord, org.apache.avro.generic.GenericRecord currTimestampRecord, long deleteTimestamp, int coloID)
    Note that a whole record deletion could result in partial deletion (one or multiple fields get deleted).
    deleteRecordField(org.apache.avro.generic.GenericRecord currentRecord, org.apache.avro.generic.GenericRecord currentTimestampRecord, org.apache.avro.Schema.Field currentRecordField, long deleteTimestamp, int coloID)
     
    putOnField(org.apache.avro.generic.GenericRecord oldRecord, org.apache.avro.generic.GenericRecord oldTimestampRecord, org.apache.avro.Schema.Field oldRecordField, Object newFieldValue, long newPutTimestamp, int putOperationColoID)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CollectionTimestampMergeRecordHelper

      public CollectionTimestampMergeRecordHelper()
  • Method Details

    • putOnField

      public UpdateResultStatus putOnField(org.apache.avro.generic.GenericRecord oldRecord, org.apache.avro.generic.GenericRecord oldTimestampRecord, org.apache.avro.Schema.Field oldRecordField, Object newFieldValue, long newPutTimestamp, int putOperationColoID)
      Specified by:
      putOnField in interface MergeRecordHelper
    • deleteRecordField

      protected UpdateResultStatus deleteRecordField(org.apache.avro.generic.GenericRecord currentRecord, org.apache.avro.generic.GenericRecord currentTimestampRecord, org.apache.avro.Schema.Field currentRecordField, long deleteTimestamp, int coloID)
    • deleteRecord

      public UpdateResultStatus deleteRecord(org.apache.avro.generic.GenericRecord currRecord, org.apache.avro.generic.GenericRecord currTimestampRecord, long deleteTimestamp, int coloID)
      Note that a whole record deletion could result in partial deletion (one or multiple fields get deleted). When a field is deleted, its default value becomes the field value. There could be a situation where several partial deletion resulted from several whole record deletion deletes all fields so that all fields have their default values. This is the current behavior. One optimization is that when all fields are deleted, the whole record could be marked as deleted and return an Optional.empty().
      Specified by:
      deleteRecord in interface MergeRecordHelper