public class AmbariCustomCommandExecutionHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALL_DECOMMISSIONED_HOSTS |
static String |
DECOM_EXCLUDED_HOSTS |
static String |
DECOM_INCLUDED_HOSTS |
static String |
DECOM_SLAVE_COMPONENT |
static String |
DECOMMISSION_COMMAND_NAME |
static String |
HBASE_MARK_DRAINING_ONLY |
protected static String |
INSTALL_COMMAND_NAME |
static String |
IS_ADD_OR_DELETE_SLAVE_REQUEST |
static int |
MIN_STRICT_SERVICE_CHECK_TIMEOUT |
protected static String |
RESTART_COMMAND_NAME |
protected static String |
SERVICE_CHECK_COMMAND_NAME |
protected static String |
START_COMMAND_NAME |
static String |
UPDATE_FILES_ONLY |
Constructor and Description |
---|
AmbariCustomCommandExecutionHelper() |
Modifier and Type | Method and Description |
---|---|
void |
addExecutionCommandsToStage(ActionExecutionContext actionExecutionContext,
Stage stage,
Map<String,String> requestParams,
ExecuteCommandJson executeCommandJson)
Other than Service_Check and Decommission all other commands are pass-through
|
void |
addServiceCheckAction(Stage stage,
String hostname,
String smokeTestRole,
long nowTimestamp,
String serviceName,
String componentName,
Map<String,String> actionParameters,
boolean retryAllowed,
boolean autoSkipFailure,
boolean useLatestConfigs)
Creates and populates service check EXECUTION_COMMAND for host.
|
ExecuteCommandJson |
getCommandJson(ActionExecutionContext actionExecContext,
Cluster cluster,
StackId stackId,
String requestContext)
Helper method to fill execution command information.
|
String |
getStatusCommandTimeout(ServiceInfo serviceInfo) |
boolean |
isTopologyRefreshRequired(String actionName,
String clusterName,
String serviceName)
Determine whether or not the action should trigger a topology refresh.
|
void |
validateAction(ExecuteActionRequest actionRequest)
Validate custom command and throw exception is invalid request.
|
public static final String DECOM_INCLUDED_HOSTS
public static final String DECOM_EXCLUDED_HOSTS
public static final String ALL_DECOMMISSIONED_HOSTS
public static final String DECOM_SLAVE_COMPONENT
public static final String HBASE_MARK_DRAINING_ONLY
public static final String UPDATE_FILES_ONLY
public static final String IS_ADD_OR_DELETE_SLAVE_REQUEST
public static final int MIN_STRICT_SERVICE_CHECK_TIMEOUT
protected static final String SERVICE_CHECK_COMMAND_NAME
protected static final String START_COMMAND_NAME
protected static final String RESTART_COMMAND_NAME
protected static final String INSTALL_COMMAND_NAME
public static final String DECOMMISSION_COMMAND_NAME
public void addServiceCheckAction(Stage stage, String hostname, String smokeTestRole, long nowTimestamp, String serviceName, String componentName, Map<String,String> actionParameters, boolean retryAllowed, boolean autoSkipFailure, boolean useLatestConfigs) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
public void validateAction(ExecuteActionRequest actionRequest) throws org.apache.ambari.server.AmbariException
actionRequest
- the action requestorg.apache.ambari.server.AmbariException
- if the action can not be validatedpublic void addExecutionCommandsToStage(ActionExecutionContext actionExecutionContext, Stage stage, Map<String,String> requestParams, ExecuteCommandJson executeCommandJson) throws org.apache.ambari.server.AmbariException
actionExecutionContext
- received request to execute a commandstage
- the initial stage for task creationrequestParams
- the request paramsexecuteCommandJson
- set of json arguments passed to the requestorg.apache.ambari.server.AmbariException
- if the commands can not be addedpublic ExecuteCommandJson getCommandJson(ActionExecutionContext actionExecContext, Cluster cluster, StackId stackId, String requestContext) throws org.apache.ambari.server.AmbariException
actionExecContext
- the contextcluster
- the cluster for the commandstackId
- the stack id used to load service metainfo.org.apache.ambari.server.AmbariException
public boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName) throws org.apache.ambari.server.AmbariException
actionName
- the action name (i.e. START, RESTART)clusterName
- the cluster nameserviceName
- the service nameorg.apache.ambari.server.AmbariException
public String getStatusCommandTimeout(ServiceInfo serviceInfo) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
Copyright © 2022 Apache Software Foundation. All rights reserved.