RexXiong commented on code in PR #2365:
URL: 
https://github.com/apache/incubator-celeborn/pull/2365#discussion_r1523430529


##########
common/src/main/scala/org/apache/celeborn/common/meta/ApplicationInfo.scala:
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.meta
+
+import java.util.concurrent.atomic.LongAdder
+
+/**
+ * Application Info.
+ */
+class ApplicationInfo {

Review Comment:
   why we need add this class? and it seems irrelevant with this pr



##########
common/src/main/scala/org/apache/celeborn/common/identity/UserIdentifier.scala:
##########
@@ -44,6 +44,8 @@ case class UserIdentifier(tenantId: String, name: String) {
 object UserIdentifier extends Logging {
   val USER_IDENTIFIER = "^\\`(.+)\\`\\.\\`(.+)\\`$".r
 
+  val UNKNOWN_USER_IDENTIFIER = UserIdentifier("unknown", "unknown")

Review Comment:
   UNKNOWN_USER_IDENTIFIER can refer to IdentityProvider.DEFAULT_TENANT_ID and 
DEFAULT_USERNAME, and the name can be changed to DEFAULT_USER_IDENTIFIER



##########
master/src/main/scala/org/apache/celeborn/service/deploy/master/Master.scala:
##########
@@ -93,6 +94,7 @@ private[celeborn] class Master(
         .withServerSaslContext(
           new ServerSaslContextBuilder()
             .withAddRegistrationBootstrap(true)
+            .withAUthEnabled(authEnabled)

Review Comment:
   .withAuthEnabled



##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -1142,12 +1141,26 @@ class CelebornConf(loadDefaults: Boolean) extends 
Cloneable with Logging with Se
     authEnabled && internalPortEnabled
   }
 
+  def appRegisterEnabled: Boolean = {
+    val appRegisterEnabled = get(APP_REGISTER_ENABLED) || authEnabled
+    val internalPortEnabled = get(INTERNAL_PORT_ENABLED)

Review Comment:
   internalPort only used between Celeborn master and workers, appRegister 
should not pay attention to this.



##########
common/src/main/java/org/apache/celeborn/common/network/sasl/registration/RegistrationRpcHandler.java:
##########
@@ -177,7 +183,9 @@ private void processRpcMessage(
         break;
       case REGISTER_APPLICATION_REQUEST_VALUE:
         PbRegisterApplicationRequest registerApplicationRequest = 
pbMsg.getParsedPayload();
-        checkRequestAllowed(RegistrationState.AUTHENTICATED);
+        if (authEnabled) {
+          checkRequestAllowed(RegistrationState.AUTHENTICATED);

Review Comment:
   how about move authEnabled condition into checkRequestAllowed?



##########
master/src/main/java/org/apache/celeborn/service/deploy/master/clustermeta/AbstractMetaManager.java:
##########
@@ -93,14 +94,18 @@ public void updateRequestSlotsMeta(
     registeredShuffle.add(shuffleKey);
 
     String appId = Utils.splitShuffleKey(shuffleKey)._1;
-    appHeartbeatTime.compute(
+    applications.compute(

Review Comment:
   Better not change to applicationInfo  in this pr.



##########
common/src/main/scala/org/apache/celeborn/common/util/PbSerDeUtils.scala:
##########
@@ -457,6 +459,22 @@ object PbSerDeUtils {
     builder.build()
   }
 
+  def fromPbApplicationInfo(pbApplicationInfo: PbApplicationInfo): 
ApplicationInfo = {
+    val applicationInfo = new ApplicationInfo()
+    applicationInfo.updateFileCount(pbApplicationInfo.getFileCount)
+    applicationInfo.updateTotalWritten(pbApplicationInfo.getTotalWritten)
+    applicationInfo.setHeartbeatTime(pbApplicationInfo.getLastHeartbeatTime)
+    applicationInfo
+  }
+
+  def toPbApplicationInfo(applicationInfo: ApplicationInfo): PbApplicationInfo 
= {

Review Comment:
   PbApplicationMeta need add userIdentifier and should serialize/deserialize 
to/from ratis log.



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