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/10/11 17:55:30 UTC

[GitHub] [samza] rmatharu commented on a change in pull request #1180: Samza-2340 Introduce ContainerManager for handling validation for failures & starts of active & standby containers

rmatharu commented on a change in pull request #1180: Samza-2340 Introduce ContainerManager for handling validation for failures & starts of active & standby containers
URL: https://github.com/apache/samza/pull/1180#discussion_r334107627
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/clustermanager/ContainerManager.java
 ##########
 @@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.samza.clustermanager;
+
+import com.google.common.annotations.VisibleForTesting;
+import java.time.Duration;
+import java.util.Optional;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * ContainerManager is a centralized entity that manages control actions like start, stop for both active and standby containers
+ * ContainerManager acts as a brain for validating and issuing any actions on containers in the Job Coordinator.
+ *
+ * The requests to allocate resources resources made by {@link ContainerAllocator} can either expire or succeed.
+ * When the requests succeeds the ContainerManager validates those requests before starting the container
+ * When the requests expires the ContainerManager decides the next set of actions for the pending request.
+ *
+ * Callbacks issued from  {@link ClusterResourceManager} aka {@link ContainerProcessManager} are intercepted
+ * by ContainerManager to handle container failure and completions for both active and standby containers
+ */
+public class ContainerManager {
+
+  private static final Logger LOG = LoggerFactory.getLogger(ContainerManager.class);
+
+  /**
+   * Resource-manager, used to stop containers
+   */
+  private ClusterResourceManager clusterResourceManager;
 
 Review comment:
   can this and standbyContainerManager be made final?

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