Class LabelMatcher
java.lang.Object
org.elasticsearch.xpack.esql.plan.logical.promql.selector.LabelMatcher
- All Implemented Interfaces:
NodeStringRenderable
PromQL label matcher between a label name, a value pattern and match type (=, !=, =~, !~).
Examples:
{job="api"} -> [LabelMatcher("job", "api", EQ)]
{status=~"5.."} -> [LabelMatcher("status", "5..", REG)]
{env!~"test|dev"} -> [LabelMatcher("env", "test|dev", NREG)]
{host=?_hosts} -> [LabelMatcher("host", ["34.107.161.234", "140.248.133.94"], EQ)]
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLabelMatcher(String name, String value, LabelMatcher.Matcher matcher) LabelMatcher(String name, List<String> values, LabelMatcher.Matcher matcher) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.util.automaton.AutomatonbooleanReturns the single value for this matcher.inthashCode()booleanReturns true if this matcher has multiple values.booleanmatcher()booleanbooleanbooleanname()voidnodeString(StringBuilder sb, Node.NodeStringFormat format, NodeStringMapper mapper) Routes the label name and every match value through the mapper (the match operator is structural and stays).toString()values()Returns all values for this matcher.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
LabelMatcher
-
LabelMatcher
-
-
Method Details
-
name
-
getFirstValue
Returns the single value for this matcher. For multi-value matchers, returns the first value. Usevalues()to get all values. -
values
Returns all values for this matcher. For single-value matchers, returns a singleton list. -
isMultiValue
public boolean isMultiValue()Returns true if this matcher has multiple values. -
matcher
-
automaton
public org.apache.lucene.util.automaton.Automaton automaton() -
matchesAll
public boolean matchesAll() -
matchesNone
public boolean matchesNone() -
matchesEmpty
public boolean matchesEmpty() -
isNegation
public boolean isNegation() -
equals
-
hashCode
public int hashCode() -
toString
-
nodeString
Routes the label name and every match value through the mapper (the match operator is structural and stays). ReproducestoString()'sname op [v1, v2]shape so that underNodeStringMapper.IDENTITYthis equalstoString(); under an anonymizing mapper the label name and the (potentially sensitive) values tokenize.- Specified by:
nodeStringin interfaceNodeStringRenderable
-