Skip to content

Commit

Permalink
Log improvements + small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gokturk Gezer committed Nov 8, 2019
1 parent 017a697 commit 32bc94a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Expand Up @@ -200,8 +200,9 @@ public AdvanceFuture advance(long sequence) {
Preconditions.checkState(!mResumeInProgress, "Resume in progress");
Preconditions.checkState(mAdvanceTask == null || !mAdvanceTask.isAlive(),
"Advance task in progress.");
Preconditions.checkState(sequence >= 0, "Invalid sequence");
Preconditions.checkState(mLastAppliedSequence <= sequence, "Can't advance to past.");
Preconditions.checkState(sequence >= 0, String.format("Invalid sequence: %d", sequence));
Preconditions.checkState(mLastAppliedSequence <= sequence, String.format(
"Can't advance to past. Current: %d, Requested: %d", mLastAppliedSequence, sequence));
LOG.info("Advancing state machine to sequence: {}", sequence);

// Complete the request if already at target sequence.
Expand Down
Expand Up @@ -106,7 +106,7 @@ public class UfsJournal implements Journal {
*/
private UfsJournalCheckpointThread mTailerThread;

/** Whether the journal was suspended. */
/** Whether the journal is suspended. */
private volatile boolean mSuspended = false;
/** Store where the journal was suspended. */
private volatile long mSuspendSequence = -1;
Expand Down
Expand Up @@ -259,7 +259,7 @@ private void startHeartbeatThread() {
}
// Submit new heartbeat task.
mBackupProgressFuture = mExecutorService.submit(() -> {
do {
while (true) {
// No need to check result because heartbeat will be sent regardless.
mBackupTracker.waitUntilFinished(mBackupHeartbeatIntervalMs, TimeUnit.MILLISECONDS);
try {
Expand All @@ -273,7 +273,7 @@ private void startHeartbeatThread() {
if (mBackupTracker.isFinished()) {
break;
}
} while (true);
}
});
}

Expand Down

0 comments on commit 32bc94a

Please sign in to comment.