pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.MaxRateRegistryPaths Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-consumers Show documentation
Show all versions of hermes-consumers Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.consumers.consumer.rate.maxrate;
import pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths;
import static pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths.CONSUMERS_RATE_PATH;
import static pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths.MAX_RATE_HISTORY_PATH;
import static pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths.MAX_RATE_PATH;
class MaxRateRegistryPaths {
private static final String RATE_RUNTIME_PATH = "runtime-bin";
private final ZookeeperPaths zookeeperPaths;
private final String clusterName;
private final String currentConsumerRateHistoryPath;
MaxRateRegistryPaths(ZookeeperPaths zookeeperPaths, String currentConsumerId, String clusterName) {
this.zookeeperPaths = zookeeperPaths;
this.clusterName = clusterName;
this.currentConsumerRateHistoryPath = consumerRateHistoryPath(currentConsumerId);
}
String consumerMaxRatePath(String consumerId) {
return zookeeperPaths.join(consumerRateParentRuntimePath(consumerId), MAX_RATE_PATH);
}
String consumerRateHistoryPath(String consumerId) {
return zookeeperPaths.join(consumerRateParentRuntimePath(consumerId), MAX_RATE_HISTORY_PATH);
}
String consumerRateParentRuntimePath(String consumerId) {
return zookeeperPaths.join(consumersRateCurrentClusterRuntimeBinaryPath(), consumerId);
}
String consumersRateCurrentClusterRuntimeBinaryPath() {
return zookeeperPaths.join(zookeeperPaths.basePath(), CONSUMERS_RATE_PATH, clusterName, RATE_RUNTIME_PATH);
}
String currentConsumerRateHistoryPath() {
return currentConsumerRateHistoryPath;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy