Class CollectionTimestampMergeRecordHelper

  • All Implemented Interfaces:
    MergeRecordHelper

    public class CollectionTimestampMergeRecordHelper
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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).
      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)  
      UpdateResultStatus putOnField​(org.apache.avro.generic.GenericRecord oldRecord, org.apache.avro.generic.GenericRecord oldTimestampRecord, org.apache.avro.Schema.Field oldRecordField, java.lang.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 Detail

      • CollectionTimestampMergeRecordHelper

        public CollectionTimestampMergeRecordHelper()
    • Method Detail

      • putOnField

        public UpdateResultStatus putOnField​(org.apache.avro.generic.GenericRecord oldRecord,
                                             org.apache.avro.generic.GenericRecord oldTimestampRecord,
                                             org.apache.avro.Schema.Field oldRecordField,
                                             java.lang.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