Skip to content

Commit

Permalink
BrokerServiceModule.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekrb19 committed Oct 16, 2024
1 parent 8a0d660 commit 23d73de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions services/src/main/java/org/apache/druid/cli/CliOverlord.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
import org.apache.druid.server.security.AuthenticationUtils;
import org.apache.druid.server.security.Authenticator;
import org.apache.druid.server.security.AuthenticatorMapper;
import org.apache.druid.sql.guice.SqlServiceModule;
import org.apache.druid.sql.guice.BrokerServiceModule;
import org.apache.druid.tasklogs.TaskLogStreamer;
import org.apache.druid.tasklogs.TaskLogs;
import org.eclipse.jetty.rewrite.handler.RewriteHandler;
Expand Down Expand Up @@ -462,7 +462,7 @@ private void configureOverlordHelpers(Binder binder)
new SupervisorModule(),
new LookupSerdeModule(),
new SamplerModule(),
new SqlServiceModule()
new BrokerServiceModule()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@
import org.apache.druid.sql.client.BrokerClient;
import org.apache.druid.sql.client.BrokerClientImpl;

public class SqlServiceModule extends ServiceClientModule
/**
* This is an extension of {@link ServiceClientModule} because of module dependencies.
* The {@link BrokerClientImpl} requires classes present in the sql module.
*/
public class BrokerServiceModule extends ServiceClientModule
{
@Provides
@ManageLifecycle
@Broker
public ServiceLocator makeSqlBrokerServiceLocator(final DruidNodeDiscoveryProvider discoveryProvider)
public ServiceLocator makeBrokerServiceLocator(final DruidNodeDiscoveryProvider discoveryProvider)
{
return new DiscoveryServiceLocator(discoveryProvider, NodeRole.BROKER);
}

@Provides
@LazySingleton
public BrokerClient makeSqlBrokerClient(
public BrokerClient makeBrokerClient(
@Json final ObjectMapper jsonMapper,
@EscalatedGlobal final ServiceClientFactory clientFactory,
@Broker final ServiceLocator serviceLocator
Expand Down

0 comments on commit 23d73de

Please sign in to comment.