kaisun2000 commented on a change in pull request #1487:
URL: https://github.com/apache/helix/pull/1487#discussion_r520889149



##########
File path: helix-core/src/main/java/org/apache/helix/util/StatusUpdateUtil.java
##########
@@ -492,47 +496,39 @@ void publishStatusUpdateRecord(ZNRecord record, Message 
message, Level level,
 
     Builder keyBuilder = accessor.keyBuilder();
     if (!_recordedMessages.containsKey(message.getMsgId())) {
-      if (isController) {
-        accessor
-            
.updateProperty(keyBuilder.controllerTaskStatus(statusUpdateSubPath, 
statusUpdateKey),
-                new StatusUpdate(createMessageLogRecord(message)));
+      ZNRecord statusUpdateRecord = createMessageLogRecord(message);
+      PropertyKey propertyKey;
 
+      if (isController) {
+        propertyKey = keyBuilder.controllerTaskStatus(statusUpdateSubPath, 
statusUpdateKey);
+        accessor.updateProperty(propertyKey, new 
StatusUpdate(statusUpdateRecord));
       } else {
-
-        PropertyKey propertyKey =
+        propertyKey =
             keyBuilder.stateTransitionStatus(instanceName, sessionId, 
statusUpdateSubPath,
                 statusUpdateKey);
-
-        ZNRecord statusUpdateRecord = createMessageLogRecord(message);
-
-        // For now write participant StatusUpdates to log4j.
-        // we are using restlet as another data channel to report to 
controller.
-        if (_logger.isTraceEnabled()) {
-          _logger.trace("StatusUpdate path:" + propertyKey.getPath() + ", 
updates:"
-              + statusUpdateRecord);
-        }
         accessor.updateProperty(propertyKey, new 
StatusUpdate(statusUpdateRecord));
+      }
 
+      if (_logger.isTraceEnabled()) {
+        _logger.trace("StatusUpdate path:" + propertyKey.getPath() + ", 
updates:"
+            + statusUpdateRecord);
       }
       _recordedMessages.put(message.getMsgId(), message.getMsgId());
     }
 
+    PropertyKey propertyKey;
     if (isController) {
-      accessor.updateProperty(
-          keyBuilder.controllerTaskStatus(statusUpdateSubPath, 
statusUpdateKey), new StatusUpdate(
-              record));
+      propertyKey = keyBuilder.controllerTaskStatus(statusUpdateSubPath, 
statusUpdateKey);
+      accessor.updateProperty(propertyKey, new StatusUpdate(record));

Review comment:
       fixed.




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



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

Reply via email to