leventov commented on a change in pull request #8157: Enum of ResponseContext 
keys
URL: https://github.com/apache/incubator-druid/pull/8157#discussion_r308781300
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/query/context/ResponseContext.java
 ##########
 @@ -44,9 +47,47 @@
 public abstract class ResponseContext
 {
   /**
-   * Keys associated with objects in the context.
+   * The base interface of a response context key.
+   * Should be implemented by every context key.
    */
-  public enum Key
+  public interface BaseKey
+  {
+    String getName();
+    /**
+     * Merge function associated with a key: Object (Object oldValue, Object 
newValue)
+     */
+    BiFunction<Object, Object, Object> getMergeFunction();
+  }
+
+  /**
+   * Keys associated with objects in the context. The enum is 
extension-friendly.
 
 Review comment:
   I think it doesn't make a lot of sense to say that "The enum is 
extension-friendly." Enum is not extension-friendly, but the key system (based 
from `BaseKey`) is. So I would just remove this sentence.

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