final IndexType indexType )
throws Exception {
LOGGER.info("deleting from " + indexType.toString() + " index");
System.out.println("deleting from " + indexType.toString() + " index");
boolean success = false;
final mil.nga.giat.geowave.store.DataStore geowaveStore = new AccumuloDataStore(
new AccumuloIndexStore(
GeoWaveITSuite.accumuloOperations),
new AccumuloAdapterStore(
GeoWaveITSuite.accumuloOperations),
new AccumuloDataStatisticsStore(
GeoWaveITSuite.accumuloOperations),
GeoWaveITSuite.accumuloOperations);
final DistributableQuery query = resourceToQuery(savedFilterResource);
final Index index = indexType.createDefaultIndex();
final CloseableIterator<?> actualResults;
actualResults = geowaveStore.query(
index,
query);
SimpleFeature testFeature = null;
while (actualResults.hasNext()) {
final Object obj = actualResults.next();
if ((testFeature == null) && (obj instanceof SimpleFeature)) {
testFeature = (SimpleFeature) obj;
}
}
actualResults.close();
if (testFeature != null) {
final ByteArrayId dataId = new ByteArrayId(
testFeature.getID());
final ByteArrayId adapterId = new ByteArrayId(
testFeature.getFeatureType().getTypeName());
if (geowaveStore.deleteEntry(
index,
dataId,
adapterId)) {
if (geowaveStore.getEntry(
index,
dataId,
adapterId) == null) {
success = true;
}