Package org.apache.bookkeeper.meta
Class ZkLedgerAuditorManager
- java.lang.Object
-
- org.apache.bookkeeper.meta.ZkLedgerAuditorManager
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,LedgerAuditorManager
public class ZkLedgerAuditorManager extends java.lang.Object implements LedgerAuditorManager
ZK based implementation of LedgerAuditorManager.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.bookkeeper.meta.LedgerAuditorManager
LedgerAuditorManager.AuditorEvent
-
-
Constructor Summary
Constructors Constructor Description ZkLedgerAuditorManager(org.apache.zookeeper.ZooKeeper zkc, ServerConfiguration conf, StatsLogger statsLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
BookieId
getCurrentAuditor()
Return the information regarding the current auditor.void
tryToBecomeAuditor(java.lang.String bookieId, java.util.function.Consumer<LedgerAuditorManager.AuditorEvent> listener)
Try to become the auditor.
-
-
-
Constructor Detail
-
ZkLedgerAuditorManager
public ZkLedgerAuditorManager(org.apache.zookeeper.ZooKeeper zkc, ServerConfiguration conf, StatsLogger statsLogger)
-
-
Method Detail
-
tryToBecomeAuditor
public void tryToBecomeAuditor(java.lang.String bookieId, java.util.function.Consumer<LedgerAuditorManager.AuditorEvent> listener) throws java.io.IOException, java.lang.InterruptedException
Description copied from interface:LedgerAuditorManager
Try to become the auditor. If there's already another auditor, it will wait until this current instance has become the auditor.- Specified by:
tryToBecomeAuditor
in interfaceLedgerAuditorManager
- Parameters:
bookieId
- the identifier for current bookielistener
- listener that will receive AuditorEvent notifications- Throws:
java.io.IOException
java.lang.InterruptedException
-
getCurrentAuditor
public BookieId getCurrentAuditor() throws java.io.IOException, java.lang.InterruptedException
Description copied from interface:LedgerAuditorManager
Return the information regarding the current auditor.- Specified by:
getCurrentAuditor
in interfaceLedgerAuditorManager
- Returns:
- Throws:
java.io.IOException
java.lang.InterruptedException
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
-