本文整理了Java中pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths.consumersRuntimePath()
方法的一些代码示例,展示了ZookeeperPaths.consumersRuntimePath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperPaths.consumersRuntimePath()
方法的具体详情如下:
包路径:pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths
类名称:ZookeeperPaths
方法名:consumersRuntimePath
暂无
代码示例来源:origin: allegro/hermes
private String assignmentPath(String subscription, String supervisorId) {
return paths.consumersRuntimePath(CLUSTER_NAME) + "/" + subscription + "/" + supervisorId;
}
代码示例来源:origin: allegro/hermes
@Override
public SubscriptionAssignmentRegistry provide() {
ZookeeperPaths paths = new ZookeeperPaths(configFactory.getStringProperty(Configs.ZOOKEEPER_ROOT));
String cluster = configFactory.getStringProperty(KAFKA_CLUSTER_NAME);
String consumersRuntimePath = paths.consumersRuntimePath(cluster);
return new SubscriptionAssignmentRegistry(
curatorClient,
subscriptionAssignmentCache,
new SubscriptionAssignmentPathSerializer(consumersRuntimePath, AUTO_ASSIGNED_MARKER)
);
}
代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers
@Override
public SubscriptionAssignmentRegistry provide() {
ZookeeperPaths paths = new ZookeeperPaths(configFactory.getStringProperty(Configs.ZOOKEEPER_ROOT));
String cluster = configFactory.getStringProperty(KAFKA_CLUSTER_NAME);
String consumersRuntimePath = paths.consumersRuntimePath(cluster);
return new SubscriptionAssignmentRegistry(
curatorClient,
subscriptionAssignmentCache,
new SubscriptionAssignmentPathSerializer(consumersRuntimePath, AUTO_ASSIGNED_MARKER)
);
}
代码示例来源:origin: allegro/hermes
@Inject
public SubscriptionAssignmentCache(CuratorFramework curator,
ConfigFactory configFactory,
ZookeeperPaths zookeeperPaths,
SubscriptionsCache subscriptionsCache) {
this.curator = curator;
this.basePath = zookeeperPaths.consumersRuntimePath(configFactory.getStringProperty(KAFKA_CLUSTER_NAME));
this.subscriptionsCache = subscriptionsCache;
this.pathSerializer = new SubscriptionAssignmentPathSerializer(basePath, AUTO_ASSIGNED_MARKER);
this.cache = new HierarchicalCache(
curator, Executors.newSingleThreadScheduledExecutor(), basePath, 2, Collections.emptyList()
);
cache.registerCallback(ASSIGNMENT_LEVEL, (e) -> {
SubscriptionAssignment assignment =
pathSerializer.deserialize(e.getData().getPath(), e.getData().getData());
switch (e.getType()) {
case CHILD_ADDED:
onAssignmentAdded(assignment);
break;
case CHILD_REMOVED:
onAssignmentRemoved(assignment);
break;
}
});
}
代码示例来源:origin: pl.allegro.tech.hermes/hermes-consumers
@Inject
public SubscriptionAssignmentCache(CuratorFramework curator,
ConfigFactory configFactory,
ZookeeperPaths zookeeperPaths,
SubscriptionsCache subscriptionsCache) {
this.curator = curator;
this.basePath = zookeeperPaths.consumersRuntimePath(configFactory.getStringProperty(KAFKA_CLUSTER_NAME));
this.subscriptionsCache = subscriptionsCache;
this.pathSerializer = new SubscriptionAssignmentPathSerializer(basePath, AUTO_ASSIGNED_MARKER);
this.cache = new HierarchicalCache(
curator, Executors.newSingleThreadScheduledExecutor(), basePath, 2, Collections.emptyList()
);
cache.registerCallback(ASSIGNMENT_LEVEL, (e) -> {
SubscriptionAssignment assignment =
pathSerializer.deserialize(e.getData().getPath(), e.getData().getData());
switch (e.getType()) {
case CHILD_ADDED:
onAssignmentAdded(assignment);
break;
case CHILD_REMOVED:
onAssignmentRemoved(assignment);
break;
}
});
}
内容来源于网络,如有侵权,请联系作者删除!