Metadata Policies
- Add multi-valued managed metadata of all types (Boolean, date, enumeration, number, and text), and custom metadata such as tags and key-value pairs.
- Run a command, such as moving an HDFS entity to another location or moving an HDFS entity to HDFS trash.
If a policy creator configures a command action to move a directory and the creator does not have access to the directory, the action fails. Similarly, if a policy creator does not have access to a file in the directory, the action fails. To ensure that command actions do not fail, policies containing command actions should be created by data stewards, who are members of a user group that has the appropriate access to HDFS files.
- Move an entity to a target path or to trash.
- Send a message to a JMS message queue. The JSON format message contains the metadata of the entity to which the policy applies and the message text specified in the policy:
{"entity":entity_properties, "userMessage":"some message text"}
To send a message to a JMS message queue, you must configure the JMS server properties.
A policy is run as the user who created the policy, in the home directory of the user who created the policy. To change who a policy runs as, log into Navigator as the new user you want to run the policy as, clone the policy as the new user, and then delete or disable the old policy.
Continue reading:
Creating Policies
Minimum Required Role: Policy Administrator (also provided by Full Administrator)
- Start and log in to the Cloudera Navigator data management component UI.
- Depending on the starting point, do one of the following:
Action Procedure Policies page - Click the Policies tab.
- Click New Policy.
Search results page - Select .
- In the Status field, check the Enable checkbox.
- Enter a name for the policy.
- Specify the search query that defines the class of entities to which the policy applies. If you arrive at the Policies page by clicking a search result, the query property is populated with the query that generated the result. To display a list of entities that satisfy a search query, click the Test Query link.
- Specify an optional description for the policy.
- If you use policy expressions in properties that support expressions, specify required imports in the Import Statements field. See Metadata Policy Expression Examples.
- Choose the schedule for applying the policy:
- On Change - When the entities matching the search string change.
- Immediate - When the policy is created.
- Once - At the time specified in the Start Time field.
- Recurring - At recurring times specified by the Start and End Time fields at the interval specified in the Interval field.
- Date - Click the down arrow to display a calendar and select a date, or click a field and click the spinner arrows or press the up and down arrow keys.
- Time - Click the hour, minute, and AM/PM fields and click the spinner arrows or press the up and down arrow keys to specify the value.
- Move between fields by clicking fields or by using the right and left arrow keys.
- Follow the appropriate procedure for the actions performed by the policy:
- Metadata Assignments: Specify the custom metadata or managed metadata to be assigned. Optionally, you can specify a Java policy expression for fields that support expressions by checking the Expression checkbox. The following fields support expressions:
- Name
- Description
- Managed Metadata
- Key-Value Pairs
- Command Actions: Select
Command actions are supported only for HDFS entities. If you configure a command action for unsupported entities, a runtime error is logged when the policy runs.
or . For a move, specify the location to move the
entity to in the Target Path field. If you specify multiple actions, they are run in the order in which they are specified.
- JMS Notifications: If not already configured, configure a JMS server and queue. Specify the queue name and message. Optionally, check the Expression checkbox and specify a policy expression for the message.
- Metadata Assignments: Specify the custom metadata or managed metadata to be assigned. Optionally, you can specify a Java policy expression for fields that support expressions by checking the Expression checkbox. The following fields support expressions:
- Click Save.
Viewing Policies
Minimum Required Role: Policy Viewer (also provided by Policy Administrator, Full Administrator)
- Start and log in to the Cloudera Navigator data management component UI.
- Click the Policies tab.
- In a policy row, click a policy name link or select
You can also edit, copy, or delete a policy from the policy details page by clicking the Actions button.
. The
policy detail page is displayed.
Enabling and Disabling Policies
As a policy administrator, you can manage access to policies by enabling and disabling them.
Minimum Required Role: Policy Administrator (also provided by Full Administrator)
- Start and log in to the Cloudera Navigator data management component UI.
- Click the Policies tab.
- In a policy row, click a policy name link or select or .
Copying and Editing a Policy
If you have an existing policy that you want to use as a template for another similar property, you can copy it and then make any required adjustments. You can also edit existing policies if you need to make changes to it.
Minimum Required Role: Policy Administrator (also provided by Full Administrator)
- Start and log in to the Cloudera Navigator data management component UI.
- Click the Policies tab.
- In a policy row, select or . You can also click the policy row and then on the policy details page, select or .
- Edit the policy name, search query, or policy actions.
- Click Save.
Deleting Policies
Minimum Required Role: Policy Administrator (also provided by Full Administrator)
- Start and log in to the Cloudera Navigator data management component UI.
- Click the Policies tab.
- In a policy row, select OK to confirm. and