Connector conn = getConnector();
String table = getUniqueNames(1)[0];
conn.tableOperations().create(table);
insertData(table, currentTimeMillis());
ClientConfiguration clientConf = new ClientConfiguration().withInstance(conn.getInstance().getInstanceName()).withZkHosts(
conn.getInstance().getZooKeepers());
AccumuloConfiguration clusterClientConf = conn.getInstance().getConfiguration();
// Pass SSL and CredentialProvider options into the ClientConfiguration given to AccumuloInputFormat
boolean sslEnabled = Boolean.valueOf(clusterClientConf.get(Property.INSTANCE_RPC_SSL_ENABLED));
if (sslEnabled) {
ClientProperty[] sslProperties = new ClientProperty[] {ClientProperty.INSTANCE_RPC_SSL_ENABLED, ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH,
ClientProperty.RPC_SSL_KEYSTORE_PATH, ClientProperty.RPC_SSL_KEYSTORE_TYPE, ClientProperty.RPC_SSL_KEYSTORE_PASSWORD,
ClientProperty.RPC_SSL_TRUSTSTORE_PATH, ClientProperty.RPC_SSL_TRUSTSTORE_TYPE, ClientProperty.RPC_SSL_TRUSTSTORE_PASSWORD,
ClientProperty.RPC_USE_JSSE, ClientProperty.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS};
for (ClientProperty prop : sslProperties) {
// The default property is returned if it's not in the ClientConfiguration so we don't have to check if the value is actually defined
clientConf.setProperty(prop, clusterClientConf.get(prop.getAccumuloProperty()));
}
}
@SuppressWarnings("deprecation")
Job job = new Job();