FMX commented on code in PR #1835:
URL: 
https://github.com/apache/incubator-celeborn/pull/1835#discussion_r1305441400


##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/memory/MemoryManager.java:
##########
@@ -274,6 +240,59 @@ public ServingState currentServingState() {
     return isPaused ? ServingState.PUSH_PAUSED : ServingState.NONE_PAUSED;
   }
 
+  @VisibleForTesting
+  protected void switchServingState() {
+    ServingState lastState = servingState;
+    servingState = currentServingState();
+    if (lastState == servingState) {
+      if (servingState != ServingState.NONE_PAUSED) {
+        logger.debug("Trigger action: TRIM");
+        trimAllListeners();
+      }
+      return;
+    }
+    logger.info("Serving state transformed from {} to {}", lastState, 
servingState);
+    switch (servingState) {
+      case PUSH_PAUSED:
+        pausePushDataCounter.increment();
+        logger.info("Trigger action: PAUSE PUSH, RESUME REPLICATE");
+        if (lastState == ServingState.PUSH_AND_REPLICATE_PAUSED) {

Review Comment:
   Good to see this change. This will surely improve efficiency.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to