gavinchou commented on code in PR #30340:
URL: https://github.com/apache/doris/pull/30340#discussion_r1465281801


##########
fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadJob.java:
##########
@@ -193,6 +193,23 @@ private void 
onPendingTaskFinished(BrokerPendingTaskAttachment attachment) {
         loadStartTimestamp = System.currentTimeMillis();
     }
 
+    private LoadLoadingTask createAndInit(Database db, OlapTable table, 
List<BrokerFileGroup> brokerFileGroups,

Review Comment:
   just call it createLoadingTask()



##########
fe/fe-core/src/main/java/org/apache/doris/cloud/load/loadv2/CloudBrokerLoadJob.java:
##########
@@ -0,0 +1,117 @@
+// 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.doris.cloud.load.loadv2;
+
+import org.apache.doris.analysis.BrokerDesc;
+import org.apache.doris.analysis.UserIdentity;
+import org.apache.doris.catalog.Database;
+import org.apache.doris.catalog.Env;
+import org.apache.doris.catalog.OlapTable;
+import org.apache.doris.common.MetaNotFoundException;
+import org.apache.doris.common.UserException;
+import org.apache.doris.load.BrokerFileGroup;
+import org.apache.doris.load.BrokerFileGroupAggInfo.FileGroupAggKey;
+import org.apache.doris.load.loadv2.BrokerLoadJob;
+import org.apache.doris.load.loadv2.BrokerPendingTaskAttachment;
+import org.apache.doris.load.loadv2.LoadLoadingTask;
+import org.apache.doris.qe.AutoCloseConnectContext;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.OriginStatement;
+import org.apache.doris.thrift.TUniqueId;
+
+import com.google.common.base.Strings;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.List;
+import java.util.UUID;
+
+public class CloudBrokerLoadJob extends BrokerLoadJob {
+    private static final Logger LOG = 
LogManager.getLogger(CloudBrokerLoadJob.class);
+
+    protected static final String CLUSTER_ID = "clusterId";

Review Comment:
   it seems to be confusing with the existing clusterid stored on BE.
   is it better using cloudClusterId instead?



##########
fe/fe-core/src/main/java/org/apache/doris/cloud/planner/CloudStreamLoadPlanner.java:
##########
@@ -0,0 +1,73 @@
+// 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.doris.cloud.planner;
+
+import org.apache.doris.catalog.Database;
+import org.apache.doris.catalog.OlapTable;
+import org.apache.doris.common.UserException;
+import org.apache.doris.planner.StreamLoadPlanner;
+import org.apache.doris.qe.AutoCloseConnectContext;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.task.LoadTaskInfo;
+import org.apache.doris.thrift.TExecPlanFragmentParams;
+import org.apache.doris.thrift.TUniqueId;
+
+import com.google.common.base.Strings;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class CloudStreamLoadPlanner extends StreamLoadPlanner {
+    private static final Logger LOG = 
LogManager.getLogger(CloudStreamLoadPlanner.class);
+
+    private String cloudClusterName;
+
+    public CloudStreamLoadPlanner(Database db, OlapTable destTable, 
LoadTaskInfo taskInfo, String cloudClusterName) {
+        super(db, destTable, taskInfo);
+        this.cloudClusterName = cloudClusterName;
+    }
+
+    private AutoCloseConnectContext buildConnectContext() throws UserException 
{
+        if (ConnectContext.get() == null) {
+            ConnectContext connectContext = new ConnectContext();
+            connectContext.setCloudCluster();
+            if (Strings.isNullOrEmpty(cloudClusterName)) {
+                connectContext.setCloudCluster();
+            } else {
+                connectContext.setCloudCluster(cloudClusterName);
+            }

Review Comment:
   whats the difference between setCloudCluster() and setCloudCluster(cluster)
   can we merge them into one method?
   if not, changing the former one to another name like chooseCloudCluster() 
may avoid the confusion



##########
fe/fe-core/src/main/java/org/apache/doris/cloud/load/loadv2/CloudBrokerLoadJob.java:
##########
@@ -0,0 +1,117 @@
+// 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.doris.cloud.load.loadv2;
+
+import org.apache.doris.analysis.BrokerDesc;
+import org.apache.doris.analysis.UserIdentity;
+import org.apache.doris.catalog.Database;
+import org.apache.doris.catalog.Env;
+import org.apache.doris.catalog.OlapTable;
+import org.apache.doris.common.MetaNotFoundException;
+import org.apache.doris.common.UserException;
+import org.apache.doris.load.BrokerFileGroup;
+import org.apache.doris.load.BrokerFileGroupAggInfo.FileGroupAggKey;
+import org.apache.doris.load.loadv2.BrokerLoadJob;
+import org.apache.doris.load.loadv2.BrokerPendingTaskAttachment;
+import org.apache.doris.load.loadv2.LoadLoadingTask;
+import org.apache.doris.qe.AutoCloseConnectContext;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.OriginStatement;
+import org.apache.doris.thrift.TUniqueId;
+
+import com.google.common.base.Strings;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.List;
+import java.util.UUID;
+
+public class CloudBrokerLoadJob extends BrokerLoadJob {
+    private static final Logger LOG = 
LogManager.getLogger(CloudBrokerLoadJob.class);
+
+    protected static final String CLUSTER_ID = "clusterId";
+    protected String clusterId;
+
+    public CloudBrokerLoadJob() {
+        super();

Review Comment:
   this call is redundant



##########
fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java:
##########
@@ -1044,6 +1047,33 @@ public String getCloudCluster() {
         return cloudCluster;
     }
 
+    public void setCloudCluster() {

Review Comment:
   pls add some commment here to desc what is going on



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to