Sanil15 commented on a change in pull request #1227: SAMZA-2404: [SEP-22] 
Container Placement Handler for dispatching container placement messages 
between metastore and JobCoordinator
URL: https://github.com/apache/samza/pull/1227#discussion_r366607528
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/clustermanager/container/placement/ContainerPlacementHandler.java
 ##########
 @@ -0,0 +1,84 @@
+/*
+ * 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.container.placement;
+
+import com.google.common.base.Preconditions;
+import org.apache.samza.clustermanager.ContainerProcessManager;
+import org.apache.samza.container.placement.ContainerPlacementRequestMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Stateless handler that dispatches {@link ContainerPlacementRequestMessage} 
read from Metadata store to Job Coordinator
+ */
+public class ContainerPlacementHandler implements Runnable {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(ContainerPlacementHandler.class);
+  private static final int 
DEFAULT_CLUSTER_MANAGER_CONTAINER_PLACEMENT_HANDLER_SLEEP_MS = 5000;
+
+  /**
+   * {@link ContainerProcessManager} needs to intercept container placement 
actions between ContainerPlacementHandler and
+   * {@link org.apache.samza.clustermanager.ContainerManager} to avoid cyclic 
dependency between
+   * {@link org.apache.samza.clustermanager.ContainerManager} and {@link 
org.apache.samza.clustermanager.ContainerAllocator}
+   */
+  private final ContainerProcessManager containerProcessManager;
+  private final ContainerPlacementUtil containerPlacementUtil;
 
 Review comment:
   ClusterBasedJC injects a metastore (so as to share the same connections to 
metastore) when it constructs ContainerPlacementUtil and injects it to CPM for 
writing responses back and CPH to dispatch requests 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to