Class HierarchicalConsumerAssignmentCache
- java.lang.Object
-
- pl.allegro.tech.hermes.consumers.supervisor.workload.HierarchicalConsumerAssignmentCache
-
- All Implemented Interfaces:
ClusterAssignmentCache,ConsumerAssignmentCache
public class HierarchicalConsumerAssignmentCache extends java.lang.Object implements ConsumerAssignmentCache, ClusterAssignmentCache
-
-
Constructor Summary
Constructors Constructor Description HierarchicalConsumerAssignmentCache(org.apache.curator.framework.CuratorFramework curator, java.lang.String consumerId, java.lang.String clusterName, pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths zookeeperPaths, SubscriptionsCache subscriptionsCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubscriptionAssignmentViewcreateSnapshot()java.util.Set<java.lang.String>getAssignedConsumers()java.util.Set<pl.allegro.tech.hermes.api.SubscriptionName>getConsumerSubscriptions()java.util.Set<pl.allegro.tech.hermes.api.SubscriptionName>getConsumerSubscriptions(java.lang.String consumerId)java.util.Map<pl.allegro.tech.hermes.api.SubscriptionName,java.util.Set<java.lang.String>>getSubscriptionConsumers()booleanisAssignedTo(java.lang.String nodeId, pl.allegro.tech.hermes.api.SubscriptionName subscription)booleanisAssignedTo(pl.allegro.tech.hermes.api.SubscriptionName subscription)booleanisReady()booleanisStarted()voidrefresh()voidregisterAssignmentCallback(SubscriptionAssignmentAware callback)voidstart()voidstop()
-
-
-
Constructor Detail
-
HierarchicalConsumerAssignmentCache
public HierarchicalConsumerAssignmentCache(org.apache.curator.framework.CuratorFramework curator, java.lang.String consumerId, java.lang.String clusterName, pl.allegro.tech.hermes.infrastructure.zookeeper.ZookeeperPaths zookeeperPaths, SubscriptionsCache subscriptionsCache)
-
-
Method Detail
-
start
public void start() throws java.lang.Exception- Specified by:
startin interfaceConsumerAssignmentCache- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.Exception- Specified by:
stopin interfaceConsumerAssignmentCache- Throws:
java.lang.Exception
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceConsumerAssignmentCache
-
isReady
public boolean isReady()
- Specified by:
isReadyin interfaceClusterAssignmentCache
-
refresh
public void refresh()
- Specified by:
refreshin interfaceClusterAssignmentCache
-
createSnapshot
public SubscriptionAssignmentView createSnapshot()
- Specified by:
createSnapshotin interfaceClusterAssignmentCache
-
isAssignedTo
public boolean isAssignedTo(pl.allegro.tech.hermes.api.SubscriptionName subscription)
- Specified by:
isAssignedToin interfaceConsumerAssignmentCache
-
isAssignedTo
public boolean isAssignedTo(java.lang.String nodeId, pl.allegro.tech.hermes.api.SubscriptionName subscription)- Specified by:
isAssignedToin interfaceClusterAssignmentCache
-
registerAssignmentCallback
public void registerAssignmentCallback(SubscriptionAssignmentAware callback)
- Specified by:
registerAssignmentCallbackin interfaceConsumerAssignmentCache
-
getSubscriptionConsumers
public java.util.Map<pl.allegro.tech.hermes.api.SubscriptionName,java.util.Set<java.lang.String>> getSubscriptionConsumers()
- Specified by:
getSubscriptionConsumersin interfaceClusterAssignmentCache
-
getConsumerSubscriptions
public java.util.Set<pl.allegro.tech.hermes.api.SubscriptionName> getConsumerSubscriptions()
- Specified by:
getConsumerSubscriptionsin interfaceConsumerAssignmentCache
-
getConsumerSubscriptions
public java.util.Set<pl.allegro.tech.hermes.api.SubscriptionName> getConsumerSubscriptions(java.lang.String consumerId)
- Specified by:
getConsumerSubscriptionsin interfaceClusterAssignmentCache
-
getAssignedConsumers
public java.util.Set<java.lang.String> getAssignedConsumers()
- Specified by:
getAssignedConsumersin interfaceClusterAssignmentCache
-
-