Class BaseExponentialBackoffRetryFailureDetector
- java.lang.Object
-
- org.apache.pinot.broker.failuredetector.BaseExponentialBackoffRetryFailureDetector
-
- All Implemented Interfaces:
FailureDetector
- Direct Known Subclasses:
ConnectionFailureDetector
@ThreadSafe public abstract class BaseExponentialBackoffRetryFailureDetector extends Object implements FailureDetector
TheBaseExponentialBackoffRetryFailureDetectoris a base failure detector implementation that retries the unhealthy servers with exponential increasing delays.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBaseExponentialBackoffRetryFailureDetector.RetryInfoEncapsulates the retry related information.-
Nested classes/interfaces inherited from interface org.apache.pinot.broker.failuredetector.FailureDetector
FailureDetector.Listener
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.pinot.common.metrics.BrokerMetrics_brokerMetricsprotected List<FailureDetector.Listener>_listenersprotected int_maxRetriesprotected String_nameprotected double_retryDelayFactorprotected DelayQueue<BaseExponentialBackoffRetryFailureDetector.RetryInfo>_retryInfoDelayQueueprotected long_retryInitialDelayNsprotected Thread_retryThreadprotected boolean_runningprotected ConcurrentHashMap<String,BaseExponentialBackoffRetryFailureDetector.RetryInfo>_unhealthyServerRetryInfoMap
-
Constructor Summary
Constructors Constructor Description BaseExponentialBackoffRetryFailureDetector()
-
Method Summary
Modifier and Type Method Description Set<String>getUnhealthyServers()Returns all the unhealthy servers.voidinit(org.apache.pinot.spi.env.PinotConfiguration config, org.apache.pinot.common.metrics.BrokerMetrics brokerMetrics)Initializes the failure detector.voidmarkServerHealthy(String instanceId)Marks a server as healthy.voidmarkServerUnhealthy(String instanceId)Marks a server as unhealthy.voidregister(FailureDetector.Listener listener)Registers a listener to the failure detector.voidstart()Starts the failure detector.voidstop()Stops the failure detector.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.broker.failuredetector.FailureDetector
notifyQueryFinished, notifyQuerySubmitted
-
-
-
-
Field Detail
-
_name
protected final String _name
-
_listeners
protected final List<FailureDetector.Listener> _listeners
-
_unhealthyServerRetryInfoMap
protected final ConcurrentHashMap<String,BaseExponentialBackoffRetryFailureDetector.RetryInfo> _unhealthyServerRetryInfoMap
-
_retryInfoDelayQueue
protected final DelayQueue<BaseExponentialBackoffRetryFailureDetector.RetryInfo> _retryInfoDelayQueue
-
_brokerMetrics
protected org.apache.pinot.common.metrics.BrokerMetrics _brokerMetrics
-
_retryInitialDelayNs
protected long _retryInitialDelayNs
-
_retryDelayFactor
protected double _retryDelayFactor
-
_maxRetries
protected int _maxRetries
-
_retryThread
protected Thread _retryThread
-
_running
protected volatile boolean _running
-
-
Method Detail
-
init
public void init(org.apache.pinot.spi.env.PinotConfiguration config, org.apache.pinot.common.metrics.BrokerMetrics brokerMetrics)Description copied from interface:FailureDetectorInitializes the failure detector.- Specified by:
initin interfaceFailureDetector
-
register
public void register(FailureDetector.Listener listener)
Description copied from interface:FailureDetectorRegisters a listener to the failure detector.- Specified by:
registerin interfaceFailureDetector
-
start
public void start()
Description copied from interface:FailureDetectorStarts the failure detector. Listeners should be registered before starting the failure detector.- Specified by:
startin interfaceFailureDetector
-
markServerHealthy
public void markServerHealthy(String instanceId)
Description copied from interface:FailureDetectorMarks a server as healthy.- Specified by:
markServerHealthyin interfaceFailureDetector
-
markServerUnhealthy
public void markServerUnhealthy(String instanceId)
Description copied from interface:FailureDetectorMarks a server as unhealthy.- Specified by:
markServerUnhealthyin interfaceFailureDetector
-
getUnhealthyServers
public Set<String> getUnhealthyServers()
Description copied from interface:FailureDetectorReturns all the unhealthy servers.- Specified by:
getUnhealthyServersin interfaceFailureDetector
-
stop
public void stop()
Description copied from interface:FailureDetectorStops the failure detector.- Specified by:
stopin interfaceFailureDetector
-
-