static Throwable abortObsoletion(List<LogTransaction.Obsoletion> obsoletions, Throwable accumulate) { if (obsoletions == null || obsoletions.isEmpty()) return accumulate; for (LogTransaction.Obsoletion obsoletion : obsoletions) { try { obsoletion.tidier.abort(); } catch (Throwable t) { accumulate = merge(accumulate, t); } } return accumulate; }
Map<SSTableReader, SSTableTidier> bulkObsoletion(Iterable<SSTableReader> sstables) { if (!txnFile.isEmpty()) throw new IllegalStateException("Bad state when doing bulk obsoletions"); txnFile.addAll(Type.REMOVE, sstables); Map<SSTableReader, SSTableTidier> tidiers = new HashMap<>(); for (SSTableReader sstable : sstables) { if (tracker != null) tracker.notifyDeleting(sstable); tidiers.put(sstable, new SSTableTidier(sstable, false, this)); } return tidiers; }
static Throwable abortObsoletion(List<LogTransaction.Obsoletion> obsoletions, Throwable accumulate) { if (obsoletions == null || obsoletions.isEmpty()) return accumulate; for (LogTransaction.Obsoletion obsoletion : obsoletions) { try { obsoletion.tidier.abort(); } catch (Throwable t) { accumulate = merge(accumulate, t); } } return accumulate; }
static Throwable abortObsoletion(List<LogTransaction.Obsoletion> obsoletions, Throwable accumulate) { if (obsoletions == null || obsoletions.isEmpty()) return accumulate; for (LogTransaction.Obsoletion obsoletion : obsoletions) { try { obsoletion.tidier.abort(); } catch (Throwable t) { accumulate = merge(accumulate, t); } } return accumulate; }
/** * Schedule a reader for deletion as soon as it is fully unreferenced. */ SSTableTidier obsoleted(SSTableReader reader, LogRecord logRecord) { if (txnFile.contains(Type.ADD, reader, logRecord)) { if (txnFile.contains(Type.REMOVE, reader, logRecord)) throw new IllegalArgumentException(); return new SSTableTidier(reader, true, this); } txnFile.add(logRecord); if (tracker != null) tracker.notifyDeleting(reader); return new SSTableTidier(reader, false, this); }
static Throwable abortObsoletion(List<LogTransaction.Obsoletion> obsoletions, Throwable accumulate) { if (obsoletions == null || obsoletions.isEmpty()) return accumulate; for (LogTransaction.Obsoletion obsoletion : obsoletions) { try { obsoletion.tidier.abort(); } catch (Throwable t) { accumulate = merge(accumulate, t); } } return accumulate; }
/** * Schedule a reader for deletion as soon as it is fully unreferenced. */ SSTableTidier obsoleted(SSTableReader reader, LogRecord logRecord) { if (txnFile.contains(Type.ADD, reader, logRecord)) { if (txnFile.contains(Type.REMOVE, reader, logRecord)) throw new IllegalArgumentException(); return new SSTableTidier(reader, true, this); } txnFile.add(logRecord); if (tracker != null) tracker.notifyDeleting(reader); return new SSTableTidier(reader, false, this); }
/** * Schedule a reader for deletion as soon as it is fully unreferenced. */ SSTableTidier obsoleted(SSTableReader reader) { if (txnFile.contains(Type.ADD, reader)) { if (txnFile.contains(Type.REMOVE, reader)) throw new IllegalArgumentException(); return new SSTableTidier(reader, true, this); } txnFile.add(Type.REMOVE, reader); if (tracker != null) tracker.notifyDeleting(reader); return new SSTableTidier(reader, false, this); }