use of org.locationtech.geowave.test.AccumuloStoreTestEnvironment in project geowave by locationtech.
the class MapReduceIT method testIngestOSMPBF.
@Test
public void testIngestOSMPBF() throws Exception {
TestUtils.deleteAll(dataStoreOptions);
// NOTE: This will probably fail unless you bump up the memory for the
// tablet
// servers, for whatever reason, using the
// miniAccumuloConfig.setMemory() function.
final MapReduceTestEnvironment mrEnv = MapReduceTestEnvironment.getInstance();
// TODO: for now this only works with accumulo, generalize the data
// store usage
final AccumuloStoreTestEnvironment accumuloEnv = AccumuloStoreTestEnvironment.getInstance();
final String hdfsPath = mrEnv.getHdfsBaseDirectory() + "/osm_stage/";
final StageOSMToHDFSCommand stage = new StageOSMToHDFSCommand();
stage.setParameters(TEST_DATA_BASE_DIR, hdfsPath);
stage.execute(mrEnv.getOperationParams());
final Connector conn = new ZooKeeperInstance(accumuloEnv.getAccumuloInstance(), accumuloEnv.getZookeeper()).getConnector(accumuloEnv.getAccumuloUser(), new PasswordToken(accumuloEnv.getAccumuloPassword()));
final Authorizations auth = new Authorizations(new String[] { "public" });
conn.securityOperations().changeUserAuthorizations(accumuloEnv.getAccumuloUser(), auth);
final IngestOSMToGeoWaveCommand ingest = new IngestOSMToGeoWaveCommand();
ingest.setParameters(hdfsPath, "test-store");
final AddStoreCommand addStore = new AddStoreCommand();
addStore.setParameters("test-store");
addStore.setPluginOptions(dataStoreOptions);
addStore.execute(mrEnv.getOperationParams());
ingest.getIngestOptions().setJobName("ConversionTest");
// Execute for node's ways, and relations.
ingest.getIngestOptions().setMapperType("NODE");
ingest.execute(mrEnv.getOperationParams());
System.out.println("finished accumulo ingest Node");
ingest.getIngestOptions().setMapperType("WAY");
ingest.execute(mrEnv.getOperationParams());
System.out.println("finished accumulo ingest Way");
ingest.getIngestOptions().setMapperType("RELATION");
ingest.execute(mrEnv.getOperationParams());
System.out.println("finished accumulo ingest Relation");
}
Aggregations