use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.classic.ClassicAccumuloElementConverter in project Gaffer by gchq.
the class GetRDDOfAllElementsHandlerIT method writeFile.
private void writeFile(final KeyPackage keyPackage, final Schema schema, final String file) throws IllegalArgumentException, IOException {
final Configuration conf = new Configuration();
final CachableBlockFile.Writer blockFileWriter = new CachableBlockFile.Writer(FileSystem.get(conf), new Path(file), Compression.COMPRESSION_NONE, null, conf, AccumuloConfiguration.getDefaultConfiguration());
final AccumuloElementConverter converter;
switch(keyPackage) {
case BYTE_ENTITY:
converter = new ByteEntityAccumuloElementConverter(schema);
break;
case CLASSIC:
converter = new ClassicAccumuloElementConverter(schema);
break;
default:
throw new IllegalArgumentException("Unknown keypackage");
}
final Entity entity = (Entity) getElementsForIngestAggregationChecking().get(0);
final Key key = converter.getKeyFromEntity((Entity) getElementsForIngestAggregationChecking().get(0));
final Value value = converter.getValueFromProperties(entity.getGroup(), entity.getProperties());
final RFile.Writer writer = new RFile.Writer(blockFileWriter, 1000);
writer.startDefaultLocalityGroup();
writer.append(key, value);
writer.close();
}
use of uk.gov.gchq.gaffer.accumulostore.key.core.impl.classic.ClassicAccumuloElementConverter in project Gaffer by gchq.
the class RowIdAggregatorTest method setup.
@BeforeAll
public static void setup(@TempDir Path tempDir) {
gaffer1ElementConverter = new ClassicAccumuloElementConverter(SCHEMA);
byteEntityElementConverter = new ByteEntityAccumuloElementConverter(SCHEMA);
}
Aggregations