Class SegmentPartitionMetadataManager

  • All Implemented Interfaces:
    SegmentZkMetadataFetchListener

    public class SegmentPartitionMetadataManager
    extends Object
    implements SegmentZkMetadataFetchListener
    The PartitionDataManager manages partitions of a table. It manages 1. all the online segments associated with the partition and their allocated servers 2. all the replica of a specific segment. It provides API to query 1. For each partition ID, what are the servers that contains ALL segments belong to this partition ID. 2. For each server, what are all the partition IDs and list of segments of those partition IDs on this server.
    • Constructor Detail

      • SegmentPartitionMetadataManager

        public SegmentPartitionMetadataManager​(String tableNameWithType,
                                               String partitionColumn,
                                               String partitionFunctionName,
                                               int numPartitions)
    • Method Detail

      • init

        public void init​(org.apache.helix.model.IdealState idealState,
                         org.apache.helix.model.ExternalView externalView,
                         List<String> onlineSegments,
                         List<org.apache.helix.zookeeper.datamodel.ZNRecord> znRecords)
        Description copied from interface: SegmentZkMetadataFetchListener
        Initializes the segment pruner with the ideal state, external view and online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by the SegmentPreSelector). Should be called only once before calling other methods.
        Specified by:
        init in interface SegmentZkMetadataFetchListener
      • onAssignmentChange

        public void onAssignmentChange​(org.apache.helix.model.IdealState idealState,
                                       org.apache.helix.model.ExternalView externalView,
                                       Set<String> onlineSegments,
                                       List<String> pulledSegments,
                                       List<org.apache.helix.zookeeper.datamodel.ZNRecord> znRecords)
        Description copied from interface: SegmentZkMetadataFetchListener
        Processes the segment assignment (ideal state or external view) change based on the given online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by the SegmentPreSelector).
        Specified by:
        onAssignmentChange in interface SegmentZkMetadataFetchListener