Skip to content

Commit

Permalink
feat: rename userCreatorEngineTypeLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
lenoxzhao committed Sep 20, 2023
1 parent 186acc0 commit 70112a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ public class LabelManagerConf {
CommonVars.apply("wds.linkis.label.node.long.lived.label.keys", "tenant").getValue();

public static final boolean COMBINED_WITHOUT_YARN_DEFAULT =
CommonVars.apply("wds.linkis.combined.without.yarn.default", true).getValue();
CommonVars.apply("linkis.combined.without.yarn.default", true).getValue();
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public ResultResource requestResource(List<Label<?>> labels, NodeResource resour

List<PersistenceLock> persistenceLocks = new ArrayList<>();
EMInstanceLabel emInstanceLabel = labelContainer.getEMInstanceLabel();
CombinedLabel userCreatorEngineTypeLabel = labelContainer.getCombinedResourceLabel();
CombinedLabel combinedLabel = labelContainer.getCombinedResourceLabel();

try {
// check ecm resource if not enough return
Expand All @@ -265,14 +265,12 @@ public ResultResource requestResource(List<Label<?>> labels, NodeResource resour

// lock userCreatorEngineTypeLabel
persistenceLocks.add(
tryLockOneLabel(
userCreatorEngineTypeLabel, wait, labelContainer.getUserCreatorLabel().getUser()));
tryLockOneLabel(combinedLabel, wait, labelContainer.getUserCreatorLabel().getUser()));
try {
labelContainer.setCurrentLabel(userCreatorEngineTypeLabel);
labelContainer.setCurrentLabel(combinedLabel);
if (!requestResourceService.canRequest(labelContainer, resource)) {
return new NotEnoughResource(
String.format(
"Labels:%s not enough resource", userCreatorEngineTypeLabel.getStringValue()));
String.format("Labels:%s not enough resource", combinedLabel.getStringValue()));
}
} catch (RMWarnException exception) {
return new NotEnoughResource(exception.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ public void recordUserResourceAction(
if (RMUtils.RM_RESOURCE_ACTION_RECORD.getValue()) {
LinkisUtils.tryAndWarn(
() -> {
CombinedLabel userCreatorEngineType = labelContainer.getCombinedResourceLabel();
CombinedLabel combinedLabel = labelContainer.getCombinedResourceLabel();
EngineInstanceLabel engineInstanceLabel = labelContainer.getEngineInstanceLabel();
EMInstanceLabel eMInstanceLabel = labelContainer.getEMInstanceLabel();
if (userCreatorEngineType == null) {
if (combinedLabel == null) {
return;
}
ECResourceInfoRecord ecResourceInfoRecord =
Expand All @@ -170,11 +170,7 @@ public void recordUserResourceAction(
: "";
ecResourceInfoRecord =
new ECResourceInfoRecord(
userCreatorEngineType.getStringValue(),
user,
ticketId,
resource,
logDirSuffix);
combinedLabel.getStringValue(), user, ticketId, resource, logDirSuffix);
ecResourceRecordMapper.insertECResourceInfoRecord(ecResourceInfoRecord);
}
if (engineInstanceLabel != null) {
Expand Down

0 comments on commit 70112a8

Please sign in to comment.