mqliang commented on pull request #6710:
URL: https://github.com/apache/incubator-pinot/pull/6710#issuecomment-807704383


   @mcvsubbu Here is what Jackie means by assign a ID to enum key:
   ```
   enum TrailerKeys {
       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"),
       NUM_SEGMENTS_MATCHED(8, "numSegmentsMatched"),
       NUM_CONSUMING_SEGMENTS_PROCESSED(9, "numConsumingSegmentsProcessed"),
       MIN_CONSUMING_FRESHNESS_TIME_MS(10, "minConsumingFreshnessTimeMs"),
       TOTAL_DOCS_METADATA_KEY(11, "totalDocs"),
       NUM_GROUPS_LIMIT_REACHED_KEY(12, "numGroupsLimitReached"),
       TIME_USED_MS_METADATA_KEY(13, "timeUsedMs"),
       TRACE_INFO_METADATA_KEY(14, "traceInfo"),
       REQUEST_ID_METADATA_KEY(15, "requestId"),
       NUM_RESIZES_METADATA_KEY(16, "numResizes"),
       RESIZE_TIME_MS_METADATA_KEY(17, "resizeTimeMs"),
       EXECUTION_THREAD_CPU_TIME_NS_METADATA_KEY(18, 
"executionThreadCpuTimeNs"),
       RESPONSE_SERIALIZATION_CPU_TIME_NS_METADATA_KEY(19, 
"responseSerializationCpuTimeNs"),
       ;
   
       private static final Map<Integer, TrailerKeys> _map = new HashMap<>();
       static {
         for (TrailerKeys key : TrailerKeys.values()) {
           if (_map.put(key.getId(), key) != null) {
             throw new IllegalArgumentException("duplicate id: " + key.getId());
           }
         }
       }
   
       private String _name;
       private int _id;
   
       TrailerKeys(int id, String name) {
         this._id = id;
         this._name = name;
       }
   
       public String getName() {
         return _name;
       }
   
       public int getId() {
         return _id;
       }
   
       public static TrailerKeys getById(int id) {
         return _map.get(id);
       }
     }
   ```


-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to