@InterfaceAudience.Public
@InterfaceStability.Unstable
public class AllocationFileLoaderService
extends org.apache.hadoop.service.AbstractService
Modifier and Type | Class and Description |
---|---|
static interface |
AllocationFileLoaderService.Listener |
Modifier and Type | Field and Description |
---|---|
static long |
ALLOC_RELOAD_INTERVAL_MS
Time to wait between checks of the allocation file
|
static long |
ALLOC_RELOAD_WAIT_MS
Time to wait after the allocation has been modified before reloading it
(this is done to prevent loading a file that hasn't been fully written).
|
static org.apache.commons.logging.Log |
LOG |
static long |
THREAD_JOIN_TIMEOUT_MS |
Constructor and Description |
---|
AllocationFileLoaderService() |
AllocationFileLoaderService(org.apache.hadoop.yarn.util.Clock clock) |
Modifier and Type | Method and Description |
---|---|
File |
getAllocationFile(org.apache.hadoop.conf.Configuration conf)
Path to XML file containing allocations.
|
void |
reloadAllocations()
Updates the allocation list from the allocation config file.
|
void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
void |
serviceStart() |
void |
serviceStop() |
void |
setReloadListener(AllocationFileLoaderService.Listener reloadListener) |
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 org.apache.commons.logging.Log LOG
public static final long ALLOC_RELOAD_INTERVAL_MS
public static final long ALLOC_RELOAD_WAIT_MS
public static final long THREAD_JOIN_TIMEOUT_MS
public AllocationFileLoaderService()
public AllocationFileLoaderService(org.apache.hadoop.yarn.util.Clock clock)
public void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
serviceInit
in class org.apache.hadoop.service.AbstractService
Exception
public void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
public void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
public File getAllocationFile(org.apache.hadoop.conf.Configuration conf)
public void setReloadListener(AllocationFileLoaderService.Listener reloadListener)
public void reloadAllocations() throws IOException, ParserConfigurationException, SAXException, AllocationConfigurationException
IOException
- if the config file cannot be read.AllocationConfigurationException
- if allocations are invalid.ParserConfigurationException
- if XML parser is misconfigured.SAXException
- if config file is malformed.Copyright © 2017 Apache Software Foundation. All Rights Reserved.