use of co.cask.cdap.explore.client.ProgramDiscoveryExploreClient in project cdap by caskdata.
the class DistributedProgramRunnableModule method getCoreModules.
private List<Module> getCoreModules(final ProgramId programId, String txClientId) {
return new ArrayList<>(Arrays.<Module>asList(new ConfigModule(cConf, hConf), new IOModule(), new ZKClientModule(), new KafkaClientModule(), new MetricsClientRuntimeModule().getDistributedModules(), new MessagingClientModule(), new LocationRuntimeModule().getDistributedModules(), new LoggingModules().getDistributedModules(), new DiscoveryRuntimeModule().getDistributedModules(), new DataFabricModules(txClientId).getDistributedModules(), new DataSetsModules().getDistributedModules(), new ViewAdminModules().getDistributedModules(), new StreamAdminModules().getDistributedModules(), new NotificationFeedClientModule(), new AuditModule().getDistributedModules(), new NamespaceClientRuntimeModule().getDistributedModules(), new AuthorizationEnforcementModule().getDistributedModules(), new SecureStoreModules().getDistributedModules(), new AbstractModule() {
@Override
protected void configure() {
// For Binding queue stuff
bind(QueueReaderFactory.class).in(Scopes.SINGLETON);
// For binding DataSet transaction stuff
install(new DataFabricFacadeModule());
bind(ProgramStateWriter.class).to(MessagingProgramStateWriter.class);
bind(RuntimeStore.class).to(RemoteRuntimeStore.class);
// For binding StreamWriter
install(createStreamFactoryModule());
// don't need to perform any impersonation from within user programs
bind(UGIProvider.class).to(CurrentUGIProvider.class).in(Scopes.SINGLETON);
// bind PrivilegesManager to a remote implementation, so it does not need to instantiate the authorizer
bind(PrivilegesManager.class).to(RemotePrivilegesManager.class);
bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
// Bind ProgramId to the passed in instance programId so that we can retrieve it back later when needed.
// For example see ProgramDiscoveryExploreClient.
// Also binding to instance is fine here as the programId is guaranteed to not change throughout the
// lifecycle of this program runnable
bind(ProgramId.class).toInstance(programId);
// bind explore client to ProgramDiscoveryExploreClient which is aware of the programId
bind(ExploreClient.class).to(ProgramDiscoveryExploreClient.class).in(Scopes.SINGLETON);
// Bind the ArtifactManager implementation
install(new FactoryModuleBuilder().implement(ArtifactManager.class, RemoteArtifactManager.class).build(ArtifactManagerFactory.class));
// Bind the PluginFinder implementation
bind(PluginFinder.class).to(RemotePluginFinder.class);
}
}));
}
Aggregations