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

Change AuroraController to an interface #1672

Merged

Conversation

billonahill
Copy link
Contributor

The current implementation of AuroraController shells out to the aurora cli and is intended to be run locally by a developer. Other implementations might call the aurora scheduler service directly. Changing AuroraController to be an interface allows other implementations to be used by AuroraScheduler.

The diff makes things appear messier than they are but basically AuroraController was renamed to AuroraCLIController and a new AuroraController interface was added.

@billonahill billonahill added this to the 0.14.6 milestone Jan 19, 2017
@billonahill billonahill self-assigned this Jan 19, 2017
Copy link
Contributor

@objmagic objmagic left a comment

Choose a reason for hiding this comment

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

LGTM except a minor comment

auroraCmd.add("--batch-size");
auroraCmd.add(Integer.toString(Integer.MAX_VALUE));
}
boolean createJob(String auroraFilename, Map<String, String> bindings);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add some documentation here? What is bindings here? I need to read aurora job create -h to know what it is. Considering this is an argument of an interface function, I think it is necessary to add some docs here.

Copy link
Contributor Author

@billonahill billonahill Jan 19, 2017

Choose a reason for hiding this comment

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

Good catch. I refactored createJob to remove the auroraFilename, which only applies to the CLI impl. I also renamed bindings to auroraProperties and changed the key from a string to an enum to make it's usage clear.

@objmagic I was in the process of making add'l edits when you gave your ship it. Would you please take a quick look again. I'm done making changes.

boolean restartJob(int containerId);

/**
* Restarts a given container, or the entire job if containerId is null
Copy link
Contributor

@objmagic objmagic Jan 19, 2017

Choose a reason for hiding this comment

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

when containerId is -1, the entire job will also be restarted according to here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although not the preferred approach I kept that for backward compatibility, but there's no need to do that since the code will all change in lock step. I've made the change to match behavior to docs.

@objmagic
Copy link
Contributor

LGTM.

@billonahill billonahill merged commit 2af8b52 into apache:master Jan 20, 2017
@billonahill billonahill deleted the billg/aurora_controller_interface branch January 20, 2017 19:52
nicknezis pushed a commit that referenced this pull request Sep 14, 2020
* Change AuroraController to an interface
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants