Class TableStateUtils


  • public class TableStateUtils
    extends Object
    • Method Detail

      • getSegmentsInGivenStateForThisInstance

        public static List<String> getSegmentsInGivenStateForThisInstance​(org.apache.helix.HelixManager helixManager,
                                                                          String tableNameWithType,
                                                                          String state)
        Returns all segments in a given state for a given table.
        Parameters:
        helixManager - instance of Helix manager
        tableNameWithType - table for which we are obtaining segments in a given state
        state - state of the segments to be returned
        Returns:
        List of segment names in a given state.
      • isAllSegmentsLoaded

        public static boolean isAllSegmentsLoaded​(org.apache.helix.HelixManager helixManager,
                                                  String tableNameWithType)
        Checks if all segments for the given @param tableNameWithType were succesfully loaded This function will get all segments in IDEALSTATE and CURRENTSTATE for the given table, and then check if all ONLINE segments in IDEALSTATE match with CURRENTSTATE.
        Parameters:
        helixManager - helix manager for the server instance
        tableNameWithType - table name for which segment state is to be checked
        Returns:
        true if all segments for the given table are succesfully loaded. False otherwise