Package org.apache.druid.initialization
Class ServerInjectorBuilder
java.lang.Object
org.apache.druid.initialization.ServerInjectorBuilder
Initialize Guice for a server. Clients and tests should use
the individual builders to create a non-server environment.
This class is in this package for historical reasons. The proper
place is in the same module as GuiceRunnable since this
class should only ever be used by servers. It is here until
tests are converted to use the builders, and @{link Initialization}
is deleted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.inject.Injectorbuild()static com.google.inject.InjectormakeServerInjector(com.google.inject.Injector baseInjector, Set<NodeRole> nodeRoles, Iterable<? extends com.google.inject.Module> modules) Create a server injector.static com.google.inject.ModuleregisterNodeRoleModule(Set<NodeRole> nodeRoles) serviceModules(Iterable<? extends com.google.inject.Module> modules)
-
Constructor Details
-
ServerInjectorBuilder
public ServerInjectorBuilder(com.google.inject.Injector baseInjector)
-
-
Method Details
-
makeServerInjector
public static com.google.inject.Injector makeServerInjector(com.google.inject.Injector baseInjector, Set<NodeRole> nodeRoles, Iterable<? extends com.google.inject.Module> modules) Create a server injector. Located here for testing. Should only be used byGuiceRunnable(and tests).- Parameters:
nodeRoles- the roles which this server providesbaseInjector- the startup injectormodules- modules for this server- Returns:
- the injector for the server
-
nodeRoles
-
serviceModules
-
build
public com.google.inject.Injector build() -
registerNodeRoleModule
-