use of com.facebook.presto.kudu.schema.SchemaEmulationByTableNameConvention in project presto by prestodb.
the class KuduModule method createKuduClientSession.
@Singleton
@Provides
KuduClientSession createKuduClientSession(KuduConnectorId connectorId, KuduClientConfig config) {
requireNonNull(config, "config is null");
KuduClient client;
if (!config.isKerberosAuthEnabled()) {
client = KuduUtil.createKuduClient(config);
} else {
KuduUtil.initKerberosENV(config.getKerberosPrincipal(), config.getKerberosKeytab(), config.isKerberosAuthDebugEnabled());
client = KuduUtil.createKuduKerberosClient(config);
}
SchemaEmulation strategy;
if (config.isSchemaEmulationEnabled()) {
strategy = new SchemaEmulationByTableNameConvention(config.getSchemaEmulationPrefix());
} else {
strategy = new NoSchemaEmulation();
}
return new KuduClientSession(connectorId, client, strategy, config.isKerberosAuthEnabled());
}
Aggregations