/**
* Removes all nodes from the cache that match the given envelope.
*/
public void remove(Envelope e) {
NodeLockInvalidatingVisitor v = new NodeLockInvalidatingVisitor(this.tracker);
try {
if (e == null) {
e = getBounds();// no envelope specified so assume everything
}
this.tracker.intersectionQuery(CacheUtil.convert(e), v); // invalidates nodes
this.tracker.getStatistics().addToDataCounter(-v.getDataCount()); //update stats to remove all data
} catch (IOException ex) {
logger.log(Level.SEVERE, "Error removing elements from cache.", ex);
}
this.tracker.flush();
}