Class CentralizedRule
- java.lang.Object
-
- com.amazonaws.xray.strategy.sampling.rule.CentralizedRule
-
- All Implemented Interfaces:
Rule
,java.lang.Comparable<CentralizedRule>
public class CentralizedRule extends java.lang.Object implements Rule, java.lang.Comparable<CentralizedRule>
Represents a customer-defined sampling rule. A rule contains the matchers required to determine if an incoming request can use the rule, and sampling targets which determine the sampling behavior once a request has been matched. A rule also maintains usage statistics which are periodically reported to X-Ray.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_RULE_NAME
-
Constructor Summary
Constructors Constructor Description CentralizedRule(com.amazonaws.services.xray.model.SamplingRule input, Rand rand)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(CentralizedRule other)
boolean
equals(@Nullable java.lang.Object o)
java.lang.String
getName()
int
hashCode()
boolean
isStale(java.time.Instant now)
static boolean
isValid(com.amazonaws.services.xray.model.SamplingRule rule)
boolean
match(SamplingRequest r)
SamplingResponse
sample(java.time.Instant now)
com.amazonaws.services.xray.model.SamplingStatisticsDocument
snapshot(java.util.Date now)
boolean
update(com.amazonaws.services.xray.model.SamplingRule i)
void
update(com.amazonaws.services.xray.model.SamplingTargetDocument t, java.time.Instant now)
-
-
-
Field Detail
-
DEFAULT_RULE_NAME
public static final java.lang.String DEFAULT_RULE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CentralizedRule
public CentralizedRule(com.amazonaws.services.xray.model.SamplingRule input, Rand rand)
-
-
Method Detail
-
update
public boolean update(com.amazonaws.services.xray.model.SamplingRule i)
-
isStale
public boolean isStale(java.time.Instant now)
-
isValid
public static boolean isValid(com.amazonaws.services.xray.model.SamplingRule rule)
-
update
public void update(com.amazonaws.services.xray.model.SamplingTargetDocument t, java.time.Instant now)
-
snapshot
public com.amazonaws.services.xray.model.SamplingStatisticsDocument snapshot(java.util.Date now)
-
match
public boolean match(SamplingRequest r)
-
sample
public SamplingResponse sample(java.time.Instant now)
-
compareTo
public int compareTo(CentralizedRule other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<CentralizedRule>
-
getName
public java.lang.String getName()
-
equals
public boolean equals(@Nullable java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-