Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-22649

Library for querying cluster_settings and stack_settings in command*.json.

    XMLWordPrintableJSON

Details

    Description

      Background : AMBARI-22198 added "stack settings", and AMBARI-22196 introduced "cluster settings" in Ambari.

      =========================================================================
      Library for querying clusterSettings and stackSettings for its contents in command*.json.
      =========================================================================

      One should be able to query for a given clusterSettings or stackSettings:

      • by passing in the setting name(one or more) in order to get it back as key-value map, or
      • just get the value back for a passed-in setting.

      Functions for clusterSettings:
      -----------------------------------------

      • get_cluster_setting_entries(setting_names) :
        • Retrieves the passed-in cluster setting entr(y/ies) and their values as a map.
          If 'setting_names' is passed-in as None : all the settings names and their corresponding values will be returned as map.
          If 'setting_names' is passed-in as empty set : None will be returned.
      • get_cluster_setting_value(setting_name) :
        • Retrieves the passed-in cluster setting entry's value.
      • is_security_enabled() :
        • Retrieves the cluster's security status.

      Functions for stackSettings:
      -----------------------------------------

      Stack settings as of now has 5 settings : stack_name, stack_root, stack_features, stack_tools, stack_packages. stack_name, stack_root have string as values, whereas stack_features, stack_tools, stack_packages have values as JSON. Further there already exists python functions in files : stack_features.py, stack_tools.py and stack_select.py.

      • get_stack_setting_entries(setting_names) :
        • Retrieves the passed-in stack setting entr(y/ies) and their values as a map.
          If 'setting_names' is passed-in as None, all the settings names and their corresponding values will be returned as map.
          If 'setting_names' is passed-in as empty set : None will be returned.
      • get_stack_setting_value(setting_name):
        • Retrieves the passed-in stack setting entry's value.
      • get_stack_name():
        • Retrieves the stack name.
      • get_stack_root():
        • Retrieves the stack root.

      Modifications in stack_features.py, stack_tools.py and stack_select.py files:
      --------------------------------------------------------------------------------------------------------------

      • Given that these already exist and as of now they read the relevant stack setting from configurations/cluster_env.
      • Thus, code has been added to try reading from /stackSettings first by calling the new fn.() get_stack_setting_value(). if setting not found, go for the fall back configurations/cluster_env (which would be removed soon, when we remove cluster_env).

      Attachments

        1. AMBARI-22649.3.patch
          28 kB
          Swapan Shridhar
        2. AMBARI-22649-test.patch
          5 kB
          Attila Doroszlai
        3. AMBARI-22649.2.patch
          16 kB
          Swapan Shridhar
        4. AMBARI-22649.1.patch
          14 kB
          Swapan Shridhar
        5. AMBARI-22649.patch
          13 kB
          Swapan Shridhar

        Activity

          People

            swapanshridhar Swapan Shridhar
            swapanshridhar Swapan Shridhar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h