gpt4 book ai didi

co.cask.coopr.common.zookeeper.guice.ZookeeperModule类的使用及代码示例

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

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

ZookeeperModule介绍

[英]Guice module for binding zookeeper related classes.
[中]用于绑定zookeeper相关类的Guice模块。

代码示例

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

@Override
 protected void configure() {
  bind(ZKClient.class).toInstance(zkClient);
  bind(IdService.class).in(Scopes.SINGLETON);
  bind(LockService.class).in(Scopes.SINGLETON);
 }
}

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

new ZookeeperModule(zkClientService),
new StoreModule(conf),
new QueueModule(zkClientService),

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

@Before
public void before() throws IOException {
 zkServer = InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).setTickTime(30000).build();
 zkServer.startAndWait();
 zkClient = ZKClientService.Builder.of(zkServer.getConnectionStr()).build();
 zkClient.startAndWait();
 Injector injector = Guice.createInjector(
  new ZookeeperModule(zkClient),
  new QueueModule(zkClient)
 );
 zkQueueGroupService = injector.getInstance(ZKQueueService.class);
 zkQueueGroupService.startAndWait();
}

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

Modules.override(
 new ConfigurationModule(conf),
 new ZookeeperModule(zkClientService),
 new TestStoreModule(),
 new QueueModule(zkClientService),

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