yiguolei commented on code in PR #49884:
URL: https://github.com/apache/doris/pull/49884#discussion_r2052172329
##########
fe/fe-core/src/main/java/org/apache/doris/load/routineload/KafkaTaskInfo.java:
##########
@@ -138,21 +145,40 @@ private TPipelineFragmentParams rePlan(RoutineLoadJob
routineLoadJob) throws Use
tPlanFragment.getOutputSink().getOlapTableSink().setTxnId(txnId);
if (Config.enable_workload_group) {
- long wgId = routineLoadJob.getWorkloadId();
- List<TPipelineWorkloadGroup> tWgList = new ArrayList<>();
- if (wgId > 0) {
- tWgList = Env.getCurrentEnv().getWorkloadGroupMgr()
- .getTWorkloadGroupById(wgId);
- if (tWgList.size() == 0) {
- throw new UserException("can not find workload group, id="
+ wgId);
+ try {
+ long wgId = routineLoadJob.getWorkloadId();
+ List<TPipelineWorkloadGroup> tWgList = new ArrayList<>();
+ if (wgId > 0) {
+ tWgList = Env.getCurrentEnv().getWorkloadGroupMgr()
+ .getTWorkloadGroupById(wgId);
+ if (tWgList.size() == 0) {
+ throw new UserException("Can not find workload group,
id=" + wgId);
+ }
+ } else {
+ ConnectContext tmpContext = new ConnectContext();
+ if (Config.isCloudMode()) {
+ String clusterName = ((CloudSystemInfoService)
Env.getCurrentSystemInfo())
+
.getClusterNameByClusterId(routineLoadJob.getCloudClusterId());
+ if (Strings.isNullOrEmpty(clusterName)) {
+ String err = String.format("cluster name is empty,
cluster id is %s",
+ routineLoadJob.getCloudClusterId());
+ LOG.warn(err);
+ throw new UserException(err);
+ }
+ tmpContext.setCloudCluster(clusterName);
+ }
+
tmpContext.setCurrentUserIdentity(routineLoadJob.getUserIdentity());
+
tmpContext.setQualifiedUser(routineLoadJob.getUserIdentity().getQualifiedUser());
+ tWgList =
Env.getCurrentEnv().getWorkloadGroupMgr().getWorkloadGroup(tmpContext);
}
- } else {
- tWgList = Env.getCurrentEnv().getWorkloadGroupMgr()
-
.getWorkloadGroupByUser(routineLoadJob.getUserIdentity(), false);
- }
- if (tWgList.size() != 0) {
- tExecPlanFragmentParams.setWorkloadGroups(tWgList);
+ if (tWgList.size() != 0) {
+ tExecPlanFragmentParams.setWorkloadGroups(tWgList);
Review Comment:
为啥是list?
--
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]