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] Keep TaskWorkerServiceLauncher, SystemWorkerServiceLauncher, CoreSchedulerService, Schedule HTTP handlers in Appfabric Processor #15844

Merged
merged 1 commit into from
Feb 5, 2025
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 @@ -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 @@ -193,6 +195,9 @@
*/
public final class AppFabricServiceRuntimeModule extends RuntimeModule {

/**
* Service type for App Fabric.
*/
public enum ServiceType {
SERVER,
PROCESSOR,
Expand Down Expand Up @@ -259,6 +264,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 +464,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 +560,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