Only bind index {start/activate} if needed
These commands are only interacting with the AbstractVersionManager, if it is not available then they have no reason to be available. Because those commands were always binded, binding an implementation of AbstractVersionManager was mandatory otherwise Guice would have complained. For that reason, the implementation of AbstractVersionManager was done even in the case when index is a single version and an implementation of AbstractVersionManager is not required. Only bind implementations of AbstractVersionManager when needed and bind the commands only if AbstractVersionManager implementation is binded. Change-Id: I3db48f6b5d030ecc6efa840c59eb4e177ae1b6b1
This commit is contained in:
@@ -64,11 +64,11 @@ public class ElasticIndexModule extends LifecycleModule {
|
||||
|
||||
install(new IndexModule(threads));
|
||||
if (singleVersions == null) {
|
||||
bind(AbstractVersionManager.class).to(ElasticVersionManager.class);
|
||||
listener().to(ElasticVersionManager.class);
|
||||
} else {
|
||||
install(new SingleVersionModule(singleVersions));
|
||||
}
|
||||
bind(AbstractVersionManager.class).to(ElasticVersionManager.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
Reference in New Issue
Block a user