Class Clause
- java.lang.Object
-
- org.apache.solr.client.solrj.cloud.autoscaling.Clause
-
- All Implemented Interfaces:
Comparable<Clause>
,MapSerializable
,MapWriter
,NavigableObject
- Direct Known Subclasses:
SealedClause
public class Clause extends Object implements MapWriter, Comparable<Clause>
Represents a set of conditions in the policy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Clause.ComputedValueEvaluator
-
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter
-
-
Field Summary
Fields Modifier and Type Field Description static long
addReplicaCountsForNode
static long
addReplicaCountsForNodeCacheMiss
static String
METRICS_PREFIX
static String
PERSHARD_REPLICAS
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr
-
-
-
-
Field Detail
-
addReplicaCountsForNode
public static long addReplicaCountsForNode
-
addReplicaCountsForNodeCacheMiss
public static long addReplicaCountsForNodeCacheMiss
-
PERSHARD_REPLICAS
public static final String PERSHARD_REPLICAS
-
METRICS_PREFIX
public static final String METRICS_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getThirdTag
public Condition getThirdTag()
-
getCollection
public Condition getCollection()
-
getShard
public Condition getShard()
-
getReplica
public Condition getReplica()
-
getTag
public Condition getTag()
-
getGlobalTag
public Condition getGlobalTag()
-
doesOverride
public boolean doesOverride(Clause that)
-
isPerCollectiontag
public boolean isPerCollectiontag()
-
compareTo
public int compareTo(Clause that)
- Specified by:
compareTo
in interfaceComparable<Clause>
-
getSealedClause
public SealedClause getSealedClause(Function<Condition,Object> computedValueEvaluator)
-
test
public List<Violation> test(Policy.Session session, double[] deviations)
-
isMatch
public boolean isMatch(ReplicaInfo r, String collection, String shard)
-
isStrict
public boolean isStrict()
-
writeMap
public void writeMap(MapWriter.EntryWriter ew) throws IOException
- Specified by:
writeMap
in interfaceMapWriter
- Throws:
IOException
-
validate
public static Object validate(String name, Object val, boolean isRuleVal)
- Parameters:
name
- name of the conditionval
- value of the conditionisRuleVal
- is this provided in the rule- Returns:
- actual validated value
-
-