Skip to content
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

Simplify custom repository type setup #12948

Merged
merged 3 commits into from
Aug 18, 2015
Merged

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Aug 17, 2015

Custom repository types are registered through the RepositoriesModule.
Later, when a specific repository type is used, the RespositoryModule
is installed, which in turn would spawn the module that was
registered for that repository type. However, a module is not needed
here. Each repository type has two associated classes, a Repository and
an IndexShardRepository.

This change makes the registration method for custom repository
types take both of these classes, instead of a module.

See #12783.

Custom repository types are registered through the RepositoriesModule.
Later, when a specific repository type is used, the RespositoryModule
is installed, which in turn would spawn the module that was
registered for that repository type. However, a module is not needed
here. Each repository type has two associated classes, a Repository and
an IndexShardRepository.

This change makes the registration method for custom repository
types take both of these classes, instead of a module.

See elastic#12783.
@rjernst rjernst changed the title Internal: Simplify custom repository type setup Simplify custom repository type setup Aug 17, 2015
@jpountz
Copy link
Contributor

jpountz commented Aug 18, 2015

LGTM. I like how this removes one level of indirection in the modules.

*/
public Class<? extends Module> type(String type) {
return repositoryTypes.get(type);
public void bindType(Binder binder, String type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add javadocs to bindType and registerRepository?

rjernst added a commit that referenced this pull request Aug 18, 2015
Simplify custom repository type setup
@rjernst rjernst merged commit 7db253b into elastic:master Aug 18, 2015
@rjernst rjernst deleted the module_culling3 branch August 18, 2015 17:18
rjernst added a commit that referenced this pull request Aug 19, 2015
Custom repository types are registered through the RepositoriesModule.
Later, when a specific repository type is used, the RespositoryModule
is installed, which in turn would spawn the module that was
registered for that repository type. However, a module is not needed
here. Each repository type has two associated classes, a Repository and
an IndexShardRepository.

This change makes the registration method for custom repository
types take both of these classes, instead of a module.

See #12783.

Backport of #12948.
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.

2 participants