Class SimUtils
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.sim.SimUtils
-
public class SimUtils extends Object
Various utility methods useful for autoscaling simulations and snapshots.
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>
COMMON_NODE_TAGS
static Set<String>
COMMON_REPLICA_TAGS
-
Constructor Summary
Constructors Constructor Description SimUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>
calculateStats(SolrCloudManager cloudManager, AutoScalingConfig config, boolean verbose)
Calculate statistics of node / collection and replica layouts for the providedSolrCloudManager
.static void
checkConsistency(SolrCloudManager solrCloudManager, AutoScalingConfig config)
Check consistency of data in aSolrCloudManager
.static RedactionUtils.RedactionContext
getRedactionContext(ClusterState clusterState)
Prepare collection and node / host names for redaction.static ModifiableSolrParams
v2AdminRequestToV1Params(V2Request req)
Convert a V2CollectionAdminRequest
to regularSolrParams
-
-
-
Method Detail
-
checkConsistency
public static void checkConsistency(SolrCloudManager solrCloudManager, AutoScalingConfig config) throws Exception
Check consistency of data in aSolrCloudManager
. 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 managerconfig
- optionalAutoScalingConfig
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 providedSolrCloudManager
.- Parameters:
cloudManager
- managerconfig
- autoscaling config, or null if the one from the provided manager should be usedverbose
- if true then add more details about replicas.- Returns:
- a map containing detailed statistics
- Throws:
Exception
-
v2AdminRequestToV1Params
public static ModifiableSolrParams v2AdminRequestToV1Params(V2Request req)
Convert a V2CollectionAdminRequest
to regularSolrParams
- Parameters:
req
- request- Returns:
- request payload and parameters converted to V1 params
-
getRedactionContext
public static RedactionUtils.RedactionContext getRedactionContext(ClusterState clusterState)
Prepare collection and node / host names for redaction.- Parameters:
clusterState
- cluster state
-
-