Source:
<code>void publishStatusUpdateRecord(ZNRecord record, Message message, Level level, HelixDataAccessor accessor, boolean isController) { String instanceName = message.getTgtName(); String statusUpdateSubPath = getStatusUpdateSubPath(message); String statusUpdateKey = getStatusUpdateKey(message); String sessionId = message.getExecutionSessionId(); if (sessionId == null) { sessionId = message.getTgtSessionId(); } if (sessionId == null) { sessionId = "*"; } Builder keyBuilder = accessor.keyBuilder(); if (!_recordedMessages.containsKey(message.getMsgId())) { ZNRecord statusUpdateRecord = createMessageLogRecord(message); PropertyKey propertyKey; if (isController) { propertyKey = keyBuilder.controllerTaskStatus(statusUpdateSubPath, statusUpdateKey); <START> accessor.updateProperty(propertyKey, new StatusUpdate(statusUpdateRecord)); <END> } else { propertyKey = keyBuilder.stateTransitionStatus(instanceName, sessionId, statusUpdateSubPath, statusUpdateKey); 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) { propertyKey = keyBuilder.controllerTaskStatus(statusUpdateSubPath, statusUpdateKey); accessor.updateProperty(propertyKey, new StatusUpdate(record)); } else { propertyKey = keyBuilder.stateTransitionStatus(instanceName, sessionId, statusUpdateSubPath, statusUpdateKey); accessor.updateProperty(propertyKey, new StatusUpdate(record)); } if (_logger.isTraceEnabled()) { _logger.trace("StatusUpdate path:" + propertyKey.getPath() + ", updates:" + record); } if (Level.HELIX_ERROR == level) { publishErrorRecord(record, instanceName, statusUpdateSubPath, statusUpdateKey, sessionId, accessor, isController); } }</code><technical_language>nit, move this line out of if-else block too</technical_language>

Target:
void publishStatusUpdateRecord(ZNRecord record, Message message, Level level, HelixDataAccessor accessor, boolean isController) { String instanceName = message.getTgtName(); String statusUpdateSubPath = getStatusUpdateSubPath(message); String statusUpdateKey = getStatusUpdateKey(message); String sessionId = message.getExecutionSessionId(); if (sessionId == null) { sessionId = message.getTgtSessionId(); } if (sessionId == null) { sessionId = "*"; } Builder keyBuilder = accessor.keyBuilder(); if (!_recordedMessages.containsKey(message.getMsgId())) { ZNRecord statusUpdateRecord = createMessageLogRecord(message); PropertyKey propertyKey; if (isController) { propertyKey = keyBuilder.controllerTaskStatus(statusUpdateSubPath, statusUpdateKey); } else { propertyKey = keyBuilder.stateTransitionStatus(instanceName, sessionId, statusUpdateSubPath, statusUpdateKey); } 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) { propertyKey = keyBuilder.controllerTaskStatus(statusUpdateSubPath, statusUpdateKey); } else { propertyKey = keyBuilder.stateTransitionStatus(instanceName, sessionId, statusUpdateSubPath, statusUpdateKey); } accessor.updateProperty(propertyKey, new StatusUpdate(record)); if (_logger.isTraceEnabled()) { _logger.trace("StatusUpdate path:" + propertyKey.getPath() + ", updates:" + record); } if (Level.HELIX_ERROR == level) { publishErrorRecord(record, instanceName, statusUpdateSubPath, statusUpdateKey, sessionId, accessor, isController); } }