Actions
Actions are a series of predefined steps that you can use to automate jobs or processes that need to be performed often. For example, you can create an action that automatically kills any application running for more than a particular period of time.
note
- Only an Admin or Data Steward type of user can create, edit, and run an action.
- Actions can change the status of your cluster. Hence, actions should be used and configured with caution.
Click Actions > Actions from the left navigation bar to view the list of actions. The Actions page is displayed.
The following table describes the properties of an action.
Property Name | Description | Example |
---|---|---|
Name | Specifies the name of the action that was provided while creating the action. | Kill_Long_Running_Apps |
Last Status | Specifies whether the very last execution of the action had succeeded or failed. | Succeeded |
Steps | Specifies the number of steps used during creation of the action. | 3 |
Last Execution | Specifies the date and time for when the action was last executed. | 2020-07-28T04:35:11.828Z |
Scheduled | Specifies true or false value depending on whether the execution was scheduled or not. | True |
Cron Entry | Specifies the cron value entered for scheduling the action. | 035*?** |
Enabled | Specifies true or false value depending on the whether the action was enabled or not. | True |
Creating an Action
- Click the Create Connection button from the Actions page. The Create Actions page is displayed.
- Specify a name for the action.
- Specify a description for the action.
- Select the Enabled checkbox to enable the action.
- Select the Scheduled checkbox to schedule the action. The Cron Entry input box is display. Specify a Cron Entry.
- Specify a value in seconds for the initial delay of the action.
- Specify a value in seconds for the intervals between steps.
- Drag and drop steps from the right pane.
- Click the Save button to save your action.
Steps that can be configured
The below table explains the different steps that can be used to configure actions.
Step name | Description |
---|---|
PlaybookExecutor | Executes a playbook available. It finds the hosts from the hostTag and executes the playbooks in those hosts. |
MapInputExecutor | Maps the inputs according to a passed configuration. For example, if a Step outputs a value in key 'A' and the next step needs the same value in key 'B' then this step should be a intermediate step with configuration to map key 'A' -> 'B'. The values are not touched. If a key is not found then that mapping is ignored. |
ApplicationKillExecutor | This executor can kill YARN application using YARN REST apis. If a list of application ids are sent to the executor, then it iterates over the list and kills each one of them. |
IdentityExecutor | Do nothing executor. Passes the inputs to the output. |
EmailExecutor | Uses the templates to create the content of the mail and then sends the mail out. |
FetchMapperCountForYarnAppExecutor | This is a composite executor which uses the MongoExecutor and fetches the running applications where the mappers are greater that specified count passed as input. |
FetchYarnAppExecutor | This is a composite executor which uses the MongoExecutor and ExtractFromInputExecutor to fetch the long running yarn application ids from the database. As the output it returns the list of application_ids which has been started before some time(taken as input) and is still running. |
RandIntExecutor | Random Integer generator. It generates an random positive integer between 0 and a specified value(exclusive). It checks the config first for the upperBound value and the checks the input. Value passed in the input takes the precedence. |
TimeInMillisExecutor | Gets the current time in milliseconds. Adds the offset if provided. Sets The value to the output key. It passes other inputs to the output. |
PrintExecutor | Prints a message passed on to this executor. |
ExtractFromInputExecutor | Sometimes outputs from a executor is a deeply nested structure. While the next Executor may not understand the deep structure as its input. So, this executor should be placed in the middle and should be configured to extract values from the deep nested structure and attach those values to top-level keys. This executor uses https://github.com/json-path/JsonPath for the extraction of the values. Refer to get a guide on how to configure the extraction logic. Example of the configs: { "mappings": { "$.store.book[0].title": "first_title", "$.store.book[0].author": "first_author" } } |
SlackExecutor | Uses the templates to create the content of the message and then post the message to slack group. |
WaitExecutor | Reads 'delay' from the config to get the number of seconds to wait before returning. It passes the context that is passed to it as input. |
HivePartitionMergeExecutor | This executor executes a hive statement to merge partitions. |
Execute Actions
Click Execute in the Actions page to execute an action immediately. To view the execution status, click View Executions. For more information on viewing executions, click view action executions.
Edit Actions
From the actions panel list, click the name of an action you want to edit. The action is displayed in the Actions page. Make your changes and click Save.
Delete Actions
From the Actions list, click from the end of an action row and select Delete to delete the action.