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, waitForServiceToStoppublic 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.AbstractServiceExceptionprotected void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionprotected void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionprotected abstract void cleanUp()
throws Exception
Exceptionpublic Set<T> getDescriptors()
NodeDescriptorsProvidergetDescriptors in interface NodeDescriptorsProvider<T>public void setDescriptors(Set<T> descriptorsSet)
NodeDescriptorsProvidersetDescriptors in interface NodeDescriptorsProvider<T>descriptorsSet - node descriptors.protected void verifyConfiguredScript(String scriptPath) throws IOException
IOExceptionpublic Timer getScheduler()
public abstract TimerTask createTimerTask()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.