-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[STORM-2201] Add dynamic scheduler configuration loading. #1785
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| title: IConfigLoader | ||
| layout: documentation | ||
| documentation: true | ||
| --- | ||
|
|
||
|
|
||
| ### Introduction | ||
| IConfigLoader is an interface designed to allow dynamic loading of scheduler resource constraints. Currently, the MultiTenant scheduler uses this interface to dynamically load the number of isolated nodes a given user has been guaranteed, and the ResoureAwareScheduler uses the interface to dynamically load per user resource guarantees. | ||
|
|
||
| ------ | ||
|
|
||
| ### Interface | ||
| ``` | ||
| public interface IConfigLoader { | ||
| void prepare(Map<String, Object> conf); | ||
| Map<?,?> load(); | ||
| public static IConfigLoader getConfigLoader(Map conf, String loaderClassConfig, String loaderConfConfig); | ||
| public static Map<?,?> loadYamlConfigFromFile(File file); | ||
| }; | ||
| ``` | ||
| #### Description | ||
| - prepare is called upon class loading, and allows schedulers to pass in configuation items to the classes that implement IConfigLoader | ||
| - load is called by the scheduler whenever it wishes to retrieve the most recent configuration map | ||
| - getConfigLoader is a static helper class that will return the implementation of IConfigLoader that the scheduler requests | ||
| - loadYamlConfigFromFile is a utility function used by implemenations of IConfigLoader that will load in a local yaml file and return a map | ||
|
|
||
| #### Loader Configuration | ||
| The loaders are dynamically selected and dynamically configured through configuration items in the scheduler implementations. | ||
|
|
||
| ##### Example | ||
| ``` | ||
| resource.aware.scheduler.user.pools.loader: "org.apache.storm.scheduler.utils.ArtifactoryConfigLoader" | ||
| resource.aware.scheduler.user.pools.loader.params: | ||
| artifactory.config.loader.uri: "http://artifactory.my.company.com:8000/artifactory/configurations/clusters/my_cluster/ras_pools" | ||
| artifactory.config.loader.timeout.secs: "30" | ||
| multitenant.scheduler.user.pools.loader: "org.apache.storm.scheduler.utils.FileConfigLoader" | ||
| multitenant.scheduler.user.pools.loader.params: | ||
| file.config.loader.local.file.yaml: "/path/to/my/config.yaml" | ||
| ``` | ||
| ### Implementations | ||
|
|
||
| There are currently two implemenations of IConfigLoader | ||
| - org.apache.storm.scheduler.utils.ArtifactoryConfigLoader: Load configurations from an Artifactory server | ||
| - org.apache.storm.scheduler.utils.FileConfigLoader: Load configurations from a local file | ||
|
|
||
| Each of these have configurations that the scheduler can pass into the implemenation when the prepare method is called | ||
|
|
||
| #### FileConfigLoader | ||
| - file.config.loader.local.file.yaml: A path to a local yaml file that represents the map the scheduler will use | ||
|
|
||
| #### ArtifactoryConfigLoader | ||
|
|
||
| - artifactory.config.loader.uri: This can either be a reference to an individual file in Artifactory or to a directory. If it is a directory, the file with the largest lexographic name will be returned. | ||
| - artifactory.config.loader.timeout.secs: This is the amount of time an http connection to the artifactory server will wait before timing out. The default is 10. | ||
| - artifactory.config.loader.polltime.secs: This is the frequency at which the plugin will call out to artifactory instead of returning the most recently cached result. The default is 600 seconds. | ||
| - artifactory.config.loader.scheme: This is the scheme to use when connecting to the Artifactory server. The default is http. | ||
| - artifactory.config.loader.base.directory: This is the part of the uri, configurable in Artifactory, which represents the top of the directory tree. It defaults to "/artifactory". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch