public final class QueryPlus<T> extends Object
Query
+ extra stuff needed in QueryRunner
s.Modifier and Type | Method and Description |
---|---|
Query<T> |
getQuery() |
QueryMetrics<?> |
getQueryMetrics() |
QueryPlus<T> |
optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext) |
Sequence<T> |
run(QuerySegmentWalker walker,
ResponseContext context) |
QueryPlus<T> |
withIdentity(String identity)
Returns the same QueryPlus object with the identity replaced.
|
QueryPlus<T> |
withMaxQueuedBytes(long maxQueuedBytes)
Equivalent of withQuery(getQuery().withOverriddenContext(ImmutableMap.of(MAX_QUEUED_BYTES_KEY, maxQueuedBytes))).
|
QueryPlus<T> |
withoutThreadUnsafeState()
Returns a QueryPlus object without the components which are unsafe for concurrent use from multiple threads,
therefore couldn't be passed down in concurrent or async
QueryRunner s. |
<U> QueryPlus<U> |
withQuery(Query<U> replacementQuery)
Returns a QueryPlus object with
QueryMetrics from this QueryPlus object, and the provided Query . |
QueryPlus<T> |
withQueryMetrics(QueryToolChest<T,? extends Query<T>> queryToolChest)
Returns the same QueryPlus object, if it already has
QueryMetrics (getQueryMetrics() returns not
null), or returns a new QueryPlus object with Query from this QueryPlus and QueryMetrics created using the
given QueryToolChest , via QueryToolChest.makeMetrics(Query) method. |
static <T> QueryPlus<T> |
wrap(Query<T> query)
Returns the minimum bare QueryPlus object with the given query.
|
public static <T> QueryPlus<T> wrap(Query<T> query)
getQueryMetrics()
of the QueryPlus object,
returned from this factory method, returns null
.@Nullable public QueryMetrics<?> getQueryMetrics()
public QueryPlus<T> withIdentity(String identity)
withoutQueryMetrics()
but will not affect any currently-existing queryMetrics.public QueryPlus<T> withQueryMetrics(QueryToolChest<T,? extends Query<T>> queryToolChest)
QueryMetrics
(getQueryMetrics()
returns not
null), or returns a new QueryPlus object with Query
from this QueryPlus and QueryMetrics created using the
given QueryToolChest
, via QueryToolChest.makeMetrics(Query)
method.
By convention, callers of withQueryMetrics()
must also call .getQueryMetrics().emit() on the returned
QueryMetrics object, regardless if this object is the same as the object on which .withQueryMetrics() was initially
called (i. e. it already had non-null QueryMetrics), or if it is a new QueryPlus object. See MetricsEmittingQueryRunner
for example.public QueryPlus<T> withoutThreadUnsafeState()
QueryRunner
s.
Currently the only unsafe component is QueryMetrics
, i. e. withoutThreadUnsafeState()
call is
equivalent to withoutQueryMetrics()
.public QueryPlus<T> withMaxQueuedBytes(long maxQueuedBytes)
public <U> QueryPlus<U> withQuery(Query<U> replacementQuery)
QueryMetrics
from this QueryPlus object, and the provided Query
.public Sequence<T> run(QuerySegmentWalker walker, ResponseContext context)
public QueryPlus<T> optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext)
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.