本文整理了Java中pl.allegro.tech.hermes.common.admin.zookeeper.ZookeeperAdminCache
类的一些代码示例,展示了ZookeeperAdminCache
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperAdminCache
类的具体详情如下:
包路径:pl.allegro.tech.hermes.common.admin.zookeeper.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));
}
内容来源于网络,如有侵权,请联系作者删除!