Similar to stack configurations, most properties are defined at the service level, however there are global properties which can be defined at the stack-version level affecting across all services.
Some examples are: stack-selector and conf-selector specific names or what stack versions certain stack features are supported by. Most of these properties were introduced in Ambari 2.4 version in the effort of parameterize stack information and facilitate the reuse of common-services code by other distributions.
Such properties can be defined in .json format in the properties folder of the stack.
Stacks can support different features depending on their version, for example: upgrade support, NFS support, support for specific new components (such as Ranger, Phoenix )…
Stack featurization was added as part of the HDP stack configurations on HDP/2.0.6/configuration/cluster-env.xml, introducing a new stack_features property which value is processed in the stack engine from an external property file.
Stack Features properties are defined in stack_features.json file under /HDP/2.0.6/properties. These features support is now available for access at service-level code to change certain service behaviors or configurations. This is an example of features described in stack_features.jon file:
where min_version/max_version are optional constraints.
Feature constants, matching features names, such has ROLLING_UPGRADE = "rolling_upgrade" has been added to a new StackFeature class in resource_management/libraries/functions/constants.py
Additionally, corresponding helper functions has been introduced in resource_management/libraries/functions/stack_fetaures.py to parse the .json file content and called from service code to check if the stack supports the specific feature.
This is an example where the new stack featurization design is used in service code:
Similar to stack features, stack-selector and conf-selector tools are now stack-driven instead of hardcoding hdp-select and conf-select. They are defined in stack_tools.json file under /HDP/2.0.6/properties
And declared as part of the HDP stack configurations as a new property on /HDP/2.0.6/configuration/cluster-env.xml
Corresponding helper functions have been added in resource_management/libraries/functions/stack_tools.py. These helper functions are used to remove hardcodings in resource_management library.