Class CollectionTimestampMergeRecordHelper
- java.lang.Object
-
- com.linkedin.davinci.schema.merge.CollectionTimestampMergeRecordHelper
-
- All Implemented Interfaces:
MergeRecordHelper
public class CollectionTimestampMergeRecordHelper extends java.lang.Object
This class handles merges with replication metadata with collection metadata timestampCollectionRmdTimestamp
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 toPerFieldTimestampMergeRecordHelper
-
-
Constructor Summary
Constructors Constructor Description CollectionTimestampMergeRecordHelper()
-
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)
-
-
-
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 interfaceMergeRecordHelper
-
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 interfaceMergeRecordHelper
-
-