Search in sources :

Example 1 with AccumuloAddElementsFromHdfsJobFactory

use of uk.gov.gchq.gaffer.accumulostore.operation.hdfs.handler.job.factory.AccumuloAddElementsFromHdfsJobFactory in project Gaffer by gchq.

the class FetchElementsFromHdfsTool method run.

@Override
public int run(final String[] strings) throws Exception {
    checkHdfsDirectories(operation);
    LOGGER.info("Ensuring table {} exists", store.getProperties().getTable());
    TableUtils.ensureTableExists(store);
    LOGGER.info("Adding elements from HDFS");
    final Job job = new AccumuloAddElementsFromHdfsJobFactory().createJob(operation, store);
    job.waitForCompletion(true);
    if (!job.isSuccessful()) {
        LOGGER.error("Error running job");
        throw new OperationException("Error running job");
    }
    LOGGER.info("Finished adding elements from HDFS");
    return SUCCESS_RESPONSE;
}
Also used : AccumuloAddElementsFromHdfsJobFactory(uk.gov.gchq.gaffer.accumulostore.operation.hdfs.handler.job.factory.AccumuloAddElementsFromHdfsJobFactory) Job(org.apache.hadoop.mapreduce.Job) OperationException(uk.gov.gchq.gaffer.operation.OperationException)

Aggregations

Job (org.apache.hadoop.mapreduce.Job)1 AccumuloAddElementsFromHdfsJobFactory (uk.gov.gchq.gaffer.accumulostore.operation.hdfs.handler.job.factory.AccumuloAddElementsFromHdfsJobFactory)1 OperationException (uk.gov.gchq.gaffer.operation.OperationException)1