Exemple #1
0
  def get_properties(self, hive_properties=None):
    credentials = {}
    from beeswax import hive_site, conf

    if hive_properties is None:
      hive_properties = hive_site.get_metastore()
      if hive_properties:
        hive_properties['hive2.server.principal'] = hive_site.get_hiveserver2_kerberos_principal(conf.HIVE_SERVER_HOST.get())

    if not hive_properties:
      hive_properties = {}
      LOG.warn('Could not get all the Oozie credentials: hive-site.xml required on the Hue host.')

    credentials[self.hive_name] = {
      'xml_name': self.hive_name,
      'properties': [
         ('hcat.metastore.uri', hive_properties.get('thrift_uri')),
         ('hcat.metastore.principal', hive_properties.get('kerberos_principal')),
      ]
    }

    credentials[self.hiveserver2_name] = {
      'xml_name': self.hiveserver2_name,
      'properties': [
         ('hive2.jdbc.url', hive_site.hiveserver2_jdbc_url()),
         ('hive2.server.principal', hive_properties.get('hive2.server.principal')),
      ]
    }

    credentials[self.hbase_name] = {
      'xml_name': self.hbase_name,
      'properties': []
    }

    return credentials
Exemple #2
0
  def get_properties(self, metastore=None):
    credentials = {}
    from beeswax import hive_site

    if metastore is None:
      metastore = hive_site.get_metastore()

    if not metastore:
      metastore = {}
      LOG.warn('Could not get all the Oozie credentials: hive-site.xml required on the Hue host.')

    credentials[self.hive_name] = {
      'xml_name': self.hive_name,
      'properties': [
         ('hcat.metastore.uri', metastore.get('thrift_uri')),
         ('hcat.metastore.principal', metastore.get('kerberos_principal')),
      ]
    }

    credentials[self.hiveserver2_name] = {
      'xml_name': self.hiveserver2_name,
      'properties': [
         ('hive2.jdbc.url', hive_site.hiveserver2_jdbc_url()),
         ('hive2.server.principal', metastore.get('kerberos_principal')),
      ]
    }

    credentials[self.hbase_name] = {
      'xml_name': self.hbase_name,
      'properties': []
    }

    LOG.info('Using credentials: %s' % credentials)

    return credentials
Exemple #3
0
    def get_properties(self, hive_properties=None):
        credentials = {}
        from beeswax import hive_site, conf

        if not hasattr(conf.HIVE_SERVER_HOST,
                       'get') or not conf.HIVE_SERVER_HOST.get():
            LOG.warn(
                'Could not get all the Oozie credentials: beeswax app is blacklisted.'
            )
        else:
            if hive_properties is None:
                hive_properties = hive_site.get_metastore()
                if hive_properties:
                    hive_properties[
                        'hive2.server.principal'] = hive_site.get_hiveserver2_kerberos_principal(
                            conf.HIVE_SERVER_HOST.get())

            if not hive_properties:
                hive_properties = {}
                LOG.warn(
                    'Could not get all the Oozie credentials: hive-site.xml required on the Hue host.'
                )

            credentials[self.hive_name] = {
                'xml_name':
                self.hive_name,
                'properties': [
                    ('hcat.metastore.uri', hive_properties.get('thrift_uri')),
                    ('hcat.metastore.principal',
                     hive_properties.get('kerberos_principal')),
                ]
            }

            credentials[self.hiveserver2_name] = {
                'xml_name':
                self.hiveserver2_name,
                'properties': [
                    ('hive2.jdbc.url', hive_site.hiveserver2_jdbc_url()),
                    ('hive2.server.principal',
                     hive_properties.get('hive2.server.principal')),
                ]
            }

        credentials[self.hbase_name] = {
            'xml_name': self.hbase_name,
            'properties': []
        }

        return credentials
Exemple #4
0
    def get_properties(self, metastore=None):
        credentials = {}
        from beeswax import hive_site

        if metastore is None:
            metastore = hive_site.get_metastore()

        if not metastore:
            metastore = {}
            LOG.warn(
                'Could not get all the Oozie credentials: hive-site.xml required on the Hue host.'
            )

        credentials[self.hive_name] = {
            'xml_name':
            self.hive_name,
            'properties': [
                ('hcat.metastore.uri', metastore.get('thrift_uri')),
                ('hcat.metastore.principal',
                 metastore.get('kerberos_principal')),
            ]
        }

        credentials[self.hiveserver2_name] = {
            'xml_name':
            self.hiveserver2_name,
            'properties': [
                ('hive2.jdbc.url', hive_site.hiveserver2_jdbc_url()),
                ('hive2.server.principal',
                 metastore.get('kerberos_principal')),
            ]
        }

        credentials[self.hbase_name] = {
            'xml_name': self.hbase_name,
            'properties': []
        }

        LOG.info('Using credentials: %s' % credentials)

        return credentials