Versions Compared

Key

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

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>ZOOKEEPER</name>

     <version>3.4.5.2.0</version>

...


  <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.

...

  • packages
  • upgrades

This means you can't include the files you want to add or replace from the parent's packages or upgrades folderthe 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 exception of those which are no longer relevant to your service version. 

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>

...

          <customCommands>
            <customCommand>
              <name>DECOMMISSION</name>
              <commandScript>
                <script>scripts/namenode.py</script>

...

                <scriptType>PYTHON</scriptType>

                <timeout>600</timeout>

              </commandScript>

...


                <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>

 

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

  excluded config types are merged with those of the parent

.

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

   service properties are merged with those of the parent