FMX commented on code in PR #2758:
URL: https://github.com/apache/celeborn/pull/2758#discussion_r1776231375


##########
common/src/main/scala/org/apache/celeborn/common/container/ContainerInfoProvider.scala:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.celeborn.common.container
+
+import scala.collection.JavaConverters._
+
+import org.apache.celeborn.common.CelebornConf
+import org.apache.celeborn.common.internal.Logging
+import org.apache.celeborn.common.util.Utils
+import org.apache.celeborn.rest.v1.model.ContainerInfo
+
+abstract class ContainerInfoProvider {
+
+  def getContainerInfo(): ContainerInfo
+
+}
+
+object ContainerInfoProvider extends Logging {

Review Comment:
   I think it will be better to move this class into Celeborn service module.



##########
common/pom.xml:
##########
@@ -128,6 +128,17 @@
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-core</artifactId>
     </dependency>
+    <dependency>

Review Comment:
   This kind of circular reference is not a good practice. I think remove this 
is necessary.



##########
common/src/main/scala/org/apache/celeborn/common/container/DefaultContainerInfoProvider.scala:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.celeborn.common.container
+
+import org.apache.celeborn.common.util.Utils
+import org.apache.celeborn.rest.v1.model.ContainerInfo
+
+class DefaultContainerInfoProvider extends ContainerInfoProvider {

Review Comment:
   Ditto.



##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -5037,6 +5040,15 @@ object CelebornConf extends Logging {
       .stringConf
       .createWithDefault(classOf[DefaultIdentityProvider].getName)
 
+  val CONTAINER_INFO_PROVIDER: ConfigEntry[String] =
+    buildConf("celeborn.container.info.provider")
+      .categories("master", "worker")
+      .doc(s"ContainerInfoProvider class name. Default class is " +
+        s"`${classOf[DefaultContainerInfoProvider].getName}`. ")

Review Comment:
   Use a string instead of a class reference.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to