Search in sources :

Example 1 with IngestCallback

use of org.locationtech.geowave.core.store.api.IngestOptions.IngestCallback in project geowave by locationtech.

the class BaseDataStoreIngestDriver method write.

@Override
protected void write(final Writer writer, final GeoWaveData<?> geowaveData) {
    Object obj = geowaveData.getValue();
    if (ingestOptions.getTransform() != null) {
        obj = ((Function) ingestOptions.getTransform()).apply(obj);
    }
    if ((ingestOptions.getFilter() != null) && !((Predicate) ingestOptions.getFilter()).test(geowaveData.getValue())) {
        return;
    }
    final WriteResults results = writer.write(obj);
    if (ingestOptions.getCallback() != null) {
        ((IngestCallback) ingestOptions.getCallback()).dataWritten(results, obj);
    }
}
Also used : WriteResults(org.locationtech.geowave.core.store.api.WriteResults) IngestCallback(org.locationtech.geowave.core.store.api.IngestOptions.IngestCallback) Predicate(java.util.function.Predicate)

Aggregations

Predicate (java.util.function.Predicate)1 IngestCallback (org.locationtech.geowave.core.store.api.IngestOptions.IngestCallback)1 WriteResults (org.locationtech.geowave.core.store.api.WriteResults)1