You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/09/24 17:50:17 UTC

[GitHub] [samza] Sanil15 commented on a change in pull request #1152: SAMZA-2319: Simplify Container Allocation logic

Sanil15 commented on a change in pull request #1152: SAMZA-2319: Simplify Container Allocation logic
URL: https://github.com/apache/samza/pull/1152#discussion_r327378207
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/clustermanager/AbstractContainerAllocator.java
 ##########
 @@ -35,20 +35,35 @@
 
 /**
  * {@link AbstractContainerAllocator} makes requests for physical resources to the resource manager and also runs
- * a processor on an allocated physical resource. Sub-classes should override the assignResourceRequests()
- * method to assign resource requests according to some strategy.
+ * a processor on an allocated physical resource.
  *
- * See {@link ContainerAllocator} and {@link HostAwareContainerAllocator} for two such strategies
+ * In case of host-affinity enabled, each request ({@link SamzaResourceRequest} encapsulates the identifier of the processor
+ * to be run and a "preferredHost". preferredHost is determined by the locality mappings in the coordinator stream.
+ * This thread periodically wakes up and makes the best-effort to assign a processor to the preferredHost. If a
+ * resource on the preferredHost is not returned by the cluster manager before the corresponding request expires, it
+ * assigns the processor to any other host that is allocated next.
+ *
+ * When host-affinity is not enabled, this periodically wakes up to assign a processor to *ANY* allocated resource.
+ * If there aren't enough resources, it waits by sleeping for {@code allocatorSleepIntervalMs} milliseconds.
+ *
+ * The resource expiry timeout is determined by CONTAINER_REQUEST_TIMEOUT and is configurable on a per-job basis.
+ *
+ * If there aren't enough resources, it waits by sleeping for allocatorSleepIntervalMs milliseconds.
  *
  * This class is not thread-safe. This class is used in the refactored code path as called by run-jc.sh
  */
-public abstract class AbstractContainerAllocator implements Runnable {
+public class AbstractContainerAllocator implements Runnable {
 
 Review comment:
   Please read the PR description, already stated the reason of not renaming this in the current PR 

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


With regards,
Apache Git Services