mqliang commented on a change in pull request #6710:
URL: https://github.com/apache/incubator-pinot/pull/6710#discussion_r603637907
##########
File path:
pinot-common/src/main/java/org/apache/pinot/common/utils/DataTable.java
##########
@@ -46,8 +52,120 @@
String RESIZE_TIME_MS_METADATA_KEY = "resizeTimeMs";
String EXECUTION_THREAD_CPU_TIME_NS_METADATA_KEY =
"executionThreadCpuTimeNs";
+ /* The MetadataKeys is used in V3, where we present metadata as
Map<MetadataKeys, String>
+ * ATTENTION:
+ * - Don't add new key which has same id/name with existing keys. Duplicate
id/name is not allowed.
+ * - Don't change id/name of existing keys.
+ * Otherwise, backward compatibility will be broken.
+ */
+ enum MetadataKeys {
+ UNKNOWN(0, "unknown"),
+ TABLE_KEY(1, "table"), // NOTE: this key is only used in
PrioritySchedulerTest
+ EXCEPTION_METADATA_KEY(2, "Exception"),
+ NUM_DOCS_SCANNED_METADATA_KEY(3, "numDocsScanned"),
+ NUM_ENTRIES_SCANNED_IN_FILTER_METADATA_KEY(4, "numEntriesScannedInFilter"),
+ NUM_ENTRIES_SCANNED_POST_FILTER_METADATA_KEY(5,
"numEntriesScannedPostFilter"),
+ NUM_SEGMENTS_QUERIED(6, "numSegmentsQueried"),
+ NUM_SEGMENTS_PROCESSED(7, "numSegmentsProcessed"),
Review comment:
I believe it's left over from history. In V2, some metadata key string
literal has the suffix and some not, namely the following 4 does not have the
suffix:
```
String NUM_SEGMENTS_QUERIED = "numSegmentsQueried";
String NUM_SEGMENTS_PROCESSED = "numSegmentsProcessed";
String NUM_SEGMENTS_MATCHED = "numSegmentsMatched";
String NUM_CONSUMING_SEGMENTS_PROCESSED = "numConsumingSegmentsProcessed";
String MIN_CONSUMING_FRESHNESS_TIME_MS = "minConsumingFreshnessTimeMs";
```
So I copied them to keep consistence. Now, I have remove the suffix for all
the keys in V3. In V3, all the keys are in a
MetadataKeys enum), so user will know they are metadata keys even if they do
not has a suffix.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]