Child pages
  • Service Inheritance
Skip to end of metadata
Go to start of metadata

A service can inherit through the stack but may also inherit directly from common-services.  This is declared in the metainfo.xml:

<metainfo>
  <schemaVersion>2.0</schemaVersion>
  <services>
    <service>
      <name>HDFS</name>
      <extends>common-services/HDFS/2.1.0.2.0</extends>

 

When a service inherits from another service version, how its defining files and directories are inherited follows a number of different patterns.

 

The following files if defined in the current service version replace the definitions from the parent service version:

  • alerts.json
  • kerberos.json
  • metrics.json
  • role_command_order.json
  • service_advisor.py
  • widgets.json

Note: All the services' role command orders will be merge with the stack's role command order to provide a master list.

 

The following files if defined in the current service version are merged with the parent service version (supports removing/deleting parent entries):

  • quicklinks/quicklinks.json
  • themes/theme.json

 

The following directories if defined in the current service version replace those from the parent service version:

  • packages
  • upgrades

This means the files included in those directories at the parent level will not be inherited.  You will need to copy all the files you wish to keep from that directory structure.

 

The configurations directory in the current service version merges the configuration files with those from the parent service version.  Configuration files defined at any level can be omitted from the services configurations by specifying the config-type in the excluded-config-types list:

      <excluded-config-types>
        <config-type>storm-site</config-type>
      </excluded-config-types>

For an individual configuration file (or configuration type) like core-site.xml, it will by default merge with the configuration type from the parent.  If the `supports_do_not_extend` attribute is specified as `true`, the configuration type will not be merged.

<configuration supports_do_not_extend="true">

 

Inheritance and the Service MetaInfo

By default all attributes of the service and components if defined in the metainfo.xml of the current service version will replace those of the parent service version unless specified in the sections that follow.

<metainfo>
  <schemaVersion>2.0</schemaVersion>
  <services>
    <service>
      <name>HDFS</name>
      <displayName>HDFS</displayName>
      <comment>Apache Hadoop Distributed File System</comment>
      <version>2.1.0.2.0</version>
      <components>
        <component>
          <name>NAMENODE</name>
          <displayName>NameNode</displayName>
          <category>MASTER</category>
          <cardinality>1-2</cardinality>
          <versionAdvertised>true</versionAdvertised>
          <reassignAllowed>true</reassignAllowed>
          <commandScript>
            <script>scripts/namenode.py</script>
            <scriptType>PYTHON</scriptType>
            <timeout>1800</timeout>
          </commandScript>
          ...

 

The custom commands defined in the metainfo.xml of the current service version are merged with those of the parent service version.

          <customCommands>
            <customCommand>
              <name>DECOMMISSION</name>
              <commandScript>
                <script>scripts/namenode.py</script>
                <scriptType>PYTHON</scriptType>
                <timeout>600</timeout>
              </commandScript>
            </customCommand>

 

The configuration dependencies defined in the metainfo.xml of the current service version are merged with those of the parent service version.

      <configuration-dependencies>
        <config-type>core-site</config-type>
        <config-type>hdfs-site</config-type>
        ...
      </configuration-dependencies>

 

  The components defined in the metainfo.xml of the current service are merged with those of the parent (supports delete).

        <component>
          <name>ZKFC</name>
          <displayName>ZKFailoverController</displayName>
          <category>SLAVE</category>

 

  • No labels