Class RmdUtils


  • public class RmdUtils
    extends java.lang.Object
    Ths class is responsible for deserializing RMDs and extract some information from it. It borrows some methods from RmdSerDe.
    • Constructor Summary

      Constructors 
      Constructor Description
      RmdUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.Long> extractOffsetVectorFromRmd​(org.apache.avro.generic.GenericRecord replicationMetadataRecord)  
      static long extractOffsetVectorSumFromRmd​(org.apache.avro.generic.GenericRecord replicationMetadataRecord)  
      static java.util.List<java.lang.Long> extractTimestampFromRmd​(org.apache.avro.generic.GenericRecord replicationMetadataRecord)  
      static RmdTimestampType getRmdTimestampType​(java.lang.Object tsObject)
      Returns the type of union record given tsObject is.
      static boolean hasOffsetAdvanced​(java.util.List<java.lang.Long> baseOffset, java.util.List<java.lang.Long> advancedOffset)
      Checks to see if an offset vector has advanced completely beyond some base offset vector or not.
      static long sumOffsetVector​(java.lang.Object offsetVector)
      Returns a summation of all component parts to an offsetVector for vector comparison
      • Methods inherited from class java.lang.Object

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

      • RmdUtils

        public RmdUtils()
    • Method Detail

      • getRmdTimestampType

        public static RmdTimestampType getRmdTimestampType​(java.lang.Object tsObject)
        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

        public static java.util.List<java.lang.Long> extractOffsetVectorFromRmd​(org.apache.avro.generic.GenericRecord replicationMetadataRecord)
      • extractTimestampFromRmd

        public static java.util.List<java.lang.Long> extractTimestampFromRmd​(org.apache.avro.generic.GenericRecord replicationMetadataRecord)
      • sumOffsetVector

        public static long sumOffsetVector​(java.lang.Object offsetVector)
        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
                                                java.util.List<java.lang.Long> baseOffset,
                                                @NotNull
                                                java.util.List<java.lang.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