Package org.apache.bookkeeper.meta
Class ZkLedgerAuditorManager
java.lang.Object
org.apache.bookkeeper.meta.ZkLedgerAuditorManager
- All Implemented Interfaces:
AutoCloseable,LedgerAuditorManager
ZK based implementation of LedgerAuditorManager.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.bookkeeper.meta.LedgerAuditorManager
LedgerAuditorManager.AuditorEvent -
Constructor Summary
ConstructorsConstructorDescriptionZkLedgerAuditorManager(org.apache.zookeeper.ZooKeeper zkc, ServerConfiguration conf, StatsLogger statsLogger) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Return the information regarding the current auditor.voidtryToBecomeAuditor(String bookieId, Consumer<LedgerAuditorManager.AuditorEvent> listener) Try to become the auditor.
-
Constructor Details
-
ZkLedgerAuditorManager
public ZkLedgerAuditorManager(org.apache.zookeeper.ZooKeeper zkc, ServerConfiguration conf, StatsLogger statsLogger)
-
-
Method Details
-
tryToBecomeAuditor
public void tryToBecomeAuditor(String bookieId, Consumer<LedgerAuditorManager.AuditorEvent> listener) throws IOException, InterruptedException Description copied from interface:LedgerAuditorManagerTry to become the auditor. If there's already another auditor, it will wait until this current instance has become the auditor.- Specified by:
tryToBecomeAuditorin interfaceLedgerAuditorManager- Parameters:
bookieId- the identifier for current bookielistener- listener that will receive AuditorEvent notifications- Throws:
IOExceptionInterruptedException
-
getCurrentAuditor
Description copied from interface:LedgerAuditorManagerReturn the information regarding the current auditor.- Specified by:
getCurrentAuditorin interfaceLedgerAuditorManager- Returns:
- Throws:
IOExceptionInterruptedException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-