Metadata Policies

A metadata policy defines a set of actions performed by the Cloudera Navigator Metadata Server on a class of entities. The following actions are supported:
  • Adding custom metadata such as tags and properties.
  • Performing an 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 doesn't have access to the directory, the action will fail. Similarly, if a policy creator does not have access to a file within the directory, the action will also fail. 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.

  • Sending 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"}
    In order to send a message to a JMS message queue you must configure the JMS server properties.
For some actions, certain properties support specifying a value using a policy expression.

A policy is run as the user who created the policy in the home directory of the user who created the policy. If you want 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, then delete or disable the old policy.

Viewing Policies

Minimum Required Role:: Policy Viewer (also provided by Policy Administrator, Full Administrator)

  1. Start and log into the Cloudera Navigator data management component UI.
  2. Click the Policies tab.

Viewing a Policy

  1. Start and log into the Cloudera Navigator data management component UI.
  2. Click the Policies tab.
  3. In a policy row, click a policy name link or select Actions > View.

Enabling and Disabling Policies

  1. Start and log into the Cloudera Navigator data management component UI.
  2. Click the Policies tab.
  3. In a policy row, click a policy name link or select Actions > Enable or Actions > Disable.

Creating Policies

Minimum Required Role:: Policy Administrator (also provided by Full Administrator)

  1. Start and log into the Cloudera Navigator data management component UI.
  2. Depending on the starting point, do one of the following:
    Action Procedure
    Policies page
    1. Click the Policies tab.
    2. Click Create New Policy.
    Search results page
    1. Select Actions > Create a policy.
  3. In the Status field, check the Enable checkbox.
  4. Enter a name for the policy.
  5. 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 Search Results link.
  6. Specify an optional description for the policy.
  7. If you choose to use policy expressions in properties that support expressions, specify required imports in the Import Statements field. See Metadata Policy Expression Examples.
  8. 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.
    For the Once and Recurring fields, specify dates and times as follows:
    • Date - Click the down arrow to display a calendar and select a date, or click a field and click the spinner arrows or up and down arrow keys.
    • Time - Click the hour, minute, and AM/PM fields and click the spinner arrows or up and down arrow keys to specify the value.
    • Move between fields by clicking fields or by using the right and left arrow keys.
  9. Follow the appropriate procedure for the actions performed by the policy:
    Action Procedure
    Assign Metadata
    1. Specify the custom metadata. Optionally check the Expression checkbox and specify a policy expression for the indicated fields.
    Configure Command Actions
    1. Select Add Action > Move to Trash or Add Action > Move. 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.

      Command actions are supported only for HDFS entities. If you configure a command action for unsupported entities, a runtime error will be logged when the policy runs.

      See Viewing Command Action Status.

    Send Notification to JMS
    1. If not already configured, configure a JMS server and queue.
    2. Specify the queue name and message. Optionally check the Expression checkbox and specify a policy expression for the message.
  10. Click Save.

Copying and Editing a Policy

Minimum Required Role:: Policy Administrator (also provided by Full Administrator)

  1. Start and log into the Cloudera Navigator data management component UI.
  2. Click the Policies tab.
  3. In a policy row, select Actions > Copy or Actions > Edit.
  4. Edit the policy name, search query, or policy actions.
  5. Click Save.

Deleting Policies

Minimum Required Role:: Policy Administrator (also provided by Full Administrator)

  1. Start and log into the Cloudera Navigator data management component UI.
  2. Click the Policies tab.
  3. In a policy row, select Actions > Delete and OK to confirm.