Class ConsumerNodesRegistry
java.lang.Object
org.apache.curator.framework.recipes.cache.PathChildrenCache
pl.allegro.tech.hermes.consumers.registry.ConsumerNodesRegistry
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
public class ConsumerNodesRegistry
extends org.apache.curator.framework.recipes.cache.PathChildrenCache
implements org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.curator.framework.recipes.cache.PathChildrenCache
org.apache.curator.framework.recipes.cache.PathChildrenCache.StartMode -
Field Summary
Fields inherited from class org.apache.curator.framework.recipes.cache.PathChildrenCache
defaultThreadFactorySupplier -
Constructor Summary
ConstructorsConstructorDescriptionConsumerNodesRegistry(org.apache.curator.framework.CuratorFramework curatorClient, ExecutorService executorService, ConsumerNodesRegistryPaths registryPaths, String consumerNodeId, long deathOfConsumerAfterSeconds, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener) voidchildEvent(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event) booleanisLeader()booleanisRegistered(String consumerNodeId) voidrefresh()voidremoveLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener) voidstart()voidstop()Methods inherited from class org.apache.curator.framework.recipes.cache.PathChildrenCache
clear, clearAndRefresh, clearDataBytes, clearDataBytes, close, ensurePath, getCurrentData, getCurrentData, getListenable, handleException, rebuild, rebuildNode, remove, start, start
-
Constructor Details
-
ConsumerNodesRegistry
public ConsumerNodesRegistry(org.apache.curator.framework.CuratorFramework curatorClient, ExecutorService executorService, ConsumerNodesRegistryPaths registryPaths, String consumerNodeId, long deathOfConsumerAfterSeconds, Clock clock)
-
-
Method Details
-
start
- Overrides:
startin classorg.apache.curator.framework.recipes.cache.PathChildrenCache- Throws:
Exception
-
stop
- Throws:
IOException
-
childEvent
public void childEvent(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event) throws Exception - Specified by:
childEventin interfaceorg.apache.curator.framework.recipes.cache.PathChildrenCacheListener- Throws:
Exception
-
isRegistered
-
isLeader
public boolean isLeader() -
listConsumerNodes
-
refresh
public void refresh() -
getConsumerId
-
addLeaderLatchListener
public void addLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener) -
removeLeaderLatchListener
public void removeLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)
-