public class BrokerFailureDetector extends org.apache.kafka.server.util.ShutdownableThread implements BrokerLivenessListener
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
BrokerFailureDetector(KafkaCruiseControlConfig config,
org.apache.kafka.clients.admin.Admin adminClient,
LoadMonitor loadMonitor,
Queue<Anomaly> anomalies,
org.apache.kafka.common.utils.Time time,
KafkaCruiseControl kafkaCruiseControl,
UpdatableSbcGoalsConfig updatableSbcGoalsConfig,
ApiStatePersistenceStore persistenceStore) |
Modifier and Type | Method and Description |
---|---|
void |
doWork()
This function is called continuously in a loop, till the failure detector
thread is shutdown.
|
Map<Integer,Long> |
failedBrokers()
Package-private for testing
This function is not thread-safe and should not be used otherwise.
|
void |
notifyDeadBrokers(Set<Integer> deadBrokers)
Notify the component of the broker ids
deadBrokers consisting of brokers that just became offline. |
void |
notifyNewAddingBrokers(Set<Integer> newAddingBrokers)
Notify the component of the new broker ids
newAddingBrokers consisting of brokers with zero replicas
that just became online in the cluster and are going to have an addition operation performed on them. |
void |
notifyNewlyOnlineBrokers(Set<Integer> newlyOnlineBrokers)
Notify the component of the broker ids
newlyOnlineBrokers consisting of existing brokers with replicas on them that just became online in the cluster. |
awaitShutdown, heartbeat, initiateShutdown, isRunning, isShutdownComplete, isShutdownInitiated, isThreadFailed, pause, run, shutdown
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public BrokerFailureDetector(KafkaCruiseControlConfig config, org.apache.kafka.clients.admin.Admin adminClient, LoadMonitor loadMonitor, Queue<Anomaly> anomalies, org.apache.kafka.common.utils.Time time, KafkaCruiseControl kafkaCruiseControl, UpdatableSbcGoalsConfig updatableSbcGoalsConfig, ApiStatePersistenceStore persistenceStore)
public void notifyNewAddingBrokers(Set<Integer> newAddingBrokers)
BrokerLivenessListener
newAddingBrokers
consisting of brokers with zero replicas
that just became online in the cluster and are going to have an addition operation performed on them.notifyNewAddingBrokers
in interface BrokerLivenessListener
public void notifyNewlyOnlineBrokers(Set<Integer> newlyOnlineBrokers)
BrokerLivenessListener
newlyOnlineBrokers
consisting of existing brokers with replicas on them that just became online in the cluster.
Note that this does NOT include the set of brokers notified as part of BrokerLivenessListener.notifyNewAddingBrokers(Set)
notifyNewlyOnlineBrokers
in interface BrokerLivenessListener
public void notifyDeadBrokers(Set<Integer> deadBrokers)
BrokerLivenessListener
deadBrokers
consisting of brokers that just became offline.notifyDeadBrokers
in interface BrokerLivenessListener
public Map<Integer,Long> failedBrokers()
public void doWork()
doWork
in class org.apache.kafka.server.util.ShutdownableThread