leventov commented on a change in pull request #8157: Enum of ResponseContext
keys
URL: https://github.com/apache/incubator-druid/pull/8157#discussion_r308778987
##########
File path:
processing/src/main/java/org/apache/druid/query/context/ResponseContext.java
##########
@@ -84,36 +125,81 @@
ETAG("ETag"),
/**
* Query fail time (current time + timeout).
+ * The final value in comparison to continuously updated TIMEOUT_AT.
*/
- QUERY_FAIL_TIME("queryFailTime"),
+ QUERY_FAIL_DEADLINE_MILLIS("queryFailTime"),
/**
* Query total bytes gathered.
*/
QUERY_TOTAL_BYTES_GATHERED("queryTotalBytesGathered"),
/**
* This variable indicates when a running query should be expired,
* and is effective only when 'timeout' of queryContext has a positive
value.
+ * Continuously updated by {@link
org.apache.druid.query.scan.ScanQueryEngine}
+ * by reducing its value on the time of every scan iteration.
*/
TIMEOUT_AT("timeoutAt"),
/**
* The number of scanned rows.
+ * For backward compatibility the context key name still equals to "count".
*/
- COUNT(
+ NUM_SCANNED_ROWS(
"count",
(oldValue, newValue) -> (long) oldValue + (long) newValue
),
/**
- * CPU consumed while processing a request.
+ * The total CPU time for threads related to Sequence processing of the
query.
+ * Resulting value on a Broker is a sum of downstream values from
historicals / realtime nodes.
+ * For additional information see {@link
org.apache.druid.query.CPUTimeMetricQueryRunner}
*/
- CPU_CONSUMED(
+ CPU_CONSUMED_NANOS(
"cpuConsumed",
(oldValue, newValue) -> (long) oldValue + (long) newValue
);
- private final String name;
/**
- * Merge function associated with a key: Object (Object oldValue, Object
newValue)
+ * TreeMap is used to have the natural ordering of its keys
*/
+ private static Map<String, BaseKey> map = new TreeMap<>();
+
+ static {
+ for (BaseKey key : values()) {
+ addKey(key);
+ }
+ }
+
+ /**
+ * The primary way of registering context keys.
+ * Only the keys registered this way are considered during the context
merge.
Review comment:
Please note what happens if a context has an unregistered key. (I think,
ideally, it should throw ISE.)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]