Skip to content

[Issue-2299] Support the yarn queue label quick-setting for yarn application mode. #2317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 16, 2023
Merged

[Issue-2299] Support the yarn queue label quick-setting for yarn application mode. #2317

merged 9 commits into from
Feb 16, 2023

Conversation

RocMarshal
Copy link
Contributor

What changes were proposed in this pull request

Issue Number: close #2299

Brief change log

Support the yarn queue label quick-setting for yarn application mode.

Verifying this change

  • Add some unit test cases.
  • Manually verified the change by testing locally.

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): (yes / no)

@RocMarshal RocMarshal marked this pull request as draft February 11, 2023 12:07
@RocMarshal RocMarshal marked this pull request as ready for review February 11, 2023 13:23
@wolfboys
Copy link
Member

good job, Thanks for your contribution, I will review it later

@RocMarshal
Copy link
Contributor Author

good job, Thanks for your contribution, I will review it later

Thank you @wolfboys . ping me if anything you need to communicate about .

@RocMarshal
Copy link
Contributor Author

Hi, @wolfboys I added the note hints to the corresponding input, PTAL.
Thx~!

/** Util class for parsing and checking Yarn queue & Label */
public class YarnQueueLabelExpression {

public static final String AT = "@";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private is better.


public static final String AT = "@";

public static final String REGEX = "[a-zA-Z0-9_\\-]+";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private...

* @param executionMode execution mode.
* @param queueLabel queueLabel expression.
*/
public static void checkQueueLabelIfNeed(int executionMode, String queueLabel) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about?

 public static void checkQueueLabelIfNeed(int executionMode, String queueLabel) {
    if (ExecutionMode.isYarnMode(executionMode)) {
        if (!YarnQueueLabelExpression.isValid(queueLabel, true)) {
            throw new IllegalArgumentException(ERR_HINTS);
        }
    }
  }

* @param queueLabelExp queue and label expression
* @param map the target properties.
*/
public static <V> void addQueueLabelExprInto(String queueLabelExp, @Nonnull Map<String, V> map) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass in a Map for filling. Not a good way, how about ?

public static Map<String, String> getQueueLabelMap(String queueLabelExp) {
    if (StringUtils.isEmpty(queueLabelExp)) {
      return Collections.emptyMap();
    }
    YarnQueueLabelExpression yarnQueueLabelExpression = of(queueLabelExp);
    Map<String, String> map = new HashMap<>(2);
    yarnQueueLabelExpression
        .getLabelExpression()
        .ifPresent(labelExp -> map.put(ConfigConst.KEY_YARN_APP_NODE_LABEL(), labelExp));
    map.put(ConfigConst.KEY_YARN_APP_QUEUE(), yarnQueueLabelExpression.queue);
    return map;
  }

Also I don't know if both "KEY_YARN_APP_NODE_LABEL" and "KEY_YARN_APP_QUEUE" need to put

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the label or queue exists, the corresponding value would be put.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the label or queue exists, the corresponding value would be put.

get it

@@ -598,9 +598,7 @@ public void updateHotParams(Application appParam) {
ExecutionMode executionModeEnum = appParam.getExecutionModeEnum();
Map<String, String> hotParams = new HashMap<>(0);
if (ExecutionMode.YARN_APPLICATION.equals(executionModeEnum)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ExecutionMode.YARN_APPLICATION.equals(executionModeEnum) need to be changed to:
ExecutionMode.isYarnMode(executionModeEnum) This is a historical bug

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, yarn-session execmode does not need to be set yarn queue, yarn-perjob is deprecated, but there should be many users who use, so. yarn-application and yarn-perjob need to be set yarn-queue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn-application and yarn-perjob need to be set yarn-queue

that's okay.

@RocMarshal RocMarshal requested a review from wolfboys February 15, 2023 12:24
}
}
}
fillBackYarnQueue(application);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method name : fillBackYarnQueue, how about change to setYarnQueue?

Copy link
Member

@wolfboys wolfboys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution

@wolfboys wolfboys merged commit 02da4c3 into apache:dev Feb 16, 2023
saLeox pushed a commit to saLeox/incubator-streampark that referenced this pull request Feb 28, 2023
…ication mode. (apache#2317)

* [Issue-2299] Introduce YarnQueueLabelExpression util class
* [Issue-2299] Adapt the FE pages input placeholders
* [Issue-2299] Adjust the backend logic to process label quick-setting
* [Issue-2299] Support yarn session cluster queue label quick-setting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Support yarn label quick-set for yarn-application execution mode.
2 participants