public CommitLogPosition call() { try { // we wait on the latch for the commitLogUpperBound to be set, and so that waiters // on this task can rely on all prior flushes being complete latch.await(); } catch (InterruptedException e) { throw new IllegalStateException(); } CommitLogPosition commitLogUpperBound = CommitLogPosition.NONE; // If a flush errored out but the error was ignored, make sure we don't discard the commit log. if (flushFailure == null && !memtables.isEmpty()) { Memtable memtable = memtables.get(0); commitLogUpperBound = memtable.getCommitLogUpperBound(); CommitLog.instance.discardCompletedSegments(metadata.cfId, memtable.getCommitLogLowerBound(), commitLogUpperBound); } metric.pendingFlushes.dec(); if (flushFailure != null) throw Throwables.propagate(flushFailure); return commitLogUpperBound; } }
/** * @return a Future yielding the commit log position that can be guaranteed to have been successfully written * to sstables for this table once the future completes */ private ListenableFuture<CommitLogPosition> waitForFlushes() { // we grab the current memtable; once any preceding memtables have flushed, we know its // commitLogLowerBound has been set (as this it is set with the upper bound of the preceding memtable) final Memtable current = data.getView().getCurrentMemtable(); ListenableFutureTask<CommitLogPosition> task = ListenableFutureTask.create(() -> { logger.debug("forceFlush requested but everything is clean in {}", name); return current.getCommitLogLowerBound(); }); postFlushExecutor.execute(task); return task; }
/** * @return a Future yielding the commit log position that can be guaranteed to have been successfully written * to sstables for this table once the future completes */ private ListenableFuture<CommitLogPosition> waitForFlushes() { // we grab the current memtable; once any preceding memtables have flushed, we know its // commitLogLowerBound has been set (as this it is set with the upper bound of the preceding memtable) final Memtable current = data.getView().getCurrentMemtable(); ListenableFutureTask<CommitLogPosition> task = ListenableFutureTask.create(() -> { logger.debug("forceFlush requested but everything is clean in {}", name); return current.getCommitLogLowerBound(); }); postFlushExecutor.execute(task); return task; }
/** * @return a Future yielding the commit log position that can be guaranteed to have been successfully written * to sstables for this table once the future completes */ private ListenableFuture<CommitLogPosition> waitForFlushes() { // we grab the current memtable; once any preceding memtables have flushed, we know its // commitLogLowerBound has been set (as this it is set with the upper bound of the preceding memtable) final Memtable current = data.getView().getCurrentMemtable(); ListenableFutureTask<CommitLogPosition> task = ListenableFutureTask.create(() -> { logger.debug("forceFlush requested but everything is clean in {}", name); return current.getCommitLogLowerBound(); }); postFlushExecutor.execute(task); return task; }
public CommitLogPosition call() { try { // we wait on the latch for the commitLogUpperBound to be set, and so that waiters // on this task can rely on all prior flushes being complete latch.await(); } catch (InterruptedException e) { throw new IllegalStateException(); } CommitLogPosition commitLogUpperBound = CommitLogPosition.NONE; // If a flush errored out but the error was ignored, make sure we don't discard the commit log. if (flushFailure == null && !memtables.isEmpty()) { Memtable memtable = memtables.get(0); commitLogUpperBound = memtable.getCommitLogUpperBound(); CommitLog.instance.discardCompletedSegments(metadata.cfId, memtable.getCommitLogLowerBound(), commitLogUpperBound); } metric.pendingFlushes.dec(); if (flushFailure != null) throw Throwables.propagate(flushFailure); return commitLogUpperBound; } }
public CommitLogPosition call() { try { // we wait on the latch for the commitLogUpperBound to be set, and so that waiters // on this task can rely on all prior flushes being complete latch.await(); } catch (InterruptedException e) { throw new IllegalStateException(); } CommitLogPosition commitLogUpperBound = CommitLogPosition.NONE; // If a flush errored out but the error was ignored, make sure we don't discard the commit log. if (flushFailure == null && !memtables.isEmpty()) { Memtable memtable = memtables.get(0); commitLogUpperBound = memtable.getCommitLogUpperBound(); CommitLog.instance.discardCompletedSegments(metadata.cfId, memtable.getCommitLogLowerBound(), commitLogUpperBound); } metric.pendingFlushes.dec(); if (flushFailure != null) throw Throwables.propagate(flushFailure); return commitLogUpperBound; } }