Package com.linkedin.venice.schema.rmd
Class RmdUtils
java.lang.Object
com.linkedin.venice.schema.rmd.RmdUtils
Ths class is responsible for deserializing RMDs and extract some information from it.
It borrows some methods from
RmdSerDe.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractOffsetVectorFromRmd(org.apache.avro.generic.GenericRecord replicationMetadataRecord) static longextractOffsetVectorSumFromRmd(org.apache.avro.generic.GenericRecord replicationMetadataRecord) extractTimestampFromRmd(org.apache.avro.generic.GenericRecord replicationMetadataRecord) static longgetLastUpdateTimestamp(Object object) static RmdTimestampTypegetRmdTimestampType(Object tsObject) Returns the type of union record given tsObject is.static booleanhasOffsetAdvanced(List<Long> baseOffset, List<Long> advancedOffset) Checks to see if an offset vector has advanced completely beyond some base offset vector or not.mergeOffsetVectors(List<Long> baseOffset, List<Long> advancedOffset) static longsumOffsetVector(Object offsetVector) Returns a summation of all component parts to an offsetVector for vector comparison
-
Constructor Details
-
RmdUtils
public RmdUtils()
-
-
Method Details
-
getRmdTimestampType
Returns the type of union record given tsObject is. Right now it will be either root level long or generic record of per field timestamp.- Parameters:
tsObject-
-
extractOffsetVectorSumFromRmd
public static long extractOffsetVectorSumFromRmd(org.apache.avro.generic.GenericRecord replicationMetadataRecord) -
extractOffsetVectorFromRmd
-
extractTimestampFromRmd
-
sumOffsetVector
Returns a summation of all component parts to an offsetVector for vector comparison- Parameters:
offsetVector- offsetVector to be summed- Returns:
- the sum of all offset vectors
-
hasOffsetAdvanced
public static boolean hasOffsetAdvanced(@NotNull List<Long> baseOffset, @NotNull List<Long> advancedOffset) Checks to see if an offset vector has advanced completely beyond some base offset vector or not.- Parameters:
baseOffset- The vector to compare against.advancedOffset- The vector has should be advanced along.- Returns:
- True if the advancedOffset vector has grown beyond the baseOffset
-
mergeOffsetVectors
-
getLastUpdateTimestamp
-