public class SliderClient extends AbstractSliderLaunchedService implements RunService, SliderExitCodes, SliderKeys, ErrorStrings, SliderClientAPI
| Modifier and Type | Field and Description |
|---|---|
org.apache.hadoop.yarn.api.records.ApplicationId |
applicationId |
static String |
E_INSTALL_PATH_DOES_NOT_EXIST |
static String |
E_INVALID_APPLICATION_PACKAGE_LOCATION |
static String |
E_INVALID_APPLICATION_TYPE_NAME |
static String |
E_INVALID_INSTALL_LOCATION |
static String |
E_INVALID_INSTALL_PATH |
static String |
E_MUST_BE_A_VALID_JSON_FILE |
static String |
E_NO_RESOURCE_MANAGER |
static String |
E_NO_ZOOKEEPER_QUORUM |
static String |
E_PACKAGE_DOES_NOT_EXIST |
static String |
E_PACKAGE_EXISTS |
static String |
E_UNABLE_TO_READ_SUPPLIED_PACKAGE_FILE |
static String |
E_USE_REPLACEPKG_TO_OVERWRITE |
protected SliderFileSystem |
sliderFileSystem |
_EXIT_CODE_BASE, EXIT_APPLICATION_IN_USE, EXIT_BAD_CONFIGURATION, EXIT_BAD_STATE, EXIT_DEPLOYMENT_FAILED, EXIT_INSTANCE_EXISTS, EXIT_PROCESS_FAILED, EXIT_TIMED_OUT, EXIT_UNKNOWN_INSTANCE, EXIT_YARN_SERVICE_FAILED, EXIT_YARN_SERVICE_FINISHED_WITH_ERROR, EXIT_YARN_SERVICE_KILLEDEXIT_CLIENT_INITIATED_SHUTDOWN, EXIT_COMMAND_ARGUMENT_ERROR, EXIT_CONFLICT, EXIT_CONNECTIVITY_PROBLEM, EXIT_EXCEPTION_THROWN, EXIT_FALSE, EXIT_FORBIDDEN, EXIT_FOUND, EXIT_INTERNAL_ERROR, EXIT_INTERRUPTED, EXIT_MOVED, EXIT_NOT_ACCEPTABLE, EXIT_NOT_FOUND, EXIT_NOT_MODIFIED, EXIT_OPERATION_NOT_ALLOWED, EXIT_OTHER_FAILURE, EXIT_SERVICE_UNAVAILABLE, EXIT_SUCCESS, EXIT_TASK_LAUNCH_FAILURE, EXIT_UNAUTHORIZE, EXIT_UNIMPLEMENTED, EXIT_UNSUPPORTED_VERSION, EXIT_USAGEADDONS_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_WSE_ALREADY_EXISTS, E_APPLICATION_NOT_RUNNING, E_BOTH_IMAGE_AND_HOME_DIR_SPECIFIED, E_CLUSTER_RUNNING, E_CONFIGURATION_DIRECTORY_NOT_FOUND, E_DESTROY_CREATE_RACE_CONDITION, E_FINISHED_APPLICATION, E_INCOMPLETE_CLUSTER_SPEC, E_MISSING_PATH, E_NO_IMAGE_OR_HOME_DIR_SPECIFIED, E_UNKNOWN_INSTANCE, E_UNKNOWN_ROLE, E_UNSTABLE_CLUSTER, ERROR_DUPLICATE_ENTRY, ERROR_NO_ACTION, ERROR_NOT_ENOUGH_ARGUMENTS, ERROR_PARSE_FAILURE, ERROR_TOO_MANY_ARGUMENTS, ERROR_UNKNOWN_ACTION, PRINTF_E_INSTANCE_ALREADY_EXISTS, PRINTF_E_INSTANCE_DIR_ALREADY_EXISTS| Constructor and Description |
|---|
SliderClient()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
actionAmSuicide(String clustername,
ActionAMSuicideArgs args)
AM to commit an asynchronous suicide
|
int |
actionBuild(String clustername,
AbstractClusterBuildingActionArgs buildInfo)
Build up the cluster specification/directory
|
int |
actionClient(ActionClientArgs clientInfo)
Perform client operations such as install or configure
|
int |
actionCreate(String clustername,
ActionCreateArgs createArgs)
Create the cluster -saving the arguments to a specification file first
|
int |
actionDependency(ActionDependencyArgs args)
Upload all Slider AM and agent dependency libraries to HDFS, so that they
do not need to be uploaded with every create call.
|
int |
actionDestroy(String clustername)
Keep this signature for backward compatibility with
force=true by default.
|
int |
actionDestroy(String clustername,
ActionDestroyArgs destroyArgs)
Destroy a cluster.
|
int |
actionDiagnostic(ActionDiagnosticArgs diagnosticArgs)
diagnostic operation
|
String |
actionEcho(String name,
ActionEchoArgs args)
Echo operation (not currently wired up to command line)
|
int |
actionExists(String name,
ActionExistsArgs args) |
int |
actionExists(String name,
boolean checkLive)
Test for a cluster existing probe for a cluster of the given name existing
in the filesystem.
|
int |
actionFlex(String name,
ActionFlexArgs args)
Implement the islive action: probe for a cluster of the given name existing
|
int |
actionFreeze(String clustername,
ActionFreezeArgs freezeArgs)
Stop the cluster
|
int |
actionInstallKeytab(ActionInstallKeytabArgs installKeytabInfo)
Upload keytab to a designated sub-directory of the user home directory
|
int |
actionInstallPkg(ActionInstallPackageArgs installPkgInfo)
Upload application package to user home directory
|
int |
actionKeytab(ActionKeytabArgs keytabInfo)
Manage keytabs leveraged by slider
|
int |
actionKillContainer(String name,
ActionKillContainerArgs args)
Kill a specific container of the cluster
|
int |
actionList(String clustername)
A basic list action to list live instances
|
int |
actionList(String clustername,
ActionListArgs args)
Implement the list action.
|
int |
actionLookup(ActionLookupArgs args)
Implement the lookup action.
|
int |
actionNodes(String instance,
ActionNodesArgs args)
List the nodes in the cluster, possibly filtering by node state or label.
|
int |
actionPackage(ActionPackageArgs actionPackageInfo)
Managing slider application package
|
int |
actionRegistry(ActionRegistryArgs registryArgs)
Registry operation
|
PublishedConfiguration |
actionRegistryGetConfig(ActionRegistryArgs registryArgs)
list configs available for an instance
|
PublishedExports |
actionRegistryGetExport(ActionRegistryArgs registryArgs)
get a specific export group
|
Collection<org.apache.hadoop.registry.client.types.ServiceRecord> |
actionRegistryList(ActionRegistryArgs registryArgs)
Registry operation
|
void |
actionRegistryListConfigsYarn(ActionRegistryArgs registryArgs)
list configs available for an instance
|
void |
actionRegistryListExports(ActionRegistryArgs registryArgs)
list exports available for an instance
|
int |
actionResolve(ActionResolveArgs args)
Registry operation
|
int |
actionStatus(String clustername,
ActionStatusArgs statusArgs)
Status operation
|
int |
actionThaw(String clustername,
ActionThawArgs thaw)
Restore a cluster
|
int |
actionUpdate(String clustername,
AbstractClusterBuildingActionArgs buildInfo)
Update the cluster specification
|
int |
actionUpgrade(String clustername,
ActionUpgradeArgs upgradeArgs)
Upgrade the cluster with a newer version of the application
|
int |
actionVersion()
Version Details
|
org.apache.hadoop.conf.Configuration |
bindArgs(org.apache.hadoop.conf.Configuration config,
String... args)
This is called Before serviceInit is called
|
void |
buildInstanceDefinition(String clustername,
AbstractClusterBuildingActionArgs buildInfo,
boolean overwrite,
boolean liveClusterAllowed)
Build up the AggregateConfiguration for an application instance then
persists it
|
void |
buildInstanceDefinition(String clustername,
AbstractClusterBuildingActionArgs buildInfo,
boolean overwrite,
boolean liveClusterAllowed,
boolean isUpgradeFlow) |
AbstractClientProvider |
createClientProvider(String provider)
Get the provider for this cluster
|
SliderApplicationApi |
createIpcClient()
Create a new IPC client for talking to slider via what follows the REST API.
|
org.apache.hadoop.fs.Path |
createPathThatMustExist(String uri)
Create a path that must exist in the cluster fs
|
String |
createZookeeperNode(String clusterName,
Boolean nameOnly)
Create the zookeeper node associated with the calling user and the cluster
|
String |
createZookeeperNodeInner(String clusterName,
Boolean nameOnly)
Create the zookeeper node associated with the calling user and the cluster
-throwing exceptions on any failure
|
boolean |
deleteZookeeperNode(String clusterName)
Delete the zookeeper node associated with the calling user and the cluster
TODO: YARN registry operations
|
Map<String,SliderInstanceDescription> |
enumSliderInstances(boolean listOnlyInState,
org.apache.hadoop.yarn.api.records.YarnApplicationState minAppState,
org.apache.hadoop.yarn.api.records.YarnApplicationState maxAppState)
Enumerate slider instances for the current user, and the
most recent app report, where available.
|
int |
exec()
Execute the command line
|
int |
flex(String clustername,
Map<String,Integer> roleInstances)
Implement flexing
|
boolean |
forceKillApplication(String reason)
Kill the submitted application via YARN
|
protected Map<String,String> |
generatePlaceholderKeyValueMap(String env) |
protected Map<String,String> |
getAmLaunchEnv(org.apache.hadoop.conf.Configuration config) |
Set<String> |
getApplicationList(String clustername)
Retrieve a list of all live instances.
|
Set<String> |
getApplicationList(String clustername,
ActionListArgs args)
Retrieve a list of application instances satisfying the query criteria.
|
org.apache.hadoop.yarn.api.records.ApplicationReport |
getApplicationReport()
Get the report of a this application
|
org.apache.hadoop.yarn.api.records.ApplicationReport |
getApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId appId) |
List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
getApplications()
Get all YARN applications
|
ClusterDescription |
getClusterDescription()
Connect to the cluster and get its current state
|
ClusterDescription |
getClusterDescription(String clustername)
Connect to a live cluster and get its current state
|
org.apache.hadoop.fs.permission.FsPermission |
getClusterDirectoryPermissions(org.apache.hadoop.conf.Configuration conf) |
List<ContainerInformation> |
getContainers(String name) |
String |
getDeployedClusterName()
Get the name of any deployed cluster
|
AggregateConf |
getLaunchedInstanceDefinition()
The configuration used for deployment (after resolution).
|
AggregateConf |
getLiveInstanceDefinition()
Get the instance definition from the far end
|
org.apache.hadoop.registry.client.api.RegistryOperations |
getRegistryOperations()
Get the registry binding.
|
String |
getUsername() |
YarnAppListClient |
getYarnAppListClient()
Get at the service registry operations
|
protected ZKIntegration |
getZkClient(String clusterName,
String user)
Gets a zookeeper client, returns null if it cannot connect to zookeeper
|
protected void |
initHadoopBinding()
Perform everything needed to init the hadoop binding.
|
boolean |
isApplicationActive(org.apache.hadoop.yarn.api.records.ApplicationReport report)
Is an application active: accepted or running
|
LaunchedApplication |
launchApplication(String clustername,
org.apache.hadoop.fs.Path clusterDirectory,
AggregateConf instanceDefinition,
boolean debugAM) |
List<ClusterNode> |
listClusterNodes(String[] uuids)
Get the details on a list of uuids
|
List<ClusterNode> |
listClusterNodesInRole(String role)
List all nodes in a role.
|
NodeInformationList |
listInstanceNodes(String instance,
ActionNodesArgs args)
List the nodes in the cluster, possibly filtering by node state or label.
|
String[] |
listNodeUUIDsByRole(String role)
List all node UUIDs in a role
|
List<String> |
listRegisteredSliderInstances()
List instances in the registry
|
Map<String,org.apache.hadoop.registry.client.types.ServiceRecord> |
listRegistryInstances()
List instances in the registry for the current user
|
List<org.apache.hadoop.yarn.api.records.ApplicationReport> |
listSliderInstances(String user)
List Slider instances belonging to a specific user.
|
NodeInformationList |
listYarnClusterNodes(ActionNodesArgs args)
List the nodes in the cluster, possibly filtering by node state or label.
|
AggregateConf |
loadInstanceDefinition(String name,
boolean resolved)
Load the instance definition.
|
AggregateConf |
loadInstanceDefinitionUnresolved(String name,
org.apache.hadoop.fs.Path clusterDirectory)
Load the instance definition.
|
AggregateConf |
loadPersistedClusterDescription(String clustername)
Load the persistent cluster description
|
org.apache.hadoop.registry.client.types.ServiceRecord |
lookupServiceRecord(String serviceType,
String id)
Look up a service record of the current user
|
org.apache.hadoop.yarn.api.records.ApplicationReport |
monitorAppToRunning(Duration duration)
Wait for the app to start running (or go past that state)
|
org.apache.hadoop.yarn.api.records.ApplicationReport |
monitorAppToState(org.apache.hadoop.yarn.api.records.YarnApplicationState desiredState,
Duration duration)
Monitor the submitted application for reaching the requested state.
|
protected void |
persistInstanceDefinition(boolean overwrite,
org.apache.hadoop.fs.Path appconfdir,
InstanceBuilder builder) |
static void |
replaceTokens(ConfTree conf,
String userName,
String clusterName) |
org.apache.hadoop.registry.client.types.ServiceRecord |
resolve(String path)
Look up an instance
|
int |
runService()
Launched service execution.
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
void |
setDeployedClusterName(String deployedClusterName) |
String |
toString() |
UnknownApplicationInstanceException |
unknownClusterException(String clustername)
Generate an exception for an unknown cluster
|
protected void |
validateInstanceDefinition(AbstractClientProvider provider,
AggregateConf instanceDefinition,
SliderFileSystem fs)
Validate an instance definition against a provider.
|
void |
verifyBindingsDefined()
Verify that the Resource Manager is configured (on a non-HA cluster).
|
void |
verifyNoLiveClusters(String clustername,
String action)
verify that a live cluster isn't there
|
int |
waitForAppRunning(LaunchedApplication launchedApplication,
int acceptWaitMillis,
int runWaitMillis)
Wait for the launched app to be accepted in the time
and, optionally running.
|
int |
waitForRoleInstanceLive(String role,
long timeout)
Wait for an instance of a named role to be live (or past it in the lifecycle)
|
createRegistryOperationsInstance, lookupZKQuorum, require, requireArgumentSet, startRegistryOperationsServiceaddService, deployChildService, getArgv, isSet, isUnsetstateChangedaddIfService, getServices, removeService, serviceStart, serviceStopclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStopgetServicespublic static final String E_MUST_BE_A_VALID_JSON_FILE
public static final String E_INVALID_INSTALL_LOCATION
public static final String E_UNABLE_TO_READ_SUPPLIED_PACKAGE_FILE
public static final String E_INVALID_APPLICATION_PACKAGE_LOCATION
public static final String E_INVALID_INSTALL_PATH
public static final String E_INSTALL_PATH_DOES_NOT_EXIST
public static final String E_INVALID_APPLICATION_TYPE_NAME
public static final String E_USE_REPLACEPKG_TO_OVERWRITE
public static final String E_PACKAGE_DOES_NOT_EXIST
public static final String E_NO_ZOOKEEPER_QUORUM
public static final String E_NO_RESOURCE_MANAGER
public static final String E_PACKAGE_EXISTS
public org.apache.hadoop.yarn.api.records.ApplicationId applicationId
protected SliderFileSystem sliderFileSystem
public org.apache.hadoop.conf.Configuration bindArgs(org.apache.hadoop.conf.Configuration config,
String... args)
throws Exception
bindArgs in interface RunServicebindArgs in class LaunchedWorkflowCompositeServiceconfig - the initial configuration build up by the
service launcher.args - argument list list of arguments passed to the command line
after any launcher-specific commands have been stripped.init()
operation.Exceptionprotected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.CompositeServiceExceptionpublic int runService()
throws Throwable
exec()
then catches some exceptions and converts them to exit codesrunService in interface RunServicerunService in class LaunchedWorkflowCompositeServiceThrowablepublic int exec()
throws Throwable
Throwable - on a failureprotected void initHadoopBinding()
throws IOException,
SliderException
IOExceptionSliderExceptionpublic boolean deleteZookeeperNode(String clusterName) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic String createZookeeperNode(String clusterName, Boolean nameOnly) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
clusterName - slider application namenameOnly - should the name only be created (i.e. don't create ZK node)ZKIntegration.mkClusterPath(String, String)org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic String createZookeeperNodeInner(String clusterName, Boolean nameOnly) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
clusterName - cluster namenameOnly - create the path, not the nodeZKIntegration.mkClusterPath(String, String)org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected ZKIntegration getZkClient(String clusterName, String user) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnExceptionpublic int actionDestroy(String clustername) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
actionDestroy in interface SliderClientAPIorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionDestroy(String clustername, ActionDestroyArgs destroyArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionDestroy in interface SliderClientAPIorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionAmSuicide(String clustername, ActionAMSuicideArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionAmSuicide in interface SliderClientAPIorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic AbstractClientProvider createClientProvider(String provider) throws SliderException
SliderClientAPIcreateClientProvider in interface SliderClientAPIprovider - the name of the providerSliderException - problems building the providerpublic int actionCreate(String clustername, ActionCreateArgs createArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
clustername - cluster nameorg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsIOException - other problemsBadCommandArgumentsException - bad arguments.public int actionUpgrade(String clustername, ActionUpgradeArgs upgradeArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionUpgrade in interface SliderClientAPIclustername - cluster nameupgradeArgs - the arguments needed to upgrade the clusterorg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsIOException - other problemspublic int actionBuild(String clustername, AbstractClusterBuildingActionArgs buildInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionBuild in interface SliderClientAPIclustername - cluster namebuildInfo - the arguments needed to build the clusterorg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsBadCommandArgumentsException - bad arguments.IOException - other problemspublic int actionKeytab(ActionKeytabArgs keytabInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionKeytab in interface SliderClientAPIkeytabInfo - the arguments needed to manage the keytaborg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsBadCommandArgumentsException - bad arguments.IOException - other problemspublic int actionInstallKeytab(ActionInstallKeytabArgs installKeytabInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionInstallKeytab in interface SliderClientAPIinstallKeytabInfo - the arguments needed to upload the keytaborg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsBadCommandArgumentsException - bad arguments.IOException - other problemspublic int actionInstallPkg(ActionInstallPackageArgs installPkgInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionInstallPkg in interface SliderClientAPIinstallPkgInfo - the arguments needed to upload the packageorg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsBadCommandArgumentsException - bad arguments.IOException - other problemspublic int actionClient(ActionClientArgs clientInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionClient in interface SliderClientAPIclientInfo - the arguments needed for client operationsSliderException - bad arguments.IOException - problems related to package and destination foldersorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic int actionPackage(ActionPackageArgs actionPackageInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionPackage in interface SliderClientAPIactionPackageInfo - the arguments needed to upload, delete or list the packageorg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsBadCommandArgumentsException - bad arguments.IOException - other problemspublic int actionUpdate(String clustername, AbstractClusterBuildingActionArgs buildInfo) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionUpdate in interface SliderClientAPIclustername - cluster namebuildInfo - the arguments needed to update the clusterorg.apache.hadoop.yarn.exceptions.YarnException - Yarn problemsIOException - other problemspublic void buildInstanceDefinition(String clustername, AbstractClusterBuildingActionArgs buildInfo, boolean overwrite, boolean liveClusterAllowed) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
clustername - name of the clusterbuildInfo - the arguments needed to build the clusteroverwrite - true if existing cluster directory can be overwrittenliveClusterAllowed - true if live cluster can be modifiedorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic void buildInstanceDefinition(String clustername, AbstractClusterBuildingActionArgs buildInfo, boolean overwrite, boolean liveClusterAllowed, boolean isUpgradeFlow) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionprotected void persistInstanceDefinition(boolean overwrite,
org.apache.hadoop.fs.Path appconfdir,
InstanceBuilder builder)
throws IOException,
SliderException,
LockAcquireFailedException
public static void replaceTokens(ConfTree conf, String userName, String clusterName) throws IOException
IOExceptionpublic org.apache.hadoop.fs.permission.FsPermission getClusterDirectoryPermissions(org.apache.hadoop.conf.Configuration conf)
public void verifyBindingsDefined()
throws BadCommandArgumentsException
BadCommandArgumentsException - the exception raised on an invalid configpublic AggregateConf loadInstanceDefinitionUnresolved(String name, org.apache.hadoop.fs.Path clusterDirectory) throws IOException, SliderException
name - cluster nameclusterDirectory - cluster dirIOExceptionSliderExceptionUnknownApplicationInstanceException - if the file is not foundpublic AggregateConf loadInstanceDefinition(String name, boolean resolved) throws IOException, SliderException
name - cluster nameresolved - flag to indicate the cluster should be resolvedIOException - IO problemsSliderException - slider explicit issuesUnknownApplicationInstanceException - if the file is not foundpublic LaunchedApplication launchApplication(String clustername, org.apache.hadoop.fs.Path clusterDirectory, AggregateConf instanceDefinition, boolean debugAM) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
clustername - name of the clusterclusterDirectory - cluster dirinstanceDefinition - the instance definitiondebugAM - enable debug AM optionsorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionprotected Map<String,String> getAmLaunchEnv(org.apache.hadoop.conf.Configuration config)
protected Map<String,String> generatePlaceholderKeyValueMap(String env)
public int waitForAppRunning(LaunchedApplication launchedApplication, int acceptWaitMillis, int runWaitMillis) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
If the application
launchedApplication - applicationacceptWaitMillis - time in millis to wait for acceptrunWaitMillis - time in millis to wait for the app to be running.
May be null, in which case no wait takes placeorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic org.apache.hadoop.fs.Path createPathThatMustExist(String uri) throws SliderException, IOException
uri - uri to createFileNotFoundException - if the path does not existSliderExceptionIOExceptionpublic void verifyNoLiveClusters(String clustername, String action) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
clustername - cluster nameaction - SliderException - with exit code EXIT_CLUSTER_LIVE
if a cluster of that name is either live or starting up.IOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic String getUsername() throws IOException
IOExceptionpublic String getDeployedClusterName()
public void setDeployedClusterName(String deployedClusterName)
public org.apache.hadoop.yarn.api.records.ApplicationReport monitorAppToRunning(Duration duration) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
duration - time to waitorg.apache.hadoop.yarn.exceptions.YarnException - YARN or app issuesIOException - IO problemspublic org.apache.hadoop.yarn.api.records.ApplicationReport monitorAppToState(org.apache.hadoop.yarn.api.records.YarnApplicationState desiredState,
Duration duration)
throws org.apache.hadoop.yarn.exceptions.YarnException,
IOException
desiredState - desired state.duration - how long to wait -must be more than 0org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic org.apache.hadoop.yarn.api.records.ApplicationReport getApplicationReport()
throws IOException,
org.apache.hadoop.yarn.exceptions.YarnException
SliderClientAPIgetApplicationReport in interface SliderClientAPIIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic boolean forceKillApplication(String reason) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIforceKillApplication in interface SliderClientAPIorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic List<org.apache.hadoop.yarn.api.records.ApplicationReport> listSliderInstances(String user) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
user - user: "" means all users, null means "default"org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionList(String clustername) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
clustername - cluster nameIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic int actionList(String clustername, ActionListArgs args) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
actionList in interface SliderClientAPIclustername - List out specific instance nameargs - Action list argumentsIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionUnknownApplicationInstanceException - if a specific instance
was named but it was not foundpublic Set<String> getApplicationList(String clustername) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
clustername - cluster name (if looking for a specific live cluster)IOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic Set<String> getApplicationList(String clustername, ActionListArgs args) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
clustername - List out specific instance name (set null for all)args - Action list argumentsIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionUnknownApplicationInstanceException - if a specific instance was named but it was not foundpublic List<ContainerInformation> getContainers(String name) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic Map<String,SliderInstanceDescription> enumSliderInstances(boolean listOnlyInState, org.apache.hadoop.yarn.api.records.YarnApplicationState minAppState, org.apache.hadoop.yarn.api.records.YarnApplicationState maxAppState) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
enumSliderInstances in interface SliderClientAPIlistOnlyInState - boolean to indicate that the instances should
only include those in a YARN state
minAppState <= currentState <= maxAppState minAppState - minimum application state to include in enumeration.maxAppState - maximum application state to includeIOException - Any IO problemorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemspublic boolean isApplicationActive(org.apache.hadoop.yarn.api.records.ApplicationReport report)
report - the application reportpublic int actionFlex(String name, ActionFlexArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
actionFlex in interface SliderClientAPIorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionExists(String name, boolean checkLive) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionExists in interface SliderClientAPIorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionExists(String name, ActionExistsArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionKillContainer(String name, ActionKillContainerArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionKillContainer in interface SliderClientAPIname - cluster nameargs - argumentsorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic String actionEcho(String name, ActionEchoArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionEcho in interface SliderClientAPIname - cluster nameargs - argumentsorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic YarnAppListClient getYarnAppListClient()
public int actionStatus(String clustername, ActionStatusArgs statusArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionStatus in interface SliderClientAPIclustername - cluster namestatusArgs - status argumentsorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionVersion()
SliderClientAPIactionVersion in interface SliderClientAPIpublic int actionFreeze(String clustername, ActionFreezeArgs freezeArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionFreeze in interface SliderClientAPIclustername - cluster namefreezeArgs - arguments to the stoporg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int actionThaw(String clustername, ActionThawArgs thaw) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionThaw in interface SliderClientAPIorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic int flex(String clustername, Map<String,Integer> roleInstances) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
clustername - name of the clusterroleInstances - map of new role instancesorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionprotected void validateInstanceDefinition(AbstractClientProvider provider, AggregateConf instanceDefinition, SliderFileSystem fs) throws SliderException
provider - the provider performing the validationinstanceDefinition - the instance definitionSliderException - if invalid.public AggregateConf loadPersistedClusterDescription(String clustername) throws IOException, SliderException, LockAcquireFailedException
clustername - name of the clusterIOException - any problems loading -including a missing fileSliderExceptionLockAcquireFailedExceptionpublic ClusterDescription getClusterDescription(String clustername) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
clustername - the cluster nameorg.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic ClusterDescription getClusterDescription() throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic String[] listNodeUUIDsByRole(String role) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
role - role name or "" for allIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic List<ClusterNode> listClusterNodesInRole(String role) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
role - component/role to look forIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic List<ClusterNode> listClusterNodes(String[] uuids) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
uuids - uuids to ask forIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic AggregateConf getLiveInstanceDefinition() throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
IOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic int waitForRoleInstanceLive(String role, long timeout) throws WaitTimeoutException, IOException, org.apache.hadoop.yarn.exceptions.YarnException
role - role to look fortimeout - time to waitIOException - IOSliderException - SliderWaitTimeoutException - if the wait timed outorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic UnknownApplicationInstanceException unknownClusterException(String clustername)
clustername - cluster namepublic String toString()
toString in class org.apache.hadoop.service.AbstractServicepublic List<org.apache.hadoop.yarn.api.records.ApplicationReport> getApplications() throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic org.apache.hadoop.yarn.api.records.ApplicationReport getApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId appId)
throws org.apache.hadoop.yarn.exceptions.YarnException,
IOException
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionpublic AggregateConf getLaunchedInstanceDefinition()
public int actionResolve(ActionResolveArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionResolve in interface SliderClientAPIargs - registry Argumentsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - Network or other problemspublic int actionRegistry(ActionRegistryArgs registryArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
SliderClientAPIactionRegistry in interface SliderClientAPIregistryArgs - registry Argumentsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - Network or other problemspublic Collection<org.apache.hadoop.registry.client.types.ServiceRecord> actionRegistryList(ActionRegistryArgs registryArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
registryArgs - registry Argumentsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - Network or other problemspublic int actionDiagnostic(ActionDiagnosticArgs diagnosticArgs)
SliderClientAPIactionDiagnostic in interface SliderClientAPIdiagnosticArgs - diagnostic Argumentspublic void actionRegistryListConfigsYarn(ActionRegistryArgs registryArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
registryArgs - registry Argumentsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - Network or other problemspublic void actionRegistryListExports(ActionRegistryArgs registryArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
registryArgs - registry Argumentsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - Network or other problemspublic PublishedConfiguration actionRegistryGetConfig(ActionRegistryArgs registryArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
registryArgs - registry Argumentsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - Network or other problemsFileNotFoundException - if the config is not foundpublic PublishedExports actionRegistryGetExport(ActionRegistryArgs registryArgs) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
registryArgs - registry Argumentsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemsIOException - Network or other problemsFileNotFoundException - if the config is not foundpublic org.apache.hadoop.registry.client.types.ServiceRecord lookupServiceRecord(String serviceType, String id) throws IOException, SliderException
serviceType - service typeid - instance IDUnknownApplicationInstanceException - no path or service record
at the end of the pathSliderException - other failuresIOException - IO problems or wrapped exceptionspublic org.apache.hadoop.registry.client.types.ServiceRecord resolve(String path) throws IOException, SliderException
path - pathNotFoundException - no path/no service record
at the end of the pathSliderException - other failuresIOException - IO problems or wrapped exceptionspublic Map<String,org.apache.hadoop.registry.client.types.ServiceRecord> listRegistryInstances() throws IOException, SliderException
IOException - Any IO problem ... including no path in the registry
to slider service classes for this userSliderException - other failurespublic List<String> listRegisteredSliderInstances() throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
IOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic org.apache.hadoop.registry.client.api.RegistryOperations getRegistryOperations()
throws SliderException,
IOException
SliderClientAPIgetRegistryOperations in interface SliderClientAPISliderExceptionIOExceptionpublic int actionLookup(ActionLookupArgs args) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
args - Action argumentsIOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionUnknownApplicationInstanceException - if a specific instance
was named but it was not foundpublic int actionDependency(ActionDependencyArgs args) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
SliderClientAPIactionDependency in interface SliderClientAPIIOExceptionSliderExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionpublic NodeInformationList listYarnClusterNodes(ActionNodesArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
listYarnClusterNodes in interface SliderClientAPIargs - argument listIOException - IO problemsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemspublic NodeInformationList listInstanceNodes(String instance, ActionNodesArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
args - argument listIOException - IO problemsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemspublic int actionNodes(String instance, ActionNodesArgs args) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
args - argument listIOException - IO problemsorg.apache.hadoop.yarn.exceptions.YarnException - YARN problemspublic SliderApplicationApi createIpcClient() throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
IOExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.