Class SegmentLineageAccessHelper


  • public class SegmentLineageAccessHelper
    extends Object
    Class to help to read, write segment lineage metadata
    • Method Detail

      • getSegmentLineageZNRecord

        public static org.apache.helix.ZNRecord getSegmentLineageZNRecord​(org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.ZNRecord> propertyStore,
                                                                          String tableNameWithType)
        Read the segment lineage ZNRecord from the property store
        Parameters:
        propertyStore - a property store
        tableNameWithType - a table name with type
        Returns:
        a ZNRecord of segment merge lineage, return null if znode does not exist
      • getSegmentLineage

        public static SegmentLineage getSegmentLineage​(org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.ZNRecord> propertyStore,
                                                       String tableNameWithType)
        Read the segment lineage from the property store
        Parameters:
        propertyStore - a property store
        tableNameWithType - a table name with type
        Returns:
        a segment lineage, return null if znode does not exist
      • writeSegmentLineage

        public static boolean writeSegmentLineage​(org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.ZNRecord> propertyStore,
                                                  SegmentLineage segmentLineage,
                                                  int expectedVersion)
        Write the segment lineage to the property store
        Parameters:
        propertyStore - a property store
        segmentLineage - a segment lineage
        expectedVersion - expected version of ZNRecord. -1 for indicating to match any version.
        Returns:
        true if update is successful. false otherwise.
      • deleteSegmentLineage

        public static boolean deleteSegmentLineage​(org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.ZNRecord> propertyStore,
                                                   String tableNameWithType)
        Delete the segment lineage from the property store
        Parameters:
        propertyStore - a property store
        tableNameWithType - a table name with type
        Returns:
        true if delete is successful. false otherwise.