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_r352794856
##########
File path:
samza-core/src/main/java/org/apache/samza/clustermanager/ContainerManager.java
##########
@@ -62,33 +83,67 @@ public ContainerManager(SamzaApplicationState
samzaApplicationState, ClusterReso
}
/**
- * Handles the container start action for both active & standby containers.
+ * Handles the container start action for both active & standby containers.
This method is invoked by the allocator thread
+ *
+ * Case 1. If the container launch request is due to an existing container
placement action, issue a stop on active
+ * container & wait for the active container to be stopped before
issuing a start.
+ * Case 2. If StandbyContainer is present refer to {@code
StandbyContainerManager#checkStandbyConstraintsAndRunStreamProcessor}
+ * Case 3. Otherwise just invoke a container start on the allocated resource
for the pending request
+ *
+ * TODO: SAMZA-2399: Investigate & configure a timeout for container stop if
needed
*
* @param request pending request for the preferred host
* @param preferredHost preferred host to start the container
* @param allocatedResource resource allocated from {@link
ClusterResourceManager}
* @param resourceRequestState state of request in {@link ContainerAllocator}
* @param allocator to request resources from @{@link ClusterResourceManager}
+ *
+ * @return true if the allocator thread supposed to sleep for sometime
before checking the stop of active container
+ * for an undergoing container placement action, false otherwise
*/
- void handleContainerLaunch(SamzaResourceRequest request, String
preferredHost, SamzaResource allocatedResource,
+ boolean handleContainerLaunch(SamzaResourceRequest request, String
preferredHost, SamzaResource allocatedResource,
ResourceRequestState resourceRequestState, ContainerAllocator allocator)
{
+
+ if (hasActiveContainerPlacementAction(request.getProcessorId())) {
+ String processorId = request.getProcessorId();
+ ContainerPlacementMetadata actionMetaData =
getPlacementActionMetadata(processorId).get();
Review comment:
sure
----------------------------------------------------------------
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