java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.service.Service, NodeDescriptorsProvider<T>NodeAttributesProvider, NodeLabelsProviderpublic abstract class AbstractNodeDescriptorsProvider<T> extends org.apache.hadoop.service.AbstractService implements NodeDescriptorsProvider<T>
| Modifier and Type | Field | Description |
|---|---|---|
static long |
DISABLE_NODE_DESCRIPTORS_PROVIDER_FETCH_TIMER |
|
protected java.util.concurrent.locks.Lock |
readLock |
|
protected java.util.TimerTask |
timerTask |
|
protected java.util.concurrent.locks.Lock |
writeLock |
| Constructor | Description |
|---|---|
AbstractNodeDescriptorsProvider(java.lang.String name) |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract void |
cleanUp() |
method for subclasses to cleanup.
|
abstract java.util.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.
|
java.util.Set<T> |
getDescriptors() |
Provides the descriptors.
|
long |
getIntervalTime() |
|
java.util.Timer |
getScheduler() |
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
|
protected void |
serviceStart() |
|
protected void |
serviceStop() |
terminate the timer
|
void |
setDescriptors(java.util.Set<T> descriptorsSet) |
Sets a set of descriptors to the provider.
|
void |
setIntervalTime(long intervalMS) |
|
protected void |
verifyConfiguredScript(java.lang.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 java.util.concurrent.locks.Lock readLock
protected java.util.concurrent.locks.Lock writeLock
protected java.util.TimerTask timerTask
public AbstractNodeDescriptorsProvider(java.lang.String name)
public long getIntervalTime()
public void setIntervalTime(long intervalMS)
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws java.lang.Exception
serviceInit in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected void serviceStart()
throws java.lang.Exception
serviceStart in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected void serviceStop()
throws java.lang.Exception
serviceStop in class org.apache.hadoop.service.AbstractServicejava.lang.Exceptionprotected abstract void cleanUp()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Set<T> getDescriptors()
NodeDescriptorsProvidergetDescriptors in interface NodeDescriptorsProvider<T>public void setDescriptors(java.util.Set<T> descriptorsSet)
NodeDescriptorsProvidersetDescriptors in interface NodeDescriptorsProvider<T>descriptorsSet - node descriptors.protected void verifyConfiguredScript(java.lang.String scriptPath)
throws java.io.IOException
java.io.IOException@VisibleForTesting public java.util.Timer getScheduler()
public abstract java.util.TimerTask createTimerTask()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.