use of uk.gov.gchq.gaffer.hdfs.operation.handler.job.initialiser.TextJobInitialiser in project Gaffer by gchq.
the class AddElementsFromHdfsIT method addElementsFromHdfs.
private void addElementsFromHdfs(Class<? extends AccumuloKeyPackage> keyPackageClass) throws Exception {
// Given
createInputFile();
final Graph graph = createGraph(keyPackageClass);
// When
graph.execute(new AddElementsFromHdfs.Builder().inputPaths(Collections.singletonList(inputDir)).outputPath(outputDir).failurePath(failureDir).mapperGenerator(TextMapperGeneratorImpl.class).jobInitialiser(new TextJobInitialiser()).option(AccumuloStoreConstants.OPERATION_HDFS_USE_PROVIDED_SPLITS_FILE, "false").option(AccumuloStoreConstants.OPERATION_HDFS_SPLITS_FILE_PATH, splitsFile).build(), new User());
// Then
final CloseableIterable<Element> elements = graph.execute(new GetAllElements<>(), new User());
final List<Element> elementList = Lists.newArrayList(elements);
assertEquals(NUM_ENTITIES, elementList.size());
for (int i = 0; i < NUM_ENTITIES; i++) {
assertEquals(TestGroups.ENTITY, elementList.get(i).getGroup());
assertEquals(VERTEX_ID_PREFIX + i, ((Entity) elementList.get(i)).getVertex());
}
}
Aggregations