sv2000 commented on a change in pull request #2912: [GOBBLIN-1072] Being more 
conservative on leasing containers
URL: https://github.com/apache/incubator-gobblin/pull/2912#discussion_r389195898
 
 

 ##########
 File path: 
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnAutoScalingManager.java
 ##########
 @@ -189,16 +224,123 @@ void runInternal() {
         }
       }
 
+      // Find all participants appearing in this cluster. Note that Helix 
instances can contain cluster-manager
+      // and potentially replanner-instance.
+      Set<String> allParticipants = 
getParticipants(GobblinYarnTaskRunner.class.getSimpleName());
+
+      // Find all joined participants not in-use for this round of inspection.
+      // If idle time is beyond tolerance, mark the instance as unused by 
assigning timestamp as -1.
+      for (String participant : allParticipants) {
+        if (!inUseInstances.contains(participant)) {
+          instanceIdleSinceWhen.putIfAbsent(participant, 
System.currentTimeMillis());
+          if (absenceUnderTolerance(participant)) {
+            inUseInstances.add(participant);
+          }
+        } else {
+          // An instance that has been previously detected as idle but now 
back to in-use.
 
 Review comment:
   Reword: "A previously idle instance is now detected to be in use."

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


With regards,
Apache Git Services

Reply via email to