suneet-s commented on code in PR #16041:
URL: https://github.com/apache/druid/pull/16041#discussion_r1513363337


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java:
##########
@@ -134,6 +134,23 @@ default int getPriority()
    */
   String getType();
 
+  /**
+   * Provides a default implementation for obtaining a task's label. This 
label is intended
+   * to serve as a descriptive identifier for the task's purpose or type, 
which can be utilized
+   * for more nuanced task management, monitoring, and logging activities.
+   *
+   * By default, this method returns the task type obtained from {@link 
#getType()},
+   * reflecting the basic categorization of the task.
+   *
+   * @return A string representing the task's label, which by default is the 
task type.
+   *         Override this method to specify more granular labels tailored to 
the task's
+   *         specific purpose or operational characteristics.
+   */
+  default String getLabel()
+  {
+    return getType();
+  }

Review Comment:
   Since a label is a subjective thing, I can imagine Druid operators wanting 
to implement their own custom labeling strategy. 
   
   Have you considered adding an interface that is extensible to allow Druid 
operators to define their own labeling? I think this will give operators the 
flexibility to define their own labels by implementing an extension. Druid can 
have a default labeling strategy that does something like what is being 
proposed in this change.
   
   Can you please update the PR with a description of how the interface is 
expected to work, and any design decisions that were made in choosing the 
interface as well as docs that describe where the labels are emitted and how 
they are set.
   
   Some things in particular I'm interested in knowing more about 
   - This label appears to be a system defined label. Is this change meant to 
support system and user defined labels eventually?
   - Why is there just one label? Many times there is a reason to have multiple 
labels for something - why not have a list of labels?
   - How are Druid operators meant to customize this?
   - Where is the label expected to be emitted? Are there any future changes 
needed so that the label is in all the places it needs to be



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to