Class HierarchicalCacheMaxRateRegistry

    • Constructor Summary

      Constructors 
      Constructor 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)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HierarchicalCacheMaxRateRegistry

        public 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)
    • Method Detail

      • ensureCorrectAssignments

        public 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)
        Specified by:
        ensureCorrectAssignments in interface MaxRateRegistry
      • update

        public 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)
        Specified by:
        update in interface MaxRateRegistry
      • getMaxRate

        public java.util.Optional<pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.MaxRate> getMaxRate​(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer)
        Specified by:
        getMaxRate in interface MaxRateRegistry
      • writeRateHistory

        public void writeRateHistory​(pl.allegro.tech.hermes.consumers.consumer.rate.maxrate.ConsumerInstance consumer,
                                     RateHistory rateHistory)
        Specified by:
        writeRateHistory in interface MaxRateRegistry