Class SimUtils


  • public class SimUtils
    extends Object
    Various utility methods useful for autoscaling simulations and snapshots.
    • Field Detail

      • COMMON_REPLICA_TAGS

        public static final Set<String> COMMON_REPLICA_TAGS
      • COMMON_NODE_TAGS

        public static final Set<String> COMMON_NODE_TAGS
    • Constructor Detail

      • SimUtils

        public SimUtils()
    • Method Detail

      • checkConsistency

        public static void checkConsistency​(SolrCloudManager solrCloudManager,
                                            AutoScalingConfig config)
                                     throws Exception
        Check consistency of data in a SolrCloudManager. This may be needed when constructing a simulated instance from potentially inconsistent data (eg. partial snapshots taken at different points in time).
        Parameters:
        solrCloudManager - source manager
        config - optional AutoScalingConfig instance used to determine what node and replica metrics to check.
        Throws:
        Exception
      • calculateStats

        public static Map<String,​Object> calculateStats​(SolrCloudManager cloudManager,
                                                              AutoScalingConfig config,
                                                              boolean verbose)
                                                       throws Exception
        Calculate statistics of node / collection and replica layouts for the provided SolrCloudManager.
        Parameters:
        cloudManager - manager
        config - autoscaling config, or null if the one from the provided manager should be used
        verbose - if true then add more details about replicas.
        Returns:
        a map containing detailed statistics
        Throws:
        Exception
      • getRedactionContext

        public static RedactionUtils.RedactionContext getRedactionContext​(ClusterState clusterState)
        Prepare collection and node / host names for redaction.
        Parameters:
        clusterState - cluster state