gpt4 book ai didi

co.cask.cdap.common.guice.ZKDiscoveryModule.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 05:48:49 39 4
gpt4 key购买 nike

本文整理了Java中co.cask.cdap.common.guice.ZKDiscoveryModule.<init>()方法的一些代码示例,展示了ZKDiscoveryModule.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKDiscoveryModule.<init>()方法的具体详情如下:
包路径:co.cask.cdap.common.guice.ZKDiscoveryModule
类名称:ZKDiscoveryModule
方法名:<init>

ZKDiscoveryModule.<init>介绍

暂无

代码示例

代码示例来源:origin: cdapio/cdap

@Override
public void init(String[] args) {
 Injector injector = Guice.createInjector(new ConfigModule(),
                      new IOModule(),
                      new ZKClientModule(),
                      new ZKDiscoveryModule(),
                      new SecurityModules().getDistributedModules());
 configuration = injector.getInstance(CConfiguration.class);
 if (configuration.getBoolean(Constants.Security.ENABLED)) {
  this.zkClientService = injector.getInstance(ZKClientService.class);
  this.authServer = injector.getInstance(ExternalAuthenticationServer.class);
 }
}

代码示例来源:origin: cdapio/cdap

@VisibleForTesting
 static Injector createInjector(CConfiguration cConf, Configuration hConf) {
  return Guice.createInjector(
   new ConfigModule(cConf, hConf),
   new ZKClientModule(),
   new ZKDiscoveryModule(),
   new IOModule(),
   new KafkaClientModule(),
   new DFSLocationModule()
  );
 }
}

代码示例来源:origin: cdapio/cdap

new ZKClientModule(),
new KafkaClientModule(),
new ZKDiscoveryModule(),
new MessagingClientModule(),
new AbstractModule() {

代码示例来源:origin: cdapio/cdap

static Injector createGuiceInjector(CConfiguration cConf) {
  return Guice.createInjector(
   new ConfigModule(cConf),
   new ZKClientModule(),
   new ZKDiscoveryModule(),
   new RouterModules().getDistributedModules(),
   new SecurityModules().getDistributedModules(),
   new IOModule(),
   new AbstractModule() {
    @Override
    protected void configure() {
     bind(RouteStore.class).to(ZKRouteStore.class).in(Scopes.SINGLETON);
    }
   }
  );
 }
}

代码示例来源:origin: cdapio/cdap

modules.add(new IOModule());
modules.add(new ZKClientModule());
modules.add(new ZKDiscoveryModule());
modules.add(new MetricsClientRuntimeModule().getDistributedModules());
modules.add(new MessagingClientModule());

代码示例来源:origin: cdapio/cdap

@VisibleForTesting
 public static Injector createInjector(CConfiguration cConf, Configuration hConf) {
  return Guice.createInjector(
   new ConfigModule(cConf, hConf),
   new IOModule(),
   new ZKClientModule(),
   new ZKDiscoveryModule(),
   new KafkaClientModule(),
   new MetricsClientRuntimeModule().getDistributedModules(),
   new KafkaLogAppenderModule(),
   new DFSLocationModule(),
   new NamespaceQueryAdminModule(),
   new AuthorizationEnforcementModule().getDistributedModules(),
   new AuthenticationContextModules().getMasterModule(),
   new MessagingServerRuntimeModule().getDistributedModules()
  );
 }
}

代码示例来源:origin: caskdata/cdap

new ConfigModule(cConf),
new ZKClientModule(),
new ZKDiscoveryModule(),
new DFSLocationModule(),
new AbstractModule() {

代码示例来源:origin: cdapio/cdap

@VisibleForTesting
public static Injector createInjector(CConfiguration cConf, Configuration hConf) {
 return Guice.createInjector(
  new ConfigModule(cConf, hConf),
  new IOModule(),
  new ZKClientModule(),
  new ZKDiscoveryModule(),
  new KafkaClientModule(),
  new DFSLocationModule(),
  new DataFabricModules(HBaseTableExporter.class.getName()).getDistributedModules(),
  new DataSetsModules().getDistributedModules(),
  new MessagingClientModule(),
  new MetricsClientRuntimeModule().getDistributedModules(),
  new KafkaLogAppenderModule(),
  new ExploreClientModule(),
  new AuthorizationModule(),
  new AuthorizationEnforcementModule().getMasterModule(),
  new AuthenticationContextModules().getMasterModule(),
  new NamespaceQueryAdminModule(),
  new SecureStoreServerModule(),
  new AbstractModule() {
   @Override
   protected void configure() {
    bind(UGIProvider.class).to(RemoteUGIProvider.class);
    bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
   }
  }
 );
}

代码示例来源:origin: cdapio/cdap

@VisibleForTesting
static Injector createInjector(CConfiguration cConf, Configuration hConf) {
 return Guice.createInjector(
  new ConfigModule(cConf, hConf),
  new ZKClientModule(),
  new DFSLocationModule(),
  new NamespaceQueryAdminModule(),
  new ZKDiscoveryModule(),
  new DataFabricModules("cdap.explore.ContextManager").getDistributedModules(),
  new DataSetsModules().getDistributedModules(),
  new ExploreClientModule(),
  new KafkaClientModule(),
  new AuditModule().getDistributedModules(),
  new AuthorizationEnforcementModule().getDistributedModules(),
  new SecureStoreClientModule(),
  new AuthenticationContextModules().getMasterModule(),
  new MessagingClientModule(),
  new AbstractModule() {
   @Override
   protected void configure() {
    bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
    bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.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);
   }
  }
 );
}

代码示例来源:origin: cdapio/cdap

@VisibleForTesting
 static Injector createGuiceInjector(CConfiguration cConf, Configuration hConf, TwillContext twillContext) {
  String txClientId = String.format("cdap.service.%s.%d", Constants.Service.LOGSAVER, twillContext.getInstanceId());
  return Guice.createInjector(
   new ConfigModule(cConf, hConf),
   new IOModule(),
   new ZKClientModule(),
   new ZKDiscoveryModule(),
   new KafkaClientModule(),
   new MetricsClientRuntimeModule().getDistributedModules(),
   new DFSLocationModule(),
   new NamespaceQueryAdminModule(),
   new DataFabricModules(txClientId).getDistributedModules(),
   new DataSetsModules().getDistributedModules(),
   new DistributedLogFrameworkModule(twillContext),
   new KafkaLogAppenderModule(),
   new AuditModule().getDistributedModules(),
   new AuthorizationEnforcementModule().getDistributedModules(),
   new AuthenticationContextModules().getMasterModule(),
   new MessagingClientModule(),
   new AbstractModule() {
    @Override
    protected void configure() {
     bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
     bind(UGIProvider.class).to(RemoteUGIProvider.class).in(Scopes.SINGLETON);
    }
   }
  );
 }
}

代码示例来源:origin: cdapio/cdap

@BeforeClass
public static void setup() throws Exception {
 HBaseTestingUtility testUtil = new HBaseTestingUtility();
 zkCluster = testUtil.startMiniZKCluster();
 String zkConnectString = testUtil.getConfiguration().get(HConstants.ZOOKEEPER_QUORUM) + ":"
  + zkCluster.getClientPort();
 LOG.info("Running ZK cluster at " + zkConnectString);
 CConfiguration cConf1 = CConfiguration.create();
 cConf1.set(Constants.Zookeeper.QUORUM, zkConnectString);
 CConfiguration cConf2 = CConfiguration.create();
 cConf2.set(Constants.Zookeeper.QUORUM, zkConnectString);
 injector1 = Guice.createInjector(new ConfigModule(cConf1, testUtil.getConfiguration()), new IOModule(),
                  new SecurityModules().getDistributedModules(), new ZKClientModule(),
                  new ZKDiscoveryModule());
 injector2 = Guice.createInjector(new ConfigModule(cConf2, testUtil.getConfiguration()), new IOModule(),
                  new SecurityModules().getDistributedModules(), new ZKClientModule(),
                  new ZKDiscoveryModule());
}

代码示例来源:origin: cdapio/cdap

@Test
public void testMasterDiscovery() {
 Injector injector = Guice.createInjector(
  new ConfigModule(cConf),
  new ZKClientModule(),
  new ZKDiscoveryModule()
 );
 ZKClientService zkClient = injector.getInstance(ZKClientService.class);
 zkClient.startAndWait();
 try {
  DiscoveryService discoveryService = injector.getInstance(DiscoveryService.class);
  DiscoveryServiceClient discoveryServiceClient = injector.getInstance(DiscoveryServiceClient.class);
  // Register a master service
  InetSocketAddress socketAddr = new InetSocketAddress(InetAddress.getLoopbackAddress(), 43210);
  Cancellable cancellable = discoveryService.register(new Discoverable(Constants.Service.APP_FABRIC_HTTP,
                                     socketAddr));
  try {
   // Discover the master service
   Discoverable discoverable = new RandomEndpointStrategy(
    () -> discoveryServiceClient.discover(Constants.Service.APP_FABRIC_HTTP)).pick(10, TimeUnit.SECONDS);
   Assert.assertNotNull(discoverable);
   Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP, discoverable.getName());
   Assert.assertEquals(socketAddr, discoverable.getSocketAddress());
  } finally {
   cancellable.cancel();
  }
 } finally {
  zkClient.stopAndWait();
 }
}

代码示例来源:origin: cdapio/cdap

new IOModule(),
new ZKClientModule(),
new ZKDiscoveryModule(),
new DFSLocationModule(),
new TwillModule(),

代码示例来源:origin: cdapio/cdap

@VisibleForTesting
static Injector createGuiceInjector(CConfiguration cConf, Configuration hConf, String txClientId,
                  TwillContext twillContext) {
 return Guice.createInjector(
  new ConfigModule(cConf, hConf),
  new IOModule(),
  new ZKClientModule(),
  new ZKDiscoveryModule(),
  new KafkaClientModule(),
  new MessagingClientModule(),
  new MetricsClientRuntimeModule().getDistributedModules(),
  new MetricsStoreModule(),
  new KafkaLogAppenderModule(),
  new DFSLocationModule(),
  new NamespaceQueryAdminModule(),
  new DataFabricModules(txClientId).getDistributedModules(),
  new DataSetsModules().getDistributedModules(),
  new MetricsProcessorModule(twillContext),
  new MetricsProcessorStatusServiceModule(),
  new AuditModule().getDistributedModules(),
  new AuthorizationEnforcementModule().getDistributedModules(),
  new AuthenticationContextModules().getMasterModule(),
  new AbstractModule() {
   @Override
   protected void configure() {
    bind(OwnerAdmin.class).to(DefaultOwnerAdmin.class);
   }
  }
 );
}

代码示例来源:origin: cdapio/cdap

new IOModule(),
new ZKClientModule(),
new ZKDiscoveryModule(),
new KafkaClientModule(),
new MessagingClientModule(),

代码示例来源:origin: cdapio/cdap

new ConfigModule(cConf),
 new ZKClientModule(),
 new ZKDiscoveryModule()
);

代码示例来源:origin: cdapio/cdap

new IOModule(),
new ZKClientModule(),
new ZKDiscoveryModule(),
new KafkaClientModule(),
new MessagingClientModule(),

代码示例来源:origin: cdapio/cdap

new IOModule(),
new ZKClientModule(),
new ZKDiscoveryModule(),
new KafkaClientModule(),
new MessagingClientModule(),

代码示例来源:origin: cdapio/cdap

new IOModule(),
new ZKClientModule(),
new ZKDiscoveryModule(),
new KafkaClientModule(),
new MessagingClientModule(),

代码示例来源:origin: cdapio/cdap

new DFSLocationModule(),
new IOModule(),
new ZKDiscoveryModule(),
new KafkaClientModule(),
new DataSetServiceModules().getDistributedModules(),

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com