public static void configure(Job job) {
try {
AccumuloGraphConfiguration accumuloGraphConfiguration = new AccumuloGraphConfiguration(job.getConfiguration(), "graph.");
AccumuloGraph graph = AccumuloGraph.create(accumuloGraphConfiguration);
String principal = accumuloGraphConfiguration.getAccumuloUsername();
AuthenticationToken token = accumuloGraphConfiguration.getAuthenticationToken();
String instanceName = accumuloGraphConfiguration.getAccumuloInstanceName();
String zooKeepers = accumuloGraphConfiguration.getZookeeperServers();
String[] authorizations = job.getConfiguration().get("titan.hadoop.input.authorizations", "").split(",");
if (authorizations.length == 1 && authorizations[0].trim().length() == 0) {
authorizations = new String[0];
}
String tableName = graph.getVerticesTableName();
AccumuloRowInputFormat.setInputTableName(job, tableName);
AccumuloRowInputFormat.setConnectorInfo(job, principal, token);
ClientConfiguration clientConfig = new ClientConfiguration()
.withInstance(instanceName)
.withZkHosts(zooKeepers);
AccumuloRowInputFormat.setZooKeeperInstance(job, clientConfig);
AccumuloRowInputFormat.setScanAuthorizations(job, new org.apache.accumulo.core.security.Authorizations(authorizations));
job.getConfiguration().setStrings(VertexiumMRUtils.CONFIG_AUTHORIZATIONS, authorizations);
} catch (Exception ex) {
throw new VertexiumException("Could not configure", ex);
}
}