public static enum ResponseContext.Key extends Enum<ResponseContext.Key> implements ResponseContext.BaseKey
If it's necessary to have some new keys in the context then they might be listed in a separate enum:
public enum ExtensionResponseContextKey implements BaseKey { EXTENSION_KEY_1("extension_key_1"), EXTENSION_KEY_2("extension_key_2"); static { for (BaseKey key : values()) ResponseContext.Key.registerKey(key); } private final String name; private final BiFunction
Enum Constant and Description |
---|
CPU_CONSUMED_NANOS
The total CPU time for threads related to Sequence processing of the query.
|
ETAG
Entity tag.
|
MISSING_SEGMENTS
Lists missing segments.
|
NUM_SCANNED_ROWS
The number of scanned rows.
|
QUERY_FAIL_DEADLINE_MILLIS
Query fail time (current time + timeout).
|
QUERY_TOTAL_BYTES_GATHERED
Query total bytes gathered.
|
REMAINING_RESPONSES_FROM_QUERY_SERVERS
Map of most relevant query ID to remaining number of responses from query nodes.
|
TIMEOUT_AT
This variable indicates when a running query should be expired,
and is effective only when 'timeout' of queryContext has a positive value.
|
TRUNCATED
Indicates if a
ResponseContext was truncated during serialization. |
UNCOVERED_INTERVALS
Lists intervals for which NO segment is present.
|
UNCOVERED_INTERVALS_OVERFLOWED
Indicates if the number of uncovered intervals exceeded the limit (true/false).
|
Modifier and Type | Method and Description |
---|---|
static Collection<ResponseContext.BaseKey> |
getAllRegisteredKeys()
Returns all keys registered via
registerKey(org.apache.druid.query.context.ResponseContext.BaseKey) . |
BiFunction<Object,Object,Object> |
getMergeFunction()
Merge function associated with a key: Object (Object oldValue, Object newValue)
|
String |
getName() |
static ResponseContext.BaseKey |
keyOf(String name)
Returns a registered key associated with the name .
|
static void |
registerKey(ResponseContext.BaseKey key)
Primary way of registering context keys.
|
static ResponseContext.Key |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ResponseContext.Key[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ResponseContext.Key UNCOVERED_INTERVALS
public static final ResponseContext.Key UNCOVERED_INTERVALS_OVERFLOWED
public static final ResponseContext.Key REMAINING_RESPONSES_FROM_QUERY_SERVERS
CachingClusteredClient
when it initializes the connection to the query nodes,
and is updated whenever they respond (@code DirectDruidClient). RetryQueryRunner
uses this value to
check if the MISSING_SEGMENTS
is valid.
Currently, the broker doesn't run subqueries in parallel, the remaining number of responses will be updated
one by one per subquery. However, since it can be parallelized to run subqueries simultaneously, we store them
in a ConcurrentHashMap.Query.getMostSpecificId()
public static final ResponseContext.Key MISSING_SEGMENTS
public static final ResponseContext.Key ETAG
public static final ResponseContext.Key QUERY_FAIL_DEADLINE_MILLIS
TIMEOUT_AT
.public static final ResponseContext.Key QUERY_TOTAL_BYTES_GATHERED
public static final ResponseContext.Key TIMEOUT_AT
ScanQueryEngine
by reducing its value on the time of every scan iteration.public static final ResponseContext.Key NUM_SCANNED_ROWS
public static final ResponseContext.Key CPU_CONSUMED_NANOS
CPUTimeMetricQueryRunner
public static final ResponseContext.Key TRUNCATED
ResponseContext
was truncated during serialization.public static ResponseContext.Key[] values()
for (ResponseContext.Key c : ResponseContext.Key.values()) System.out.println(c);
public static ResponseContext.Key valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static void registerKey(ResponseContext.BaseKey key)
IllegalArgumentException
- if the key has already been registered.public static ResponseContext.BaseKey keyOf(String name)
IllegalStateException
- if a corresponding key has not been registered.public static Collection<ResponseContext.BaseKey> getAllRegisteredKeys()
registerKey(org.apache.druid.query.context.ResponseContext.BaseKey)
.public String getName()
getName
in interface ResponseContext.BaseKey
public BiFunction<Object,Object,Object> getMergeFunction()
ResponseContext.BaseKey
getMergeFunction
in interface ResponseContext.BaseKey
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.