jiajunwang commented on a change in pull request #359: Dynamically change the 
processor thread name when consuming event
URL: https://github.com/apache/helix/pull/359#discussion_r306629393
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
 ##########
 @@ -1165,7 +1164,11 @@ public void run() {
               + _processorName);
       while (!isInterrupted()) {
         try {
-          handleEvent(_eventBlockingQueue.take(), _cache);
+          ClusterEvent newClusterEvent = _eventBlockingQueue.take();
+          // rename the current processor's thread name to include event id
+          String currentThreadName = this.getName().split("_")[0];
+          this.setName(currentThreadName + "_" + newClusterEvent.getEventId());
 
 Review comment:
   Can we use "()" to wrap the event? I feel it's easier to identify which part 
is the default thread name, and which part is the event name.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to