Skip to content

Commit

Permalink
[CDAP-21096] Keep TaskWorkerServiceLauncher, SystemWorkerServiceLaunc…
Browse files Browse the repository at this point in the history
…her, CoreSchedulerService, Schedule HTTP handlers in Appfabric Processor

Move scheduler services and http handler to appfabric processor

Add max retry count in Provisioning service
  • Loading branch information
vsethi09 committed Feb 4, 2025
1 parent ac94686 commit 4e6f294
Show file tree
Hide file tree
Showing 11 changed files with 914 additions and 720 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import io.cdap.cdap.gateway.handlers.ProgramLifecycleHttpHandler;
import io.cdap.cdap.gateway.handlers.ProgramLifecycleHttpHandlerInternal;
import io.cdap.cdap.gateway.handlers.ProgramRuntimeHttpHandler;
import io.cdap.cdap.gateway.handlers.ProgramScheduleHttpHandler;
import io.cdap.cdap.gateway.handlers.ProvisionerHttpHandler;
import io.cdap.cdap.gateway.handlers.SourceControlManagementHttpHandler;
import io.cdap.cdap.gateway.handlers.TransactionHttpHandler;
Expand Down Expand Up @@ -158,6 +159,7 @@
import io.cdap.cdap.metadata.PreferencesFetcher;
import io.cdap.cdap.pipeline.PipelineFactory;
import io.cdap.cdap.scheduler.CoreSchedulerService;
import io.cdap.cdap.scheduler.NoOpScheduler;
import io.cdap.cdap.scheduler.Scheduler;
import io.cdap.cdap.securestore.spi.SecretStore;
import io.cdap.cdap.security.impersonation.DefaultOwnerAdmin;
Expand Down Expand Up @@ -259,6 +261,7 @@ protected void configure() {
Multibinder<HttpHandler> handlerBinder = Multibinder.newSetBinder(
binder(), HttpHandler.class, Names.named(Constants.AppFabric.SERVER_HANDLERS_BINDING));
handlerBinder.addBinding().to(ProgramRuntimeHttpHandler.class);
handlerBinder.addBinding().to(ProgramScheduleHttpHandler.class);

// TODO: Uncomment after CDAP-7688 is resolved
// servicesNamesBinder.addBinding().toInstance(Constants.Service.MESSAGING_SERVICE);
Expand Down Expand Up @@ -458,8 +461,6 @@ protected void configure() {
bind(ProgramLifecycleService.class).in(Scopes.SINGLETON);
bind(SystemAppManagementService.class).in(Scopes.SINGLETON);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
bind(CoreSchedulerService.class).in(Scopes.SINGLETON);
bind(Scheduler.class).to(CoreSchedulerService.class);
install(new PrivateModule() {
@Override
protected void configure() {
Expand Down Expand Up @@ -556,11 +557,18 @@ protected void configure() {
}

if (serviceTypes.contains(ServiceType.PROCESSOR)) {
bind(CoreSchedulerService.class).in(Scopes.SINGLETON);
bind(Scheduler.class).to(CoreSchedulerService.class);

Multibinder<HttpHandler> processorHandlerBinder = Multibinder.newSetBinder(
binder(), HttpHandler.class, Names.named(AppFabric.PROCESSOR_HANDLERS_BINDING));
CommonHandlers.add(processorHandlerBinder);
processorHandlerBinder.addBinding().to(ProgramRuntimeHttpHandler.class);
processorHandlerBinder.addBinding().to(BootstrapHttpHandler.class);
processorHandlerBinder.addBinding().to(ProgramScheduleHttpHandler.class);
} else {
bind(NoOpScheduler.class).in(Scopes.SINGLETON);
bind(Scheduler.class).to(NoOpScheduler.class);
}
}

Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 4e6f294

Please sign in to comment.