public class HierarchicalCacheMaxRateRegistry extends java.lang.Object implements MaxRateRegistry
| Constructor and Description |
|---|
HierarchicalCacheMaxRateRegistry(pl.allegro.tech.hermes.common.config.ConfigFactory configFactory,
org.apache.curator.framework.CuratorFramework curator,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths zookeeperPaths,
MaxRatePathSerializer pathSerializer,
SubscriptionsCache subscriptionsCache) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerRateInfo> |
ensureCorrectAssignments(pl.allegro.tech.hermes.api.SubscriptionName subscriptionName,
java.util.Set<java.lang.String> currentConsumers) |
java.util.Optional<pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.MaxRate> |
getMaxRate(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer) |
RateHistory |
getRateHistory(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer) |
void |
start() |
void |
stop() |
void |
update(pl.allegro.tech.hermes.api.SubscriptionName subscriptionName,
java.util.Map<java.lang.String,pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.MaxRate> newMaxRates) |
void |
writeRateHistory(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer,
RateHistory rateHistory) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAfterMaxRateCalculation, onAfterWriteRateHistories, onBeforeMaxRateCalculationpublic HierarchicalCacheMaxRateRegistry(pl.allegro.tech.hermes.common.config.ConfigFactory configFactory,
org.apache.curator.framework.CuratorFramework curator,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths zookeeperPaths,
MaxRatePathSerializer pathSerializer,
SubscriptionsCache subscriptionsCache)
public void start()
start in interface MaxRateRegistrypublic void stop()
stop in interface MaxRateRegistrypublic java.util.Set<pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerRateInfo> ensureCorrectAssignments(pl.allegro.tech.hermes.api.SubscriptionName subscriptionName,
java.util.Set<java.lang.String> currentConsumers)
ensureCorrectAssignments in interface MaxRateRegistrypublic void update(pl.allegro.tech.hermes.api.SubscriptionName subscriptionName,
java.util.Map<java.lang.String,pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.MaxRate> newMaxRates)
update in interface MaxRateRegistrypublic java.util.Optional<pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.MaxRate> getMaxRate(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer)
getMaxRate in interface MaxRateRegistrypublic RateHistory getRateHistory(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer)
getRateHistory in interface MaxRateRegistrypublic void writeRateHistory(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer,
RateHistory rateHistory)
writeRateHistory in interface MaxRateRegistry