Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Step 2 - Annotate stack configs (Non-UI Metadata) 

Each configuration that is used by the service's theme has to provide extra metadata about the configuration. The list of available metadata are: 

  • display-name

  • value-attributes

    • type

      • string

      • value-list

      • float

      • int

      • boolean

    • minimum

    • maximum

    • unit

    • increment-step

    • entries

      • entry

        • value

        • description

  • depends-on

    • property

      • type

      • name

...

Dependencies between configurations is a directed-acyclic-graph (DAG). When a configuration is updated, the UI has to determine its effect on other configs in the graph. To determine this, the /recommendations endpoint should be provided an array of what configurations have been just changed in the changed_configurations field. Based on the provided changed-configs, only its dependencies are updated in the response.

Example:

 

Figure below shows some config dependencies - A effects B and C, each of which effects DE and FG respectively.

 

 

 

Now assume user changes B to B' - a call to /recommendations will only change D and E to D' and E' respectively (AB'CD'E'FG). No other config will be changed. Now assume that C is changed to C' - /recommendations will only change F and G to F' and G' while still keeping the values of B' D' E' intact (AB'C'D'E'F'G'). Now if you change A to A', it will affect all its children (A'B''C''D''E''F''G''). The user will have chance to pick and choose which he wants to apply.

...

Step 3 - Restart Ambari server

...

Restarting ambari-server is required for any changes in the themes or the stack-definition to be loaded.

Reference

...

Appendix

Appendix A - Widget Metadata Usage

WidgetMetadata Used
  
Slider
<value-attributes>
<type>int</type>
<minimum>1073741824</minimum>
<maximum>17179869184</maximum>
<unit>B</unit>
<increment-step>1073741824</increment-step>
</value-attributes>
Combo, List
<value-attributes>
<type>value-list</type>
<entries>
<entry>
<value>2</value>
</entry>
<entry>
<value>4</value>
</entry>
<entry>
<value>8</value>
</entry>
</entries>
<selection-cardinality>1</selection-cardinality>
</value-attributes>