gpt4 book ai didi

co.cask.tigon.guice.ZKClientModule类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:45:33 27 4
gpt4 key购买 nike

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

ZKClientModule介绍

[英]Guice module for binding org.apache.twill.zookeeper.ZKClient and org.apache.twill.zookeeper.ZKClientService. Requires ConfigModulebindings.
[中]绑定组织的Guice模块。阿帕奇。斜纹布。动物园管理员。ZKClient和org。阿帕奇。斜纹布。动物园管理员。ZKClientService。需要ConfigModuleBinding。

代码示例

代码示例来源:origin: co.cask.tigon/tigon-yarn

@Override
protected void configure() {
 /**
  * ZKClientService is provided by the provider method
  * {@link #provideZKClientService(co.cask.tigon.conf.CConfiguration)}.
  */
 bind(ZKClient.class).to(ZKClientService.class);
}

代码示例来源:origin: co.cask.tigon/tigon-flow

static Injector createGuiceInjector(CConfiguration cConf, Configuration hConf) {
 return Guice.createInjector(
  new ConfigModule(cConf, hConf),
  new IOModule(),
  new ZKClientModule(),
  createDataFabricModule(),
  new LocationRuntimeModule().getDistributedModules(),
  new DiscoveryRuntimeModule().getDistributedModules(),
  new MetricsClientRuntimeModule().getDistributedModules()
 );
}

代码示例来源:origin: co.cask.tigon/tigon-client

private static List<Module> createModules(CConfiguration cConf, Configuration hConf) {
 return ImmutableList.of(
  new DataFabricDistributedModule(),
  new ConfigModule(cConf, hConf),
  new IOModule(),
  new ZKClientModule(),
  new TwillModule(),
  new LocationRuntimeModule().getDistributedModules(),
  new DiscoveryRuntimeModule().getDistributedModules(),
  new ProgramRunnerRuntimeModule().getDistributedModules(),
  new MetricsClientModule(),
  new AbstractModule() {
   @Override
   protected void configure() {
    bind(FlowOperations.class).to(DistributedFlowOperations.class);
   }
  }
 );
}

代码示例来源:origin: co.cask.tigon/tigon-flow

protected Module createModule(final TwillContext context) {
 return Modules.combine(
  new ConfigModule(cConf, hConf),
  new IOModule(),
  new ZKClientModule(),
  new MetricsClientRuntimeModule().getDistributedModules(),
  new LocationRuntimeModule().getDistributedModules(),
  new DiscoveryRuntimeModule().getDistributedModules(),
  new DataFabricModules().getDistributedModules(),
  new AbstractModule() {
   @Override
   protected void configure() {
    // For Binding queue stuff
    bind(QueueReaderFactory.class).in(Scopes.SINGLETON);
    // For program loading
    install(createProgramFactoryModule());
    // For binding DataSet transaction stuff
    install(new DataFabricFacadeModule());
    bind(ServiceAnnouncer.class).toInstance(new ServiceAnnouncer() {
     @Override
     public Cancellable announce(String serviceName, int port) {
      return context.announce(serviceName, port);
     }
    });
   }
  }
 );
}

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