Sanil15 commented on a change in pull request #1219: SAMZA-2373: Container 
Placement Service (core functionality) for container move and restart
URL: https://github.com/apache/samza/pull/1219#discussion_r348681139
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/clustermanager/ContainerAllocator.java
 ##########
 @@ -195,31 +189,28 @@ void assignResourceRequests() {
       LOG.info("Handling assignment request for Processor ID: {} on host: 
{}.", processorId, preferredHost);
       if (hasAllocatedResource(preferredHost)) {
 
-        // Found allocated container on preferredHost
         LOG.info("Found an available container for Processor ID: {} on the 
host: {}", processorId, preferredHost);
 
         // Needs to be only updated when host affinity is enabled
         if (hostAffinityEnabled) {
           state.matchedResourceRequests.incrementAndGet();
         }
 
-        containerManager.handleContainerLaunch(request, preferredHost, 
peekAllocatedResource(preferredHost), resourceRequestState, this);
+        containerManager.handleContainerLaunch(request, preferredHost, 
peekAllocatedResource(preferredHost),
+            resourceRequestState, this);
 
       } else {
 
         LOG.info("Did not find any allocated containers for running Processor 
ID: {} on the host: {}.",
             processorId, preferredHost);
-        boolean expired = isRequestExpired(request);
 
-        if (expired) {
+        if (isRequestExpired(request)) {
           updateExpiryMetrics(request);
-          if (hostAffinityEnabled) {
-            
containerManager.handleExpiredRequestWithHostAffinityEnabled(processorId, 
preferredHost, request, this, resourceRequestState);
-          }
+          
containerManager.handleExpiredRequestForControlActionOrHostAffinityEnabled(processorId,
 preferredHost, request, this, resourceRequestState);
 
 Review comment:
   The method returns a boolean then `isRequestExpired` makes sense to me.
   
   "since there is no longer distinction within this method on which expired 
request should be handled."
   
   This method internally calls `getRequestTimeout(request)` which handles per 
request timeout if configured, I don't see whats the confusion?
   

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