Class Auditor
- java.lang.Object
-
- org.apache.bookkeeper.replication.Auditor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Auditor extends java.lang.Object implements java.lang.AutoCloseable
Auditor is a single entity in the entire Bookie cluster and will be watching all the bookies under 'ledgerrootpath/available' zkpath. When any of the bookie failed or disconnected from zk, he will start initiating the re-replication activities by keeping all the corresponding ledgers of the failed bookie as underreplicated znode in zk.TODO: eliminate the direct usage of zookeeper here {@link https://github.com/apache/bookkeeper/issues/1332}
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditorBookieCheckTask
auditorBookieCheckTask
protected AuditorTask
auditorCheckAllLedgersTask
protected AuditorTask
auditorPlacementPolicyCheckTask
protected AuditorTask
auditorReplicasCheckTask
protected java.util.concurrent.Future<?>
auditTask
-
Constructor Summary
Constructors Constructor Description Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, BookKeeperAdmin admin, boolean ownAdmin, StatsLogger statsLogger)
Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, StatsLogger statsLogger)
Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, StatsLogger statsLogger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
(package private) static BookKeeper
createBookKeeperClient(ServerConfiguration conf)
(package private) static BookKeeper
createBookKeeperClient(ServerConfiguration conf, StatsLogger statsLogger)
(package private) static BookKeeper
createBookKeeperClientThrowUnavailableException(ServerConfiguration conf)
(package private) java.util.concurrent.Future<?>
getAuditTask()
protected java.util.List<java.lang.String>
getAvailableBookies()
(package private) int
getLostBookieRecoveryDelayBeforeChange()
boolean
isRunning()
Return true if auditor is running otherwise return false.void
shutdown()
Shutdown the auditor.void
start()
(package private) java.util.concurrent.Future<?>
submitAuditTask()
protected void
submitBookieCheckTask()
(package private) java.util.concurrent.Future<?>
submitLostBookieRecoveryDelayChangedEvent()
-
-
-
Field Detail
-
auditTask
protected volatile java.util.concurrent.Future<?> auditTask
-
auditorBookieCheckTask
protected AuditorBookieCheckTask auditorBookieCheckTask
-
auditorCheckAllLedgersTask
protected AuditorTask auditorCheckAllLedgersTask
-
auditorPlacementPolicyCheckTask
protected AuditorTask auditorPlacementPolicyCheckTask
-
auditorReplicasCheckTask
protected AuditorTask auditorReplicasCheckTask
-
-
Constructor Detail
-
Auditor
public Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, StatsLogger statsLogger) throws ReplicationException.UnavailableException
-
Auditor
public Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, StatsLogger statsLogger) throws ReplicationException.UnavailableException
-
Auditor
public Auditor(java.lang.String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, BookKeeperAdmin admin, boolean ownAdmin, StatsLogger statsLogger) throws ReplicationException.UnavailableException
-
-
Method Detail
-
createBookKeeperClient
static BookKeeper createBookKeeperClient(ServerConfiguration conf) throws java.lang.InterruptedException, java.io.IOException
- Throws:
java.lang.InterruptedException
java.io.IOException
-
createBookKeeperClient
static BookKeeper createBookKeeperClient(ServerConfiguration conf, StatsLogger statsLogger) throws java.lang.InterruptedException, java.io.IOException
- Throws:
java.lang.InterruptedException
java.io.IOException
-
createBookKeeperClientThrowUnavailableException
static BookKeeper createBookKeeperClientThrowUnavailableException(ServerConfiguration conf) throws ReplicationException.UnavailableException
-
submitAuditTask
java.util.concurrent.Future<?> submitAuditTask()
-
submitLostBookieRecoveryDelayChangedEvent
java.util.concurrent.Future<?> submitLostBookieRecoveryDelayChangedEvent()
-
start
public void start()
-
submitBookieCheckTask
protected void submitBookieCheckTask()
-
getAvailableBookies
protected java.util.List<java.lang.String> getAvailableBookies() throws BKException
- Throws:
BKException
-
shutdown
public void shutdown()
Shutdown the auditor.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
isRunning
public boolean isRunning()
Return true if auditor is running otherwise return false.- Returns:
- auditor status
-
getLostBookieRecoveryDelayBeforeChange
int getLostBookieRecoveryDelayBeforeChange()
-
getAuditTask
java.util.concurrent.Future<?> getAuditTask()
-
-