use of uk.gov.gchq.gaffer.accumulostore.operation.hdfs.handler.job.tool.ImportElementsToAccumuloTool in project Gaffer by gchq.
the class AddElementsFromHdfsHandler method importElements.
private void importElements(final AddElementsFromHdfs operation, final AccumuloStore store) throws OperationException {
final ImportElementsToAccumuloTool importTool;
final int response;
importTool = new ImportElementsToAccumuloTool(operation.getOutputPath(), operation.getFailurePath(), store);
try {
LOGGER.info("Running import job");
response = ToolRunner.run(importTool, new String[0]);
LOGGER.info("Finished running import job");
} catch (final Exception e) {
LOGGER.error("Failed to import elements into Accumulo: {}", e.getMessage());
throw new OperationException("Failed to import elements into Accumulo", e);
}
if (ImportElementsToAccumuloTool.SUCCESS_RESPONSE != response) {
LOGGER.error("Failed to import elements into Accumulo. Response code was {}", response);
throw new OperationException("Failed to import elements into Accumulo. Response code was: " + response);
}
}
Aggregations