public abstract class AbstractNodeDescriptorsProvider<T> extends org.apache.hadoop.service.AbstractService implements NodeDescriptorsProvider<T>
Modifier and Type | Field and Description |
---|---|
static long |
DISABLE_NODE_DESCRIPTORS_PROVIDER_FETCH_TIMER |
protected Lock |
readLock |
protected TimerTask |
timerTask |
protected Lock |
writeLock |
Constructor and Description |
---|
AbstractNodeDescriptorsProvider(String name) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
cleanUp()
method for subclasses to cleanup.
|
abstract TimerTask |
createTimerTask()
Creates a timer task which be scheduled periodically by the provider,
and the task is responsible to update node descriptors to the provider.
|
Set<T> |
getDescriptors()
Provides the descriptors.
|
long |
getIntervalTime() |
Timer |
getScheduler() |
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
protected void |
serviceStart() |
protected void |
serviceStop()
terminate the timer
|
void |
setDescriptors(Set<T> descriptorsSet)
Sets a set of descriptors to the provider.
|
void |
setIntervalTime(long intervalMS) |
protected void |
verifyConfiguredScript(String scriptPath)
Method used to determine if or not node descriptors fetching script is
configured and whether it is fit to run.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public static final long DISABLE_NODE_DESCRIPTORS_PROVIDER_FETCH_TIMER
protected Lock readLock
protected Lock writeLock
protected TimerTask timerTask
public AbstractNodeDescriptorsProvider(String name)
public long getIntervalTime()
public void setIntervalTime(long intervalMS)
protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
serviceInit
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
protected abstract void cleanUp() throws Exception
Exception
public Set<T> getDescriptors()
NodeDescriptorsProvider
getDescriptors
in interface NodeDescriptorsProvider<T>
public void setDescriptors(Set<T> descriptorsSet)
NodeDescriptorsProvider
setDescriptors
in interface NodeDescriptorsProvider<T>
descriptorsSet
- node descriptors.protected void verifyConfiguredScript(String scriptPath) throws IOException
IOException
public Timer getScheduler()
public abstract TimerTask createTimerTask()
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.