Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Change YarnKeys to enum #1707

Merged
merged 4 commits into from
Feb 16, 2017
Merged

Conversation

mycFelix
Copy link
Contributor

Not sure if necessary. As PR #1693 refactored, I'm doing the same thing on YARN-Scheduler, replacing Yarn config key from STATIC STRING to ENUM.

The key changes are following:

  • adding YarnKey class
  • using ENUM in YarnContext class
  • using ENUM in YarnLauncherTest

cc @billonahill @ashvina

@objmagic objmagic requested a review from billonahill February 13, 2017 03:36
Copy link
Contributor

@billonahill billonahill left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on. This is a nice improvement.

// yarn queue for submitting and launching the topology
HERON_SCHEDULER_YARN_QUEUE("heron.scheduler.yarn.queue", "default"),
// the amount of memory topology's driver (yarn application master) needs
YARN_SCHEDULER_DRIVER_MEMORY_MB("heron.scheduler.yarn.driver.memory.mb", 2048);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of using int, can we change this to ByteAmount and drop '.mb' from the key value (see https://github.com/twitter/heron/blob/master/heron/spi/src/java/com/twitter/heron/spi/common/Key.java#L104)? We could then use ByteAmount everywhere and then call asMegabytes before adding it to the yarn config, which I suspect requires MBs.

If this would trigger a large refactor, I'm fine with shipping this as-is and following up with the ByteAmount change in it's own PR.

Copy link
Contributor Author

@mycFelix mycFelix Feb 14, 2017

Choose a reason for hiding this comment

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

@billonahill - Thanks for reviewing. It will be great if we change driver.memory.mb from int to ByteAmount. I would like to send another PR for this. BTW, dropping '.mb' might be not good for users cause they need to know the unit of this parameter.

@objmagic objmagic merged commit 10b9612 into apache:master Feb 16, 2017
@mycFelix mycFelix deleted the change-yarn-context-to-enum branch February 20, 2017 01:15
@huijunw huijunw added the Yarn label Jul 23, 2017
nicknezis pushed a commit that referenced this pull request Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants