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);
}
}
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;
}
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;
}
Aggregations