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

[CDAP-21096] Parametrize the AppFabricServiceRuntimeModule #15799

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.cdap.cdap.app.DefaultAppConfigurer;
import io.cdap.cdap.app.DefaultApplicationContext;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule.ServiceType;
import io.cdap.cdap.app.guice.AuthorizationModule;
import io.cdap.cdap.app.guice.ProgramRunnerRuntimeModule;
import io.cdap.cdap.app.guice.TwillModule;
Expand Down Expand Up @@ -69,6 +70,7 @@
import io.cdap.cdap.security.guice.SecureStoreServerModule;
import java.io.IOException;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.apache.twill.api.Configs;
Expand Down Expand Up @@ -289,7 +291,8 @@ private static ProgramRunnerFactory createProgramRunnerFactory(CConfiguration cC
new AuthorizationModule(),
new AuthorizationEnforcementModule().getMasterModule(),
new TwillModule(),
new AppFabricServiceRuntimeModule(cConf).getDistributedModules(),
new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getDistributedModules(),
new ProgramRunnerRuntimeModule().getDistributedModules(),
new SecureStoreServerModule(),
new OperationalStatsModule(),
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import io.cdap.cdap.api.artifact.ArtifactManager;
import io.cdap.cdap.api.metrics.MetricsCollectionService;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule.ServiceType;
import io.cdap.cdap.app.guice.AuditLogWriterModule;
import io.cdap.cdap.app.guice.AuthorizationModule;
import io.cdap.cdap.app.guice.DistributedArtifactManagerModule;
Expand Down Expand Up @@ -91,6 +92,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -156,7 +158,8 @@ protected void bindKeyManager(Binder binder) {
new AuthorizationModule(),
new AuthorizationEnforcementModule().getMasterModule(),
new AuditLogWriterModule(cConf).getDistributedModules(),
Modules.override(new AppFabricServiceRuntimeModule(cConf).getDistributedModules())
Modules.override(new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getDistributedModules())
.with(new AbstractModule() {
// To enable localisation of artifacts
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ protected void configure() {
install(RemoteAuthenticatorModules.getNoOpModule());
install(new IOModule());
install(new InMemoryDiscoveryModule());
install(new AppFabricServiceRuntimeModule(cConf).getInMemoryModules());
install(new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getInMemoryModules());
install(new MonitorHandlerModule(false, cConf));
install(new ProgramRunnerRuntimeModule().getInMemoryModules());
install(new NonCustomLocationUnitTestModule());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ protected void configure() {
new AuthorizationModule(),
new AuthorizationEnforcementModule().getMasterModule(),
new TwillModule(),
new AppFabricServiceRuntimeModule(cConf).getDistributedModules(),
new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getDistributedModules(),
new MonitorHandlerModule(true, cConf),
new ProgramRunnerRuntimeModule().getDistributedModules(),
new SecureStoreServerModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import io.cdap.cdap.api.dataset.lib.CloseableIterator;
import io.cdap.cdap.api.schedule.Trigger;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule.ServiceType;
import io.cdap.cdap.app.guice.AuthorizationModule;
import io.cdap.cdap.app.guice.ProgramRunnerRuntimeModule;
import io.cdap.cdap.app.guice.TwillModule;
Expand Down Expand Up @@ -73,6 +74,7 @@
import io.cdap.cdap.spi.data.transaction.TransactionRunner;
import io.cdap.cdap.spi.data.transaction.TransactionRunners;
import java.io.IOException;
import java.util.EnumSet;
import java.util.List;
import javax.annotation.Nullable;
import org.apache.commons.cli.BasicParser;
Expand Down Expand Up @@ -346,7 +348,8 @@ private static Injector createInjector() throws Exception {
new TwillModule(),
new DataFabricModules().getDistributedModules(),
new DataSetsModules().getDistributedModules(),
new AppFabricServiceRuntimeModule(cConf).getDistributedModules(),
new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getDistributedModules(),
new ProgramRunnerRuntimeModule().getDistributedModules(),
new SystemDatasetRuntimeModule().getDistributedModules(),
new KafkaLogAppenderModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.inject.Scopes;
import com.google.inject.util.Modules;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule.ServiceType;
import io.cdap.cdap.app.guice.AuthorizationModule;
import io.cdap.cdap.app.guice.MonitorHandlerModule;
import io.cdap.cdap.app.guice.ProgramRunnerRuntimeModule;
Expand Down Expand Up @@ -65,6 +66,7 @@
import io.cdap.cdap.security.guice.SecureStoreServerModule;
import io.cdap.cdap.security.store.SecureStoreService;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -98,7 +100,8 @@ protected List<Module> getServiceModules(MasterEnvironment masterEnv,
new AuditModule(),
new AuthorizationModule(),
new AuthorizationEnforcementModule().getMasterModule(),
Modules.override(new AppFabricServiceRuntimeModule(cConf).getDistributedModules())
Modules.override(new AppFabricServiceRuntimeModule(cConf, ServiceType.PROCESSOR)
.getDistributedModules())
.with(new AbstractModule() {
@Override
protected void configure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.inject.Scopes;
import com.google.inject.util.Modules;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule.ServiceType;
import io.cdap.cdap.app.guice.AuthorizationModule;
import io.cdap.cdap.app.guice.MonitorHandlerModule;
import io.cdap.cdap.app.guice.ProgramRunnerRuntimeModule;
Expand Down Expand Up @@ -65,6 +66,7 @@
import io.cdap.cdap.security.guice.SecureStoreServerModule;
import io.cdap.cdap.security.store.SecureStoreService;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -98,7 +100,7 @@ protected List<Module> getServiceModules(MasterEnvironment masterEnv,
new AuditModule(),
new AuthorizationModule(),
new AuthorizationEnforcementModule().getMasterModule(),
Modules.override(new AppFabricServiceRuntimeModule(cConf).getDistributedModules())
Modules.override(new AppFabricServiceRuntimeModule(cConf, ServiceType.SERVER).getDistributedModules())
.with(new AbstractModule() {
@Override
protected void configure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.inject.Module;
import com.google.inject.Scopes;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule;
import io.cdap.cdap.app.guice.AppFabricServiceRuntimeModule.ServiceType;
import io.cdap.cdap.app.guice.AuthorizationModule;
import io.cdap.cdap.app.guice.ProgramRunnerRuntimeModule;
import io.cdap.cdap.app.preview.PreviewHttpServer;
Expand All @@ -51,6 +52,7 @@
import io.cdap.cdap.security.guice.SecureStoreClientModule;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -98,7 +100,7 @@ protected List<Module> getServiceModules(MasterEnvironment masterEnv,
List<Module> modules = new ArrayList<>(Arrays.asList(
new DataSetServiceModules().getStandaloneModules(),
new DataSetsModules().getStandaloneModules(),
new AppFabricServiceRuntimeModule(cConf).getStandaloneModules(),
new AppFabricServiceRuntimeModule(cConf, ServiceType.SERVER).getStandaloneModules(),
new ProgramRunnerRuntimeModule().getStandaloneModules(),
new MetricsStoreModule(),
new MessagingServiceModule(cConf),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
import io.cdap.cdap.logging.guice.LogQueryRuntimeModule;
import io.cdap.cdap.logging.guice.LogReaderRuntimeModules;
import io.cdap.cdap.logging.service.LogQueryService;
import io.cdap.cdap.messaging.spi.MessagingService;
import io.cdap.cdap.messaging.guice.MessagingServerRuntimeModule;
import io.cdap.cdap.messaging.server.MessagingHttpService;
import io.cdap.cdap.messaging.spi.MessagingService;
import io.cdap.cdap.metadata.MetadataReaderWriterModules;
import io.cdap.cdap.metadata.MetadataService;
import io.cdap.cdap.metadata.MetadataServiceModule;
Expand Down Expand Up @@ -564,7 +564,8 @@ private static List<Module> createPersistentModules(CConfiguration cConf, Config
new PreviewManagerModule(false),
new PreviewRunnerManagerModule().getStandaloneModules(),
new MessagingServerRuntimeModule().getStandaloneModules(),
new AppFabricServiceRuntimeModule(cConf).getStandaloneModules(),
new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getStandaloneModules(),
new MonitorHandlerModule(false, cConf),
new RuntimeServerModule(),
new OperationalStatsModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ protected void configure() {
install(RemoteAuthenticatorModules.getNoOpModule());
install(new IOModule());
install(new InMemoryDiscoveryModule());
install(new AppFabricServiceRuntimeModule(cConf).getInMemoryModules());
install(new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getInMemoryModules());
install(new MonitorHandlerModule(false, cConf));
install(new ProgramRunnerRuntimeModule().getInMemoryModules());
install(new NonCustomLocationUnitTestModule());
Expand Down
3 changes: 2 additions & 1 deletion cdap-unit-test/src/main/java/io/cdap/cdap/test/TestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ public static void initialize() throws Exception {
new IOModule(),
new LocalLocationModule(),
new InMemoryDiscoveryModule(),
new AppFabricServiceRuntimeModule(cConf).getInMemoryModules(),
new AppFabricServiceRuntimeModule(cConf, AppFabricServiceRuntimeModule.ALL_SERVICE_TYPES)
.getInMemoryModules(),
new MonitorHandlerModule(false, cConf),
new AuthenticationContextModules().getMasterModule(),
new AuthorizationModule(),
Expand Down
Loading