Skip to content

Commit

Permalink
fix for mapreduce ingest (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfecher committed Apr 10, 2018
1 parent e1bddaf commit 4f01bf3
Showing 1 changed file with 13 additions and 7 deletions.
Expand Up @@ -156,15 +156,21 @@ public int run(
GeoWaveOutputFormat.setStoreOptions(
job.getConfiguration(),
dataStoreOptions);
PrimaryIndex[] indexesArray = new PrimaryIndex[indexes.size()];
final WritableDataAdapter<?>[] dataAdapters = ingestPlugin.getDataAdapters(ingestOptions.getVisibility());
for (final WritableDataAdapter<?> dataAdapter : dataAdapters) {
dataAdapter.init(indexes.toArray(indexesArray));
GeoWaveOutputFormat.addDataAdapter(
job.getConfiguration(),
dataAdapter);
if (dataAdapters != null && dataAdapters.length > 0) {
PrimaryIndex[] indexesArray = indexes.toArray(new PrimaryIndex[indexes.size()]);
for (final WritableDataAdapter<?> dataAdapter : dataAdapters) {
// from a controlled client, intialize the writer within the
// context of the datastore before distributing ingest
dataStoreOptions.createDataStore().createWriter(
dataAdapter,
indexesArray).close();

GeoWaveOutputFormat.addDataAdapter(
job.getConfiguration(),
dataAdapter);
}
}

job.setSpeculativeExecution(false);

// add required indices
Expand Down

0 comments on commit 4f01bf3

Please sign in to comment.