gpt4 book ai didi

pl.allegro.tech.hermes.common.admin.zookeeper.ZookeeperAdminCache类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:37:56 28 4
gpt4 key购买 nike

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

ZookeeperAdminCache介绍

暂无

代码示例

代码示例来源:origin: allegro/hermes

@Override
public void start() throws Exception {
  adminCache.start();
  adminCache.addCallback(this);
  notificationsBus.registerSubscriptionCallback(this);
  notificationsBus.registerTopicCallback(this);
  assignmentRegistry.registerAssignmentCallback(this);
  supervisor.start();
  assignmentRegistry.start();
  logger.info("Consumer boot complete. Workload config: [{}]", configFactory.print(CONSUMER_WORKLOAD_NODE_ID, CONSUMER_WORKLOAD_ALGORITHM));
}

代码示例来源:origin: allegro/hermes

@Inject
public ZookeeperAdminCache(ZookeeperPaths zookeeperPaths,
              @Named(CuratorType.HERMES) CuratorFramework client,
              ObjectMapper objectMapper,
              Clock clock) {
  super(client, zookeeperPaths.adminPath(), true);
  this.objectMapper = objectMapper;
  this.initializationTime = clock.millis();
  getListenable().addListener(this);
}

代码示例来源:origin: allegro/hermes

@Override
public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception {
  switch (event.getType()) {
    case CHILD_UPDATED:
    case CHILD_ADDED:
      if (event.getData().getPath().contains(RETRANSMIT.name()) && isYoungerThanThisNode(event)) {
        retransmit(event);
      }
      break;
    default:
      break;
  }
}

代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers

@Override
public void start() throws Exception {
  adminCache.start();
  adminCache.addCallback(this);
  notificationsBus.registerSubscriptionCallback(this);
  notificationsBus.registerTopicCallback(this);
  assignmentRegistry.registerAssignmentCallback(this);
  supervisor.start();
  assignmentRegistry.start();
  logger.info("Consumer boot complete. Workload config: [{}]", configFactory.print(CONSUMER_WORKLOAD_NODE_ID, CONSUMER_WORKLOAD_ALGORITHM));
}

代码示例来源:origin: allegro/hermes

@Override
public void start() throws Exception {
  long startTime = System.currentTimeMillis();
  adminCache.start();
  adminCache.addCallback(this);
  notificationsBus.registerSubscriptionCallback(this);
  notificationsBus.registerTopicCallback(this);
  registry.registerAssignmentCallback(this);
  supervisor.start();
  consumersRegistry.start();
  registry.start();
  if (configFactory.getBooleanProperty(CONSUMER_WORKLOAD_AUTO_REBALANCE)) {
    balancingJob.start();
    consumersRegistry.startLeaderLatch();
  } else {
    logger.info("Automatic workload rebalancing is disabled.");
  }
  logger.info("Consumer boot complete in {} ms. Workload config: [{}]",
      System.currentTimeMillis() - startTime,
      configFactory.print(
          CONSUMER_WORKLOAD_NODE_ID,
          CONSUMER_WORKLOAD_ALGORITHM,
          CONSUMER_WORKLOAD_REBALANCE_INTERVAL,
          CONSUMER_WORKLOAD_CONSUMERS_PER_SUBSCRIPTION,
          CONSUMER_WORKLOAD_MAX_SUBSCRIPTIONS_PER_CONSUMER));
}

代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers

@Override
public void start() throws Exception {
  long startTime = System.currentTimeMillis();
  adminCache.start();
  adminCache.addCallback(this);
  notificationsBus.registerSubscriptionCallback(this);
  notificationsBus.registerTopicCallback(this);
  registry.registerAssignmentCallback(this);
  supervisor.start();
  consumersRegistry.start();
  registry.start();
  if (configFactory.getBooleanProperty(CONSUMER_WORKLOAD_AUTO_REBALANCE)) {
    balancingJob.start();
    consumersRegistry.startLeaderLatch();
  } else {
    logger.info("Automatic workload rebalancing is disabled.");
  }
  logger.info("Consumer boot complete in {} ms. Workload config: [{}]",
      System.currentTimeMillis() - startTime,
      configFactory.print(
          CONSUMER_WORKLOAD_NODE_ID,
          CONSUMER_WORKLOAD_ALGORITHM,
          CONSUMER_WORKLOAD_REBALANCE_INTERVAL,
          CONSUMER_WORKLOAD_CONSUMERS_PER_SUBSCRIPTION,
          CONSUMER_WORKLOAD_MAX_SUBSCRIPTIONS_PER_CONSUMER));
}

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