Skip to content

Add ExtensionsConfig.excludeModules#4438

Merged
fjy merged 6 commits intoapache:masterfrom
metamx:exclude-extension-modules
Jun 28, 2017
Merged

Add ExtensionsConfig.excludeModules#4438
fjy merged 6 commits intoapache:masterfrom
metamx:exclude-extension-modules

Conversation

@leventov
Copy link
Copy Markdown
Member

Add ability to exclude module classes from extensions.

@leventov leventov modified the milestones: 0.10.2, 0.11.0 Jun 24, 2017
"Extension module [%s] was ignored because it doesn't have a canonical name, is it a local or anonymous class?",
module.getClass().getName()
);
} else if (config.getExcludeModules().contains(moduleName)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would it make sense to extend this functionality with an ability to exclude modules on the package level (or by regex) instead of explicitly enumerate all of them by class name?

Copy link
Copy Markdown
Member Author

@leventov leventov Jun 26, 2017

Choose a reason for hiding this comment

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

I don't want to do this for a number of reasons:

  • First of all, we don't need it
  • It's more complex and raises small issues on implementation level, e. g. for regex you need to recognize package dots which are not regex dots
  • List of class names is the type of property which is already used in Druid, don't want to add more types like regexes, glob patterns, etc.
  • If somebody want to exclude many modules from some extension, likely it's a better idea to extract those modules into a separate extension and simply not add this new extension to the loadList.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Keeping the same behavior as loadList is best, IMO.

Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

Looks useful. Had just one suggestion, about the property naming. Rest LGTM.

Comment thread docs/content/configuration/index.md Outdated
|`druid.extensions.directory`|The root extension directory where user can put extensions related files. Druid will load extensions stored under this directory.|`extensions` (This is a relative path to Druid's working directory)|
|`druid.extensions.hadoopDependenciesDir`|The root hadoop dependencies directory where user can put hadoop related dependencies files. Druid will load the dependencies based on the hadoop coordinate specified in the hadoop index task.|`hadoop-dependencies` (This is a relative path to Druid's working directory|
|`druid.extensions.loadList`|A JSON array of extensions to load from extension directories by Druid. If it is not specified, its value will be `null` and Druid will load all the extensions under `druid.extensions.directory`. If its value is empty list `[]`, then no extensions will be loaded at all. It is also allowed to specify absolute path of other custom extensions not stored in the common extensions directory.|null|
|`druid.extensions.excludeModules`|A JSON array of canonical class names (e. g. `"io.druid.somepackage.SomeClass"`) of modules, which shouldn't be loaded, despite they are found in the `loadList`. Useful when some useful extension contains some module, which shouldn't be loaded on some Druid node type because of some dependencies of that module couldn't be satisfied.|[]|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

druid.extensions.excludeList for symmetry with loadList?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Direct symmetry between loadList and excludeList could be confusing because loadList is a list of extension names, while excludeList is a list of class names. Renamed to moduleExcludeList.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, I see. In that case, could you please change the wording of of this part:

modules, which shouldn't be loaded, despite they are found in the loadList

It makes it sound like the things in moduleExcludeList are the same kind of things as found in loadList. That's what confused me. Perhaps wording like this would be clearer.

A JSON array of canonical class names (e. g. "io.druid.somepackage.SomeClass") of module classes which shouldn't be loaded, even if they are found in extensions specified by druid.extensions.loadList.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@gianm changed.

I also changed return types of getFromExtensions() and getLoadedModules() and renamed getLoadedModules() to getLoadedImplementations(), assuming Initialization is not a public API.

Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

👍 after CI passes.

@fjy fjy merged commit 6173570 into apache:master Jun 28, 2017
@leventov leventov deleted the exclude-extension-modules branch June 28, 2017 21:02
leventov added a commit to metamx/druid that referenced this pull request Jun 28, 2017
* Add ExtensionsConfig.excludeModules

* Add branch

* Refactor Initialization.getFromExtensions()

* excludeModules -> moduleExcludeList

* Initialization.getFromExtensions() and getLoadedModules() should return Collection, not Set

* Fix doc
gianm pushed a commit that referenced this pull request Jun 29, 2017
* Add ExtensionsConfig.excludeModules

* Add branch

* Refactor Initialization.getFromExtensions()

* excludeModules -> moduleExcludeList

* Initialization.getFromExtensions() and getLoadedModules() should return Collection, not Set

* Fix doc
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.

4 participants