Search in sources :

Example 1 with KerberosTicketConfiguration

use of com.thinkbiganalytics.kerberos.KerberosTicketConfiguration in project kylo by Teradata.

the class DBSchemaParserTest method test.

@Test
public void test() {
    DBSchemaParser schemaParser = new DBSchemaParser(dataSource, new KerberosTicketConfiguration());
    List<String> tables = schemaParser.listTables(null);
    for (final String table : tables) {
        System.out.println(table);
    }
}
Also used : KerberosTicketConfiguration(com.thinkbiganalytics.kerberos.KerberosTicketConfiguration) Test(org.junit.Test)

Example 2 with KerberosTicketConfiguration

use of com.thinkbiganalytics.kerberos.KerberosTicketConfiguration in project kylo by Teradata.

the class HiveConnectionInspectionConfiguration method kerberosTicketHiveConfiguration.

@Bean(name = "kerberosHiveConfiguration")
public KerberosTicketConfiguration kerberosTicketHiveConfiguration() {
    KerberosTicketConfiguration config = new KerberosTicketConfiguration();
    config.setKerberosEnabled("true".equalsIgnoreCase(env.getProperty("kerberos.hive.kerberosEnabled")));
    config.setHadoopConfigurationResources(env.getProperty(KERBEROS_HIVE_HADOOP_CONFIGURATION_RESOURCES));
    config.setKerberosPrincipal(env.getProperty(KERBEROS_HIVE_KERBEROS_PRINCIPAL));
    config.setKeytabLocation(env.getProperty(KERBEROS_HIVE_KEYTAB_LOCATION));
    if (config.isKerberosEnabled()) {
        if (StringUtils.isBlank(config.getHadoopConfigurationResources())) {
            throw new IllegalStateException(String.format("Kerberos is enabled, but Hadoop configuration resources path is not provided. Check %s property", KERBEROS_HIVE_HADOOP_CONFIGURATION_RESOURCES));
        }
        if (StringUtils.isBlank(config.getKeytabLocation())) {
            throw new IllegalStateException(String.format("Kerberos is enabled, but keytab path is not provided. Check %s property", KERBEROS_HIVE_KEYTAB_LOCATION));
        }
        if (StringUtils.isBlank(config.getKerberosPrincipal())) {
            throw new IllegalStateException(String.format("Kerberos is enabled, but Kerberos Principal is not provided. Check %s property", KERBEROS_HIVE_KERBEROS_PRINCIPAL));
        }
    }
    return config;
}
Also used : KerberosTicketConfiguration(com.thinkbiganalytics.kerberos.KerberosTicketConfiguration) Bean(org.springframework.context.annotation.Bean)

Example 3 with KerberosTicketConfiguration

use of com.thinkbiganalytics.kerberos.KerberosTicketConfiguration in project kylo by Teradata.

the class SentryConfiguration method createKerberosTicketConfiguration.

private KerberosTicketConfiguration createKerberosTicketConfiguration(String kerberosEnabled, String hadoopConfigurationResources, String kerberosPrincipal, String keytabLocation) {
    KerberosTicketConfiguration config = new KerberosTicketConfiguration();
    config.setKerberosEnabled("true".equalsIgnoreCase(kerberosEnabled) ? true : false);
    config.setHadoopConfigurationResources(hadoopConfigurationResources);
    config.setKerberosPrincipal(kerberosPrincipal);
    config.setKeytabLocation(keytabLocation);
    return config;
}
Also used : KerberosTicketConfiguration(com.thinkbiganalytics.kerberos.KerberosTicketConfiguration)

Aggregations

KerberosTicketConfiguration (com.thinkbiganalytics.kerberos.KerberosTicketConfiguration)3 Test (org.junit.Test)1 Bean (org.springframework.context.annotation.Bean)1