pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] srkukarni commented on a change in pull request #3397: Exposing more methods in Sink/Source Context
Date Tue, 22 Jan 2019 20:39:40 GMT
srkukarni commented on a change in pull request #3397: Exposing more methods in Sink/Source
Context
URL: https://github.com/apache/pulsar/pull/3397#discussion_r249951284
 
 

 ##########
 File path: pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java
 ##########
 @@ -40,4 +45,66 @@
      * @param value The value of the metric
      */
     void recordMetric(String metricName, double value);
+
+    /**
+     * Get a list of all input topics
+     * @return a list of all input topics
+     */
+    Collection<String> getInputTopics();
+
+    /**
+     * The tenant this sink belongs to
+     * @return the tenant this sink belongs to
+     */
+    String getTenant();
+
+    /**
+     * The namespace this sink belongs to
+     * @return the namespace this sink belongs to
+     */
+    String getNamespace();
+
+    /**
+     * The name of the sink that we are executing
+     * @return The Sink name
+     */
+    String getSinkName();
+
+    /**
+     * The logger object that can be used to log in a sink
+     * @return the logger object
+     */
+    Logger getLogger();
+    
+    /**
+     * Increment the builtin distributed counter refered by key
+     * @param key The name of the key
+     * @param amount The amount to be incremented
+     */
+    void incrCounter(String key, long amount);
 
 Review comment:
   It could well be useful in the future. However I always tend to add things only when needed.
Thus unless there is a compelling usecase right now for sources/sinks to use this, my vote
would be to defer it to later.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message