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

templeton.hive.properties property value substitution should be done by ambari-server

    XMLWordPrintableJSON

Details

    Description

      The webhcat-site/templeton.hive.properties property value substitution should be done by ambari-server. This value is more complicated than others since the (embedded) hive.metastore.uris property is a list of thrift URIs generated using the set of hosts the Hive Metastore is installed on. This list of hosts comes from the clusterHostInfo/hive_metastore_host value, which in the KerberosHelper (org.apache.ambari.server.controller.KerberosHelper) is available as a comma-delimited list of hosts.

      clusterHostInfo/hive_metastore_host = "host1,host2,host3"
      

      To generate configuration values when enabling Kerberos, the KerberosHelper class uses org.apache.ambari.server.state.kerberos.AbstractKerberosDescriptor#replaceVariables to replace variables specified in the Kerberos Descriptor. Currently this mechanism uses a simple replacement scheme, which is not sufficient to generate string using a delimited list of values.

      In order to solve this issue, "functions" need to be applied to replacement data before making the substitution. In this case a "function" named "each" will be created that takes the following arguments:

      • pattern with placeholders
      • delimiter to use to concatenate values generated using the patter
      • regex to use to split the original string

      For example:

      function declaration, commas are escaped when not intended to separate function args
      each(thrift://%s:9083, \\,, \s*\,\s*)
      

      To indicate this function is to be used, the following Kerberos Descriptor variable replacement syntax is to be used:

      ${clusterHostInfo/hive_metastore_host|each(thrift://%s:9083, \\,, \s*\,\s*)}
      

      Note: \ characters need to be escaped in JSON structure values. For example:

      "some.property" : "${clusterHostInfo/hive_metastore_host|each(thrift://%s:9083, \\\\,, \\s*\\,\\s*)}"
      

      If clusterHostInfo/hive_metastore_host = "host1,host2,host3", the result would be

      thrift://host1:9083\,thrift://host2:9083\,thrift://host3:9083
      

      Attachments

        1. AMBARI-11202_02.patch
          43 kB
          Robert Levas
        2. AMBARI-11202_01.patch
          36 kB
          Robert Levas

        Issue Links

          Activity

            People

              rlevas Robert Levas
              rlevas Robert Levas
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: