Search in sources :

Example 1 with AccumuloSampleDataForSplitPointsJobFactory

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

the class SampleDataForSplitPointsHandler method generateSplitsFromSampleData.

private void generateSplitsFromSampleData(final SampleDataForSplitPoints operation, final AccumuloStore store) throws OperationException {
    try {
        if (store.getTabletServers().size() < 2) {
            LOGGER.warn("There is only 1 tablet server so no split points will be calculated.");
            return;
        }
    } catch (final StoreException e) {
        throw new OperationException(e.getMessage(), e);
    }
    try {
        /* Parse any Hadoop arguments passed on the command line and use these to configure the Tool */
        final Configuration configuration = new GenericOptionsParser(operation.getCommandLineArgs()).getConfiguration();
        final SampleDataAndCreateSplitsFileTool sampleTool = new SampleDataAndCreateSplitsFileTool(new AccumuloSampleDataForSplitPointsJobFactory(configuration), operation, store);
        ToolRunner.run(sampleTool, operation.getCommandLineArgs());
    } catch (final Exception e) {
        throw new OperationException(e.getMessage(), e);
    }
    LOGGER.info("Finished calculating splits");
}
Also used : AccumuloSampleDataForSplitPointsJobFactory(uk.gov.gchq.gaffer.accumulostore.operation.hdfs.handler.job.factory.AccumuloSampleDataForSplitPointsJobFactory) Configuration(org.apache.hadoop.conf.Configuration) SampleDataAndCreateSplitsFileTool(uk.gov.gchq.gaffer.hdfs.operation.handler.job.tool.SampleDataAndCreateSplitsFileTool) OperationException(uk.gov.gchq.gaffer.operation.OperationException) StoreException(uk.gov.gchq.gaffer.store.StoreException) OperationException(uk.gov.gchq.gaffer.operation.OperationException) StoreException(uk.gov.gchq.gaffer.store.StoreException) GenericOptionsParser(org.apache.hadoop.util.GenericOptionsParser)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)1 GenericOptionsParser (org.apache.hadoop.util.GenericOptionsParser)1 AccumuloSampleDataForSplitPointsJobFactory (uk.gov.gchq.gaffer.accumulostore.operation.hdfs.handler.job.factory.AccumuloSampleDataForSplitPointsJobFactory)1 SampleDataAndCreateSplitsFileTool (uk.gov.gchq.gaffer.hdfs.operation.handler.job.tool.SampleDataAndCreateSplitsFileTool)1 OperationException (uk.gov.gchq.gaffer.operation.OperationException)1 StoreException (uk.gov.gchq.gaffer.store.StoreException)1