Package org.apache.bookkeeper.discover
Class ZKRegistrationClient.WatchTask
- java.lang.Object
-
- org.apache.bookkeeper.discover.ZKRegistrationClient.WatchTask
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.lang.Runnable,java.util.function.BiConsumer<Versioned<java.util.Set<BookieId>>,java.lang.Throwable>,org.apache.zookeeper.Watcher
- Enclosing class:
- ZKRegistrationClient
class ZKRegistrationClient.WatchTask extends java.lang.Object implements java.lang.Runnable, org.apache.zookeeper.Watcher, java.util.function.BiConsumer<Versioned<java.util.Set<BookieId>>,java.lang.Throwable>, java.lang.AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description WatchTask(java.lang.String regPath, java.util.concurrent.CompletableFuture<java.lang.Void> firstRunFuture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Versioned<java.util.Set<BookieId>> bookieSet, java.lang.Throwable throwable)booleanaddListener(RegistrationClient.RegistrationListener listener)voidclose()intgetNumListeners()(package private) booleanisClosed()voidprocess(org.apache.zookeeper.WatchedEvent event)booleanremoveListener(RegistrationClient.RegistrationListener listener)voidrun()(package private) voidwatch()
-
-
-
Method Detail
-
getNumListeners
public int getNumListeners()
-
addListener
public boolean addListener(RegistrationClient.RegistrationListener listener)
-
removeListener
public boolean removeListener(RegistrationClient.RegistrationListener listener)
-
watch
void watch()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
accept
public void accept(Versioned<java.util.Set<BookieId>> bookieSet, java.lang.Throwable throwable)
-
process
public void process(org.apache.zookeeper.WatchedEvent event)
- Specified by:
processin interfaceorg.apache.zookeeper.Watcher
-
isClosed
boolean isClosed()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-