Preferences

Preferences are saved runtime arguments. You can save the values of a runtime argument at the application, namespace, or instance (system) level so that you don't have to provide them every time you run a pipeline.

Preferences are not saved in the pipeline configuration, which means preferences are not included in the JSON file when you export a pipeline.

Using macros and preferences, you design a pipeline once and can run it in different namespaces or instances. Based on the values you set in the preferences, the pipeline can behave differently and produce various results.

For example, a pipeline can connect to a development database server in a development instance or namespace by resolving macros with preferences at the instance or namespace level. The same pipeline can be exported and run on a production instance or namespace using a production database server which is specified in the production system preferences or namespace preferences.

The order of inheritance for preferences is:

  1. System preferences

  2. Namespace preferences

  3. Application preferences

  4. Runtime arguments

This means that if you set a preference at the system level, the macro values are automatically populated in the namespace preferences, application preferences, and runtime arguments. Likewise, if you set a preferences at the namespace level, it appears in the list of inherited preferences in the application preferences. If a pipeline uses a macro that’s defined in a preference, the runtime arguments list the key/value pair defined in the preference. You can override the values for preferences at each preference level and in runtime arguments.

You can also add, edit, and delete preferences at the level where they were created. The changes you make appear in namespace preferences, application preferences, and runtime arguments (when you Preview data or run a deployed pipeline). For example, if you want to delete a system preference, go to System Admin > Configuration > System Preferences > Edit System Preferences and delete the preference. The preference is removed from the list of system preferences and does not appear in the list of inherited preferences for namespace preferences, application preferences, and runtime arguments.

Preferences can also be retrieved, saved, and deleted through the Preferences Microservices, Command Line Interface, and Java Client API.

Note: You can also set preferences for programs. For example, you can set configuration properties for Spark. For more information, see the Pipeline Performance Tuning Guide.

System preferences

You can set preferences for the system. Because macro names must be unique, each preference applies to all pipelines that use that macro.

For example, you have a pipeline with a Database source and use macros for the database name and user name. You can set preferences for the database name and user name in system preferences. Every namespace and every pipeline in that instance inherits those preferences.

Setting System preferences

To set System preferences, follow these steps:

  1. In the Pipeline Studio, click System Admin > Configuration.

  2. On the Configuration page, in the System Preferences section, click the Edit System Preferences button.

     

  3. In the Preferences dialog box, enter new preferences or edit existing system preferences. These preferences are available in all namespaces, applications, and pipelines.

  4. Click Save & Close. CDAP adds the preferences to the list of system preferences:

Namespace preferences

You can set preferences for each namespace in the system.

When you set namespace preferences, any inherited system preferences display. When you set preferences for a namespace, you can override inherited preferences by setting different values. You can also add new preferences for the namespace.

Setting Namespace preferences

To set Namespace preferences, follow these steps:

  1. In CDAP, click System Admin > Configuration.

  2. On the Configuration page, in the Namespaces section, click the name of the namespace to set preferences.


    The Namespace Admin page lists all preferences inherited from System preferences.

     

  3. To edit inherited preferences or add new preferences, next to Preferences, click Edit:
    The Preferences page appears and lists all inherited preferences.

  4. On the Preferences page, enter a new preference (key/value pair) or override existing system preferences. 


    To add or override additional preferences, click the + button and enter the key and new value for the macro.

     

  5. Click Save & Close. CDAP creates a namespace preference with the new value, which takes precedence over the system preference. CDAP displays modified preferences:

Application preferences

You can set preferences for each deployed pipeline in a namespace.

When you set application preferences, any inherited system and namespace preferences appear. When you set preferences for an application, you can override inherited preferences by setting different values. You can also add new preferences for the application.

Setting Application preferences

  1. In CDAP, select the namespace where you want to add application preferences.

  2. Go to the Control Center:

  3. Click the Set preferences wrench icon.


    The Preferences page appears and lists all inherited preferences.

  4. On the Preferences page, enter a new preference (key/value pair) or override existing system or namespace preferences. 


    To add or override additional preferences, click the + button and enter the key and new value for the macro.

  5. Click Save & Close. CDAP creates an application preference with the new value, which overrides the system or namespace preferences. When you run the deployed pipeline, the application preferences appear as runtime arguments, which you can optionally edit.





     

Created in 2020 by Google Inc.