Class Auditor
java.lang.Object
org.apache.bookkeeper.replication.Auditor
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected AuditorBookieCheckTaskprotected AuditorTaskprotected AuditorTaskprotected AuditorTaskprotected Future<?> -
Constructor Summary
ConstructorsConstructorDescriptionAuditor(String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, BookKeeperAdmin admin, boolean ownAdmin, StatsLogger statsLogger) Auditor(String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, StatsLogger statsLogger) Auditor(String bookieIdentifier, ServerConfiguration conf, StatsLogger statsLogger) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()(package private) static BookKeeper(package private) static BookKeepercreateBookKeeperClient(ServerConfiguration conf, StatsLogger statsLogger) (package private) static BookKeeper(package private) Future<?>(package private) intbooleanReturn true if auditor is running otherwise return false.voidshutdown()Shutdown the auditor.voidstart()(package private) Future<?>protected void(package private) Future<?>
-
Field Details
-
auditTask
-
auditorBookieCheckTask
-
auditorCheckAllLedgersTask
-
auditorPlacementPolicyCheckTask
-
auditorReplicasCheckTask
-
-
Constructor Details
-
Auditor
public Auditor(String bookieIdentifier, ServerConfiguration conf, StatsLogger statsLogger) throws ReplicationException.UnavailableException -
Auditor
public Auditor(String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, StatsLogger statsLogger) throws ReplicationException.UnavailableException -
Auditor
public Auditor(String bookieIdentifier, ServerConfiguration conf, BookKeeper bkc, boolean ownBkc, BookKeeperAdmin admin, boolean ownAdmin, StatsLogger statsLogger) throws ReplicationException.UnavailableException
-
-
Method Details
-
createBookKeeperClient
static BookKeeper createBookKeeperClient(ServerConfiguration conf) throws InterruptedException, IOException - Throws:
InterruptedExceptionIOException
-
createBookKeeperClient
static BookKeeper createBookKeeperClient(ServerConfiguration conf, StatsLogger statsLogger) throws InterruptedException, IOException - Throws:
InterruptedExceptionIOException
-
submitAuditTask
Future<?> submitAuditTask() -
submitLostBookieRecoveryDelayChangedEvent
Future<?> submitLostBookieRecoveryDelayChangedEvent() -
start
public void start() -
submitBookieCheckTask
protected void submitBookieCheckTask() -
getAvailableBookies
- Throws:
BKException
-
shutdown
public void shutdown()Shutdown the auditor. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
isRunning
public boolean isRunning()Return true if auditor is running otherwise return false.- Returns:
- auditor status
-
getLostBookieRecoveryDelayBeforeChange
int getLostBookieRecoveryDelayBeforeChange() -
getAuditTask
Future<?> getAuditTask()
-