/** * construct a Transaction for use in an offline operation */ public static LifecycleTransaction offline(OperationType operationType, Iterable<SSTableReader> readers) { // if offline, for simplicity we just use a dummy tracker Tracker dummy = new Tracker(null, false); dummy.addInitialSSTables(readers); dummy.apply(updateCompacting(emptySet(), readers)); return new LifecycleTransaction(dummy, operationType, readers); }
@Override protected Throwable doPostCleanup(Throwable accumulate) { log.close(); return unmarkCompacting(marked, accumulate); }
void delete() { LogTransaction.delete(file); syncDirectory(); }
private Throwable unmarkCompacting(Set<SSTableReader> unmark, Throwable accumulate) { accumulate = tracker.apply(updateCompacting(unmark, emptySet()), accumulate); // when the CFS is invalidated, it will call unreferenceSSTables(). However, unreferenceSSTables only deals // with sstables that aren't currently being compacted. If there are ongoing compactions that finish or are // interrupted after the CFS is invalidated, those sstables need to be unreferenced as well, so we do that here. accumulate = tracker.dropSSTablesIfInvalid(accumulate); return accumulate; }
void readTxnLog(LogFile txn) { if (!txn.verify() && onTxnErr == OnTxnErr.THROW) throw new LogTransaction.CorruptTransactionLogException("Some records failed verification. See earlier in log for details.", txn); }
void setError(LogRecord record, String error) { record.setError(error); setErrorInReplicas(record); }
private boolean isLastRecordValidWithType(Type type) { LogRecord lastRecord = getLastRecord(); return lastRecord != null && lastRecord.type == type && lastRecord.isValid(); }
/** * construct a Transaction for use in an offline operation */ public static LifecycleTransaction offline(OperationType operationType, Iterable<SSTableReader> readers) { // if offline, for simplicity we just use a dummy tracker Tracker dummy = new Tracker(null, false); dummy.addInitialSSTables(readers); dummy.apply(updateCompacting(emptySet(), readers)); return new LifecycleTransaction(dummy, operationType, readers); }
private Throwable unmarkCompacting(Set<SSTableReader> unmark, Throwable accumulate) { accumulate = tracker.apply(updateCompacting(unmark, emptySet()), accumulate); // when the CFS is invalidated, it will call unreferenceSSTables(). However, unreferenceSSTables only deals // with sstables that aren't currently being compacted. If there are ongoing compactions that finish or are // interrupted after the CFS is invalidated, those sstables need to be unreferenced as well, so we do that here. accumulate = tracker.dropSSTablesIfInvalid(accumulate); return accumulate; }
@Override protected Throwable doPostCleanup(Throwable accumulate) { log.close(); return unmarkCompacting(marked, accumulate); }
void readTxnLog(LogFile txn) { if (!txn.verify() && onTxnErr == OnTxnErr.THROW) throw new LogTransaction.CorruptTransactionLogException("Some records failed verification. See earlier in log for details.", txn); }
void delete() { LogTransaction.delete(file); syncDirectory(); }
void setError(LogRecord record, String error) { record.setError(error); setErrorInReplicas(record); }
private boolean isLastRecordValidWithType(Type type) { LogRecord lastRecord = getLastRecord(); return lastRecord != null && lastRecord.type == type && lastRecord.isValid(); }
/** * construct a Transaction for use in an offline operation */ public static LifecycleTransaction offline(OperationType operationType, Iterable<SSTableReader> readers) { // if offline, for simplicity we just use a dummy tracker Tracker dummy = new Tracker(false); dummy.addInitialSSTables(readers); dummy.apply(updateCompacting(emptySet(), readers)); return new LifecycleTransaction(dummy, operationType, readers); }
private Throwable unmarkCompacting(Set<SSTableReader> unmark, Throwable accumulate) { accumulate = tracker.apply(updateCompacting(unmark, emptySet()), accumulate); // when the CFS is invalidated, it will call unreferenceSSTables(). However, unreferenceSSTables only deals // with sstables that aren't currently being compacted. If there are ongoing compactions that finish or are // interrupted after the CFS is invalidated, those sstables need to be unreferenced as well, so we do that here. accumulate = tracker.dropSSTablesIfInvalid(accumulate); return accumulate; }
@Override protected Throwable doPostCleanup(Throwable accumulate) { log.close(); return unmarkCompacting(marked, accumulate); }
void readTxnLog(LogFile txn) { if (!txn.verify() && onTxnErr == OnTxnErr.THROW) throw new LogTransaction.CorruptTransactionLogException("Some records failed verification. See earlier in log for details.", txn); }
/** * construct a Transaction for use in an offline operation */ public static LifecycleTransaction offline(OperationType operationType, Iterable<SSTableReader> readers) { // if offline, for simplicity we just use a dummy tracker Tracker dummy = new Tracker(null, false); dummy.addInitialSSTables(readers); dummy.apply(updateCompacting(emptySet(), readers)); return new LifecycleTransaction(dummy, operationType, readers); }
private Throwable unmarkCompacting(Set<SSTableReader> unmark, Throwable accumulate) { accumulate = tracker.apply(updateCompacting(unmark, emptySet()), accumulate); // when the CFS is invalidated, it will call unreferenceSSTables(). However, unreferenceSSTables only deals // with sstables that aren't currently being compacted. If there are ongoing compactions that finish or are // interrupted after the CFS is invalidated, those sstables need to be unreferenced as well, so we do that here. accumulate = tracker.dropSSTablesIfInvalid(accumulate); return accumulate; }