gpt4 book ai didi

io.pravega.controller.store.client.impl.ZKClientConfigImpl类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 06:35:31 27 4
gpt4 key购买 nike

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

ZKClientConfigImpl介绍

[英]Zookeeper Curator framework client config.
[中]Zookeeper策展人框架客户端配置。

代码示例

代码示例来源:origin: pravega/pravega

Consumer<Void> expirationHandler = x -> sessionExpiry.complete(null);
CuratorFramework client = StoreClientFactory.createZKClient(ZKClientConfigImpl.builder().connectionString(zkServer.getConnectString())
    .namespace("test").maxRetries(10).initialSleepInterval(10).secureConnectionToZooKeeper(false).sessionTimeoutMs(15000).build(),
    canRetrySupplier, expirationHandler);

代码示例来源:origin: pravega/pravega

@Override
public void setup() {
  try {
    zkServer = new TestingServerStarter().start();
  } catch (Exception e) {
    log.error("Error starting test zk server");
    Assert.fail("Error starting test zk server");
  }
  ZKClientConfig zkClientConfig = ZKClientConfigImpl.builder().connectionString(zkServer.getConnectString())
      .initialSleepInterval(500)
      .maxRetries(10)
      .sessionTimeoutMs(10 * 1000)
      .namespace("pravega/" + UUID.randomUUID())
      .build();
  storeClientConfig = StoreClientConfigImpl.withZKClient(zkClientConfig);
}

代码示例来源:origin: pravega/pravega

statsProvider.start();
ZKClientConfig zkClientConfig = ZKClientConfigImpl.builder()
    .connectionString(Config.ZK_URL)
    .secureConnectionToZooKeeper(Config.SECURE_ZK)

代码示例来源:origin: pravega/pravega

@Override
public void setup() {
  try {
    zkServer = new TestingServerStarter().start();
  } catch (Exception e) {
    log.error("Error starting test zk server");
    Assert.fail("Error starting test zk server");
  }
  ZKClientConfig zkClientConfig = ZKClientConfigImpl.builder().connectionString(zkServer.getConnectString())
      .initialSleepInterval(500)
      .maxRetries(10)
      .namespace("pravega/" + UUID.randomUUID())
      .sessionTimeoutMs(10 * 1000)
      .build();
  storeClientConfig = StoreClientConfigImpl.withZKClient(zkClientConfig);
  storeClient = StoreClientFactory.createStoreClient(storeClientConfig);
  Assert.assertNotNull(storeClient);
}

代码示例来源:origin: pravega/pravega

final int containerCount, int restPort) {
ZKClientConfig zkClientConfig = ZKClientConfigImpl.builder().connectionString(connectionString)
    .initialSleepInterval(500)
    .maxRetries(10)

代码示例来源:origin: pravega/pravega

@Test
public void zkHostStoreTests() {
  try {
    @Cleanup
    TestingServer zkTestServer = new TestingServerStarter().start();
    ZKClientConfig zkClientConfig = ZKClientConfigImpl.builder().connectionString(zkTestServer.getConnectString())
        .initialSleepInterval(2000)
        .maxRetries(1)
        .sessionTimeoutMs(10 * 1000)
        .namespace("hostStoreTest/" + UUID.randomUUID())
        .build();
    StoreClientConfig storeClientConfig = StoreClientConfigImpl.withZKClient(zkClientConfig);
    @Cleanup
    StoreClient storeClient = StoreClientFactory.createStoreClient(storeClientConfig);
    HostMonitorConfig hostMonitorConfig = HostMonitorConfigImpl.builder()
        .hostMonitorEnabled(true)
        .hostMonitorMinRebalanceInterval(10)
        .containerCount(containerCount)
        .build();
    // Create ZK based host store.
    HostControllerStore hostStore = HostStoreFactory.createStore(hostMonitorConfig, storeClient);
    // Update host store map.
    hostStore.updateHostContainersMap(HostMonitorConfigImpl.getHostContainerMap(host, controllerPort, containerCount));
    validateStore(hostStore);
  } catch (Exception e) {
    log.error("Unexpected error", e);
    Assert.fail();
  }
}

代码示例来源:origin: pravega/pravega

private ControllerServiceMain startLocalController(int controllerId) {
  ZKClientConfig zkClientConfig = ZKClientConfigImpl.builder()
      .connectionString(zkUrl)
      .namespace("pravega/" + clusterName)

代码示例来源:origin: pravega/pravega

() -> ZKClientConfigImpl.builder().connectionString(null).build());
() -> ZKClientConfigImpl.builder().connectionString("localhost").build());
() -> ZKClientConfigImpl.builder().connectionString("localhost").namespace("test")
    .initialSleepInterval(-10).build());
() -> ZKClientConfigImpl.builder().connectionString("localhost").namespace("test")
    .initialSleepInterval(10).maxRetries(-10).namespace("").build());
() -> ZKClientConfigImpl.builder().connectionString("localhost").namespace("test")
    .sessionTimeoutMs(-10).namespace("").build());

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