public abstract class AbstractProviderService extends WorkflowSequenceService implements ProviderCore, SliderKeys, ProviderService
| Modifier and Type | Field and Description |
|---|---|
protected StateAccessForProviders |
amState |
protected URL |
amWebAPI |
protected QueueAccess |
queueAccess |
protected AgentRestOperations |
restOps |
protected YarnRegistryViewForProviders |
yarnRegistry |
ADDONS_DIR, AGENT_TAR, AM_DIR_PREFIX, AM_FILTER_NAME, APP_CONTAINER_HEARTBEAT_INTERVAL_SEC, APP_CONTAINER_RELEASE_TIMEOUT, APP_DEF_DIR, APP_TYPE, APP_VERSION, APP_VERSION_UNKNOWN, CLUSTER_DIRECTORY, COMP_KEYSTORE_PASSWORD_ALIAS_DEFAULT, COMP_KEYSTORE_PASSWORD_ALIAS_KEY, COMP_KEYSTORE_PASSWORD_PROPERTY_KEY, COMP_STORES_REQUIRED_KEY, COMP_TRUSTSTORE_PASSWORD_ALIAS_DEFAULT, COMP_TRUSTSTORE_PASSWORD_ALIAS_KEY, COMP_TRUSTSTORE_PASSWORD_PROPERTY_KEY, COMPONENT_AM, CRT_FILE_NAME, CRT_PASS_FILE_NAME, CSR_FILE_NAME, DATA_DIR_NAME, DEFAULT_APP_PKG, DEFAULT_GC_OPTS, DEFAULT_JVM_HEAP, DEFAULT_YARN_MEMORY, GENERATED_CONF_DIR_NAME, GSON_JAR, HADOOP_PROXY_USER, HADOOP_USER_NAME, HDP_VERSION_PROP_NAME, HISTORY_DIR_NAME, HISTORY_FILENAME_CREATION_PATTERN, HISTORY_FILENAME_GLOB_PATTERN, HISTORY_FILENAME_MATCH_PATTERN, HISTORY_FILENAME_PREFIX, HISTORY_FILENAME_SUFFIX, INFRA_DIR_NAME, JCOMMANDER_JAR, JVM_ENABLE_ASSERTIONS, JVM_ENABLE_SYSTEM_ASSERTIONS, JVM_FORCE_IPV4, JVM_JAVA_HEADLESS, KEY_ALLOWED_PORT_RANGE, KEY_AM_ALLOWED_PORT_RANGE, KEY_FILE_NAME, KEYSTORE_FILE_NAME, KEYTAB_DIR, LOCAL_TARBALL_INSTALL_SUBDIR, LOG4J_PROP_FILENAME, LOG4J_SERVER_PROP_FILENAME, PACKAGE_DIRECTORY, PASS_LEN, PROPAGATE_RESOURCE_OPTION, PROPAGATED_CONF_DIR_NAME, PROPERTY_CONF_DIR, PROPERTY_LIB_DIR, PYTHONPATH, ROLE_AM_PRIORITY_INDEX, SECURITY_DIR, SLIDER_BASE_DIRECTORY, SLIDER_CLASSPATH_EXTRA, SLIDER_CLIENT_XML, SLIDER_DEPENDENCY_DIR, SLIDER_DEPENDENCY_DIR_PERMISSIONS, SLIDER_DEPENDENCY_HDP_PARENT_DIR, SLIDER_DEPENDENCY_LOCALIZED_DIR_LINK, SLIDER_DEPENDENCY_TAR_GZ_FILE_EXT, SLIDER_DEPENDENCY_TAR_GZ_FILE_NAME, SLIDER_JAR, SLIDER_JVM_OPTS, SLIDER_PASSPHRASE, SLIDER_SERVER_XML, SLIDER_XML, SNAPSHOT_CONF_DIR_NAME, STDERR_AM, STDOUT_AM, SUBMITTED_CONF_DIR, SYSPROP_LOG_DIR, SYSPROP_LOG4J_CONFIGURATION, TMP_DIR_PREFIX, TMP_LOGDIR_PREFIX, YARN_CONTAINER_PATHCLUSTER_DIRECTORY_PERMISSIONS, DATA_DIRECTORY_PERMISSIONS, DEFAULT_CLUSTER_DIRECTORY_PERMISSIONS, DEFAULT_DATA_DIRECTORY_PERMISSIONS, DEFAULT_YARN_QUEUE, DEFAULT_YARN_QUEUE_PRIORITY, DFS_DATANODE_KERBEROS_PRINCIPAL_KEY, DFS_NAMENODE_DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT, DFS_NAMENODE_DELEGATION_KEY_UPDATE_INTERVAL_KEY, DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_DEFAULT, DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_KEY, DFS_NAMENODE_DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT, DFS_NAMENODE_DELEGATION_TOKEN_MAX_LIFETIME_KEY, DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT, DFS_NAMENODE_DELEGATION_TOKEN_RENEW_INTERVAL_KEY, DFS_NAMENODE_DU_RESERVED_KEY, DFS_NAMENODE_KERBEROS_PRINCIPAL_KEY, DFS_NAMENODE_KEYTAB_FILE_KEY, FS_DEFAULT_NAME_CLASSIC, HADOOP_HTTP_FILTER_INITIALIZERS, IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH, IPC_CLIENT_RETRY_POLICY_ENABLED_DEFAULT, IPC_CLIENT_RETRY_POLICY_SPEC_DEFAULT, KEY_AM_KEYTAB_LOCAL_PATH, KEY_AM_LAUNCH_ENV, KEY_AM_LOGIN_KEYTAB_NAME, KEY_AM_LOGIN_KEYTAB_REQUIRED, KEY_AM_RESTART_LIMIT, KEY_HDFS_KEYTAB_DIR, KEY_IPC_CLIENT_RETRY_POLICY_ENABLED, KEY_IPC_CLIENT_RETRY_POLICY_SPEC, KEY_KERBEROS_PRINCIPAL, KEY_KEYSTORE_LOCATION, KEY_KEYTAB_PRINCIPAL, KEY_PROTOCOL_ACL, KEY_PROVIDER, KEY_SECURITY_ENABLED, KEY_SLIDER_AM_DEPENDENCY_CHECKS_DISABLED, KEY_SLIDER_BASE_PATH, KEY_TEMPLATE_ORIGIN, KEY_YARN_QUEUE, KEY_YARN_QUEUE_PRIORITY, PREFIX_PROVIDER, PYTHON_EXECUTABLE_PATH, REGISTRY_PATH, REGISTRY_ZK_QUORUM, X_DEV_INSECURE_DEFAULT, X_DEV_INSECURE_REQUIRED, X_DEV_INSECURE_WS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractProviderService(String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addContainerRequest(org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest req)
Issue a container request
|
void |
applyInitialRegistryDefinitions(URL amWebURI,
URL agentOpsURI,
URL agentStatusURI,
org.apache.hadoop.registry.client.types.ServiceRecord serviceRecord)
Prior to going live -register the initial service registry data
|
void |
bind(StateAccessForProviders stateAccessor,
QueueAccess queueAccess,
List<org.apache.hadoop.yarn.api.records.Container> liveContainers) |
void |
bindToYarnRegistry(YarnRegistryViewForProviders yarnRegistry)
Bind to the YARN registry
|
void |
buildEndpointDetails(Map<String,String> details)
Build up the endpoint details for this service
|
Map<String,String> |
buildMonitorDetails(ClusterDescription clusterDesc)
Build a map of data intended for the AM webapp that is specific
about this provider.
|
ForkedProcessService |
buildProcess(String name,
Map<String,String> env,
List<String> commands) |
Map<String,String> |
buildProviderStatus() |
int |
cancelContainerRequests(org.apache.hadoop.yarn.api.records.Priority priority1,
org.apache.hadoop.yarn.api.records.Priority priority2,
int count)
Remove a container request
|
void |
cancelSingleRequest(org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest request)
Cancel a specific request
|
ContainerReleaseSelector |
createContainerReleaseSelector()
Create the container release selector for this provider...any policy
can be implemented
|
boolean |
exec(AggregateConf instanceDefinition,
File confDir,
Map<String,String> env,
ProviderCompleted execInProgress)
override point to allow a process to start executing in this container
|
void |
execute(List<AbstractRMOperation> operations)
Execute an entire list of operations
|
AgentRestOperations |
getAgentRestOperations()
Returns the agent rest operations interface.
|
StateAccessForProviders |
getAmState() |
org.apache.hadoop.conf.Configuration |
getConf() |
int |
getExitCode()
Method to get the exit code
|
protected ForkedProcessService |
getFPSFromParentService(ServiceParent serviceParent)
Given a parent service, find the one that is a forked process
|
String |
getHumanName()
Get a human friendly name for web UIs and messages
|
QueueAccess |
getQueueAccess() |
YarnRegistryViewForProviders |
getYarnRegistry() |
void |
initializeApplicationConfiguration(AggregateConf instanceDefinition,
SliderFileSystem fileSystem)
No-op implementation of this method.
|
boolean |
isSupportedRole(String role)
Scan through the roles and see if it is supported.
|
protected ForkedProcessService |
latestProcess()
Return the latest forked process service that ran
|
protected org.apache.hadoop.conf.Configuration |
loadProviderConfigurationInformation(File confDir,
String siteXMLFilename)
Load a specific XML configuration file for the provider config
|
protected void |
maybeStartCommandSequence()
if we are already running, start this service
|
void |
notifyContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Notify the providers of container completion
|
protected ForkedProcessService |
queueCommand(String name,
Map<String,String> env,
List<String> commands)
Create a new forked process service with the given
name, environment and command list -then add it as a child
for execution in the sequence.
|
void |
rebuildContainerDetails(List<org.apache.hadoop.yarn.api.records.Container> liveContainers,
String applicationId,
Map<Integer,ProviderRole> providerRoles)
No-op implementation of this method.
|
void |
releaseAssignedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Release an assigned container
|
void |
setAgentRestOperations(AgentRestOperations agentRestOperations) |
void |
setAmState(StateAccessForProviders amState) |
void |
validateApplicationConfiguration(AggregateConf instance,
File confDir,
boolean secure)
No-op implementation of this method.
|
addService, getActiveService, getPreviousService, getServices, onServiceCompleted, serviceStart, serviceStop, setStopIfNoChildServicesAtStartup, startNextService, stateChanged, toStringclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbuildContainerLaunchContext, loadProviderConfigurationInformationgetName, getRoles, validateInstanceDefinitionprotected StateAccessForProviders amState
protected AgentRestOperations restOps
protected URL amWebAPI
protected YarnRegistryViewForProviders yarnRegistry
protected QueueAccess queueAccess
protected AbstractProviderService(String name)
public org.apache.hadoop.conf.Configuration getConf()
getConf in interface ProviderCorepublic StateAccessForProviders getAmState()
public QueueAccess getQueueAccess()
public void setAmState(StateAccessForProviders amState)
public String getHumanName()
ProviderServicegetHumanName in interface ProviderServicepublic void bind(StateAccessForProviders stateAccessor, QueueAccess queueAccess, List<org.apache.hadoop.yarn.api.records.Container> liveContainers)
bind in interface ProviderServicepublic void bindToYarnRegistry(YarnRegistryViewForProviders yarnRegistry)
ProviderServicebindToYarnRegistry in interface ProviderServiceyarnRegistry - YARN registrypublic YarnRegistryViewForProviders getYarnRegistry()
public AgentRestOperations getAgentRestOperations()
ProviderServicegetAgentRestOperations in interface ProviderServicepublic void notifyContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerId containerId)
ProviderServicenotifyContainerCompleted in interface ProviderServicecontainerId - container that has completedpublic void setAgentRestOperations(AgentRestOperations agentRestOperations)
protected org.apache.hadoop.conf.Configuration loadProviderConfigurationInformation(File confDir, String siteXMLFilename) throws BadCommandArgumentsException, IOException
confDir - configuration directorysiteXMLFilename - provider-specific filenameBadCommandArgumentsException - argument problemsIOException - IO problemspublic void initializeApplicationConfiguration(AggregateConf instanceDefinition, SliderFileSystem fileSystem) throws IOException, SliderException
initializeApplicationConfiguration in interface ProviderServiceIOExceptionSliderExceptionpublic void validateApplicationConfiguration(AggregateConf instance, File confDir, boolean secure) throws IOException, SliderException
validateApplicationConfiguration in interface ProviderServiceinstance - clusterSpecificationconfDir - configuration directorysecure - flag to indicate that secure mode checks must existIOException - IO problemsnSliderException - any failurepublic boolean isSupportedRole(String role)
isSupportedRole in interface ProviderServicerole - role to look forpublic boolean exec(AggregateConf instanceDefinition, File confDir, Map<String,String> env, ProviderCompleted execInProgress) throws IOException, SliderException
exec in interface ProviderServiceinstanceDefinition - cluster descriptionconfDir - configuration directoryenv - environmentexecInProgress - the callback for the exec eventsIOExceptionSliderExceptionpublic int getExitCode()
ExitCodeProvidergetExitCode in interface ExitCodeProviderprotected ForkedProcessService latestProcess()
protected ForkedProcessService getFPSFromParentService(ServiceParent serviceParent)
serviceParent - parentprotected void maybeStartCommandSequence()
protected ForkedProcessService queueCommand(String name, Map<String,String> env, List<String> commands) throws IOException, SliderException
name - command nameenv - environmentcommands - command lineIOExceptionSliderExceptionpublic ForkedProcessService buildProcess(String name, Map<String,String> env, List<String> commands) throws IOException, SliderException
IOExceptionSliderExceptionpublic Map<String,String> buildProviderStatus()
buildProviderStatus in interface ProviderServicepublic Map<String,String> buildMonitorDetails(ClusterDescription clusterDesc)
ProviderServicebuildMonitorDetails in interface ProviderServicepublic void buildEndpointDetails(Map<String,String> details)
ProviderServicebuildEndpointDetails in interface ProviderServicepublic void applyInitialRegistryDefinitions(URL amWebURI, URL agentOpsURI, URL agentStatusURI, org.apache.hadoop.registry.client.types.ServiceRecord serviceRecord) throws IOException
ProviderServiceapplyInitialRegistryDefinitions in interface ProviderServiceamWebURI - URL to the AM. This may be proxied, so use relative pathsagentOpsURI - URI for agent operations. This will not be proxiedagentStatusURI - URI For agent status. Again: no proxyserviceRecord - service record to build upIOExceptionpublic ContainerReleaseSelector createContainerReleaseSelector()
createContainerReleaseSelector in interface ProviderServicepublic void releaseAssignedContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
RMOperationHandlerActionsreleaseAssignedContainer in interface RMOperationHandlerActionscontainerId - containerpublic void addContainerRequest(org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest req)
RMOperationHandlerActionsaddContainerRequest in interface RMOperationHandlerActionspublic void cancelSingleRequest(org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest request)
RMOperationHandlerActionscancelSingleRequest in interface RMOperationHandlerActionsrequest - request to cancelpublic int cancelContainerRequests(org.apache.hadoop.yarn.api.records.Priority priority1,
org.apache.hadoop.yarn.api.records.Priority priority2,
int count)
RMOperationHandlerActionscancelContainerRequests in interface RMOperationHandlerActionspriority1 - priority to remove atpriority2 - second priority to targetcount - number to removepublic void execute(List<AbstractRMOperation> operations)
RMOperationHandlerActionsexecute in interface RMOperationHandlerActionsoperations - opspublic void rebuildContainerDetails(List<org.apache.hadoop.yarn.api.records.Container> liveContainers, String applicationId, Map<Integer,ProviderRole> providerRoles)
rebuildContainerDetails in interface ProviderServiceCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.