esevastyanov opened a new pull request #8157: Enum of ResponseContext keys
URL: https://github.com/apache/incubator-druid/pull/8157
 
 
   ### Description
   Aggregated `ResponseContext` keys into enum as a next step of 
[ResponseContext 
refactoring](https://github.com/apache/incubator-druid/pull/8110). Previously 
the keys were just static strings so theoretically there was no obstacle to use 
any string as a key of `ReponseContext`. This refactoring eliminates this 
possibility by introducing the enum of `ResponseContext` keys and exposing only 
methods requiring the enum instance as a key.
   #### Fixed the issue of merging `ResponseContext` instances returned by 
Historicals to Broker
   There was no rule of merging different response contexts but from my point 
of view, the current solution of rewriting existing values by last ones is 
incorrect because of losing valuable information. For example, a value 
associated with the key `UNCOVERED_INTERVALS` contains a list of uncovered 
intervals and the result value is not the last returned but the concatenation 
of all returned lists. The same issue with the key `MISSING_SEGMENTS` (a list 
of missing segments) and `COUNT` (the number of scanned rows). Thus I decided 
to provide every key with a merge function. So response contexts merge became a 
simple procedure.
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [x] added unit tests or modified existing tests to cover new code paths.
   
   <hr>
   
   For reviewers: the key changed classes is `ResponseContext`.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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

Reply via email to