You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/07/14 19:32:39 UTC

[GitHub] [helix] jiajunwang commented on a change in pull request #1124: Add stale message map to improve P2P message rate

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org