Query

com.netflix.atlas.core.model.Query
See theQuery companion trait
object Query

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Query.type

Members list

Type members

Classlikes

case class And(q1: Query, q2: Query) extends Query

Attributes

Supertypes
trait Serializable
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Equal(k: String, v: String) extends KeyValueQuery

Attributes

Supertypes
trait Serializable
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case object False extends Query

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
False.type
case class GreaterThan(k: String, v: String) extends KeyValueQuery

Attributes

Supertypes
trait Serializable
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class GreaterThanEqual(k: String, v: String) extends KeyValueQuery

Attributes

Supertypes
trait Serializable
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class HasKey(k: String) extends KeyQuery

Attributes

Supertypes
trait Serializable
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class In(k: String, vs: List[String]) extends KeyValueQuery

Attributes

Supertypes
trait Serializable
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait KeyQuery extends Query

Attributes

Supertypes
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class HasKey
class Equal
class GreaterThan
class In
class LessThan
trait PatternQuery
class Regex
Show all
sealed trait KeyValueQuery extends KeyQuery

Attributes

Supertypes
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Equal
class GreaterThan
class In
class LessThan
trait PatternQuery
class Regex
Show all
case class LessThan(k: String, v: String) extends KeyValueQuery

Attributes

Supertypes
trait Serializable
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class LessThanEqual(k: String, v: String) extends KeyValueQuery

Attributes

Supertypes
trait Serializable
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Not(q: Query) extends Query

Attributes

Supertypes
trait Serializable
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Or(q1: Query, q2: Query) extends Query

Attributes

Supertypes
trait Serializable
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait PatternQuery extends KeyValueQuery

Attributes

Supertypes
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Regex
case class Regex(k: String, v: String) extends PatternQuery

Attributes

Supertypes
trait Serializable
trait PatternQuery
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class RegexIgnoreCase(k: String, v: String) extends PatternQuery

Attributes

Supertypes
trait Serializable
trait PatternQuery
trait KeyQuery
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case object True extends Query

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Query
trait Expr
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
True.type

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def allKeys(query: Query): Set[String]

Return the set of keys referenced by in the query.

Return the set of keys referenced by in the query.

Attributes

def cnf(query: Query): Query

Converts the input query into conjunctive normal form.

Converts the input query into conjunctive normal form.

Attributes

def cnfList(query: Query): List[Query]

Converts the input query into a list of sub-queries that should be ANDd together.

Converts the input query into a list of sub-queries that should be ANDd together.

Attributes

def dnf(query: Query): Query

Converts the input query into disjunctive normal form.

Converts the input query into disjunctive normal form.

Attributes

def dnfList(query: Query): List[Query]

Converts the input query into a list of sub-queries that should be ORd together.

Converts the input query into a list of sub-queries that should be ORd together.

Attributes

def exactKeys(query: Query): Set[String]

Return the set of keys explicitly referenced in the query. This can be useful for assisting with automatic legends.

Return the set of keys explicitly referenced in the query. This can be useful for assisting with automatic legends.

Attributes

def expandInClauses(query: Query, limit: Int): List[Query]

Split :in queries into a list of queries using :eq. The query should be normalized ahead of time so it is a string of conjunctions. See dnfList for more information.

Split :in queries into a list of queries using :eq. The query should be normalized ahead of time so it is a string of conjunctions. See dnfList for more information.

In order to avoid a massive combinatorial explosion clauses that have more than limit expressions will not be expanded. The default limit is 5. It is somewhat arbitrary, but seems to work well in practice for the current query data sets at Netflix.

Attributes

def simplify(query: Query, ignore: Boolean): Query

Simplify a query expression that contains True and False constants.

Simplify a query expression that contains True and False constants.

Value parameters

ignore

If true, then the simplification is for the purposes of ignoring certain query terms. This comes up in some automatic rewriting use-cases where we need to have a restriction clause based on a subset of the keys and ignore the rest. Consider the following example:

   nf.app,www,:eq,name,http.requests,:eq,:and,status,200,:eq,:not,:and,:sum

Lets suppose I want to simplify this to a base query for the common tags that could be reused with other metrics. One way would be to rewrite all key query clauses that are not using common tags (prefixed with nf.) to Query.True and simplify. However the not clause causes a problem:

            rewrite - nf.app,www,:eq,:true,:and,:true,:not,:and
   simplification 1 - nf.app,www.:eq,:false,:and
   simplification 2 - :false

The ignore mode will cause :true,:not to map to :true so the term will get ignored rather than reduce the entire expression to :false. Default value is false.

query

Query expression to simplify.

Attributes

Returns

The simplified query expression.

def tags(query: Query): Map[String, String]

Extract a set of tags for the query based on the :eq clauses.

Extract a set of tags for the query based on the :eq clauses.

Attributes