jiajunwang commented on a change in pull request #1124:
URL: https://github.com/apache/helix/pull/1124#discussion_r454591410



##########
File path: 
helix-core/src/main/java/org/apache/helix/common/caches/InstanceMessagesCache.java
##########
@@ -151,6 +153,13 @@ public boolean refresh(HelixDataAccessor accessor, 
Map<String, LiveInstance> liv
     return true;
   }
 
+  public Map<String, Map<String, Message>> getStaleMessageCache() {
+    return _staleMessageCache;
+  }
+
+  public void setStaleMessageCache(Map<String, Map<String, Message>> 
staleMessageMap) {

Review comment:
       Not used?

##########
File path: 
helix-core/src/main/java/org/apache/helix/common/caches/InstanceMessagesCache.java
##########
@@ -151,6 +153,13 @@ public boolean refresh(HelixDataAccessor accessor, 
Map<String, LiveInstance> liv
     return true;
   }
 
+  public Map<String, Map<String, Message>> getStaleMessageCache() {
+    return _staleMessageCache;
+  }
+
+  public void setStaleMessageCache(Map<String, Map<String, Message>> 
staleMessageMap) {

Review comment:
       If no set is called, how the items in the cache being updated?

##########
File path: 
helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
##########
@@ -191,6 +213,15 @@ private void updatePendingMessages(LiveInstance instance, 
Collection<Message> pe
     }
   }
 
+  private boolean isStaleMessage(Message message, String currentState) {
+    if (_isTaskFrameworkPipeline || currentState == null || 
message.getFromState() == null

Review comment:
       Introducing _isTaskFrameworkPipeline to isStaleMessage is confusing. I 
would prefer do this,
   "if (!_isTaskFrameworkPipeline && isStaleMessage(...)) {set stale message}"

##########
File path: 
helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java
##########
@@ -236,6 +267,11 @@ private void updateCurrentStates(LiveInstance instance, 
Collection<CurrentState>
     }
   }
 
+  private void setStaleMessage(CurrentStateOutput currentStateOutput, String 
instanceName,

Review comment:
       Can we just call "currentStateOutput.setStaleMessage(instanceName, 
message);" in the caller so we don't need this method?




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