public class Clause extends Object implements MapWriter, Comparable<Clause>
Modifier and Type | Class and Description |
---|---|
static class |
Clause.ComputedValueEvaluator |
MapWriter.EntryWriter
Modifier and Type | Field and Description |
---|---|
static long |
addReplicaCountsForNode |
static long |
addReplicaCountsForNodeCacheMiss |
static String |
METRICS_PREFIX |
static String |
NODESET |
static String |
PERSHARD_REPLICAS |
Modifier | Constructor and Description |
---|---|
protected |
Clause(Clause clause,
Function<Condition,Object> computedValueEvaluator) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Clause that) |
static Clause |
create(Map<String,Object> m) |
static Clause |
create(String json) |
boolean |
doesOverride(Clause that) |
boolean |
equals(Object o) |
Condition |
getCollection() |
Condition |
getGlobalTag() |
Condition |
getReplica() |
SealedClause |
getSealedClause(Function<Condition,Object> computedValueEvaluator) |
Condition |
getShard() |
Condition |
getTag() |
Condition |
getThirdTag() |
int |
hashCode() |
boolean |
isMatch(ReplicaInfo r,
String collection,
String shard) |
boolean |
isPerCollectiontag() |
boolean |
isStrict() |
static Double |
parseDouble(String name,
Object val) |
static Long |
parseLong(String name,
Object val) |
static String |
parseString(Object val) |
List<Violation> |
test(Policy.Session session,
double[] deviations) |
static void |
throwExp(Map clause,
String msg,
Object... args) |
String |
toString() |
static Object |
validate(String name,
Object val,
boolean isRuleVal) |
void |
writeMap(MapWriter.EntryWriter ew) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr
public static final String NODESET
public static long addReplicaCountsForNode
public static long addReplicaCountsForNodeCacheMiss
public static final String PERSHARD_REPLICAS
public static final String METRICS_PREFIX
public Condition getThirdTag()
public Condition getCollection()
public Condition getShard()
public Condition getReplica()
public Condition getTag()
public Condition getGlobalTag()
public boolean doesOverride(Clause that)
public boolean isPerCollectiontag()
public int compareTo(Clause that)
compareTo
in interface Comparable<Clause>
public SealedClause getSealedClause(Function<Condition,Object> computedValueEvaluator)
public List<Violation> test(Policy.Session session, double[] deviations)
public boolean isMatch(ReplicaInfo r, String collection, String shard)
public boolean isStrict()
public void writeMap(MapWriter.EntryWriter ew) throws IOException
writeMap
in interface MapWriter
IOException
public static Object validate(String name, Object val, boolean isRuleVal)
name
- name of the conditionval
- value of the conditionisRuleVal
- is this provided in the ruleCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.