use of de.invesdwin.util.collections.iterable.ATransformingIterator in project invesdwin-context-persistence by subes.
the class ASegmentedTimeSeriesStorageCache method deleteAll.
public synchronized void deleteAll() {
final ADelegateRangeTable<String, TimeRange, SegmentStatus> segmentStatusTable = storage.getSegmentStatusTable();
final List<TimeRange> rangeKeys;
try (ICloseableIterator<TimeRange> rangeKeysIterator = new ATransformingIterator<RangeTableRow<String, TimeRange, SegmentStatus>, TimeRange>(segmentStatusTable.range(hashKey)) {
@Override
protected TimeRange transform(final RangeTableRow<String, TimeRange, SegmentStatus> value) {
return value.getRangeKey();
}
}) {
rangeKeys = Lists.toListWithoutHasNext(rangeKeysIterator);
}
for (int i = 0; i < rangeKeys.size(); i++) {
final TimeRange rangeKey = rangeKeys.get(i);
segmentedTable.deleteRange(new SegmentedKey<K>(key, rangeKey));
}
segmentStatusTable.deleteRange(hashKey);
storage.deleteRange_latestValueLookupTable(hashKey);
storage.deleteRange_nextValueLookupTable(hashKey);
storage.deleteRange_previousValueLookupTable(hashKey);
clearCaches();
}
Aggregations