Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
riversand9 committed Dec 20, 2017
1 parent 9ccec88 commit 8c500f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ public synchronized void write(JournalEntry entry) throws IOException {
mEntriesToFlush.add(entryToWrite);
mNextSequenceNumber++;
} catch (IOException e) {
// Set mJournalOutputStream to null so that {@code maybeRecoverFromUfsFailures}
// can know a UFS failure has occurred.
mRotateLogForNextWrite = true;
UfsJournalFile currentLog = mJournalOutputStream.mCurrentLog;
mJournalOutputStream = null;
// Set mNeedsRecovery to true so that {@code maybeRecoverFromUfsFailures}
// can know a UFS failure has occurred.
mNeedsRecovery = true;
throw new IOException(ExceptionMessage.JOURNAL_WRITE_FAILURE
.getMessageWithUrl(RuntimeConstants.ALLUXIO_DEBUG_DOCS_URL,
Expand Down Expand Up @@ -393,27 +393,8 @@ public synchronized void close() throws IOException {
mClosed = true;
}

/**
* @return number of journal entries to flush stored in the queue
*/
@VisibleForTesting
synchronized int getNumberOfJournalEntriesToFlush() {
return mEntriesToFlush.size();
}

@VisibleForTesting
synchronized JournalOutputStream getJournalOutputStream() {
return mJournalOutputStream;
}

/**
* @return the current underlying {@link DataOutputStream} to write journal entries
*/
@VisibleForTesting
synchronized DataOutputStream getUnderlyingDataOutputStream() {
if (mJournalOutputStream == null) {
return null;
}
return mJournalOutputStream.mOutputStream;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ private DataOutputStream createMockDataOutputStream(UfsJournalLogWriter writer)
DataOutputStream badOut = Mockito.mock(DataOutputStream.class);
Object journalOutputStream = writer.getJournalOutputStream();
Whitebox.setInternalState(journalOutputStream, "mOutputStream", badOut);
Assert.assertEquals(badOut, writer.getUnderlyingDataOutputStream());
return badOut;
}

Expand Down

0 comments on commit 8c500f5

Please sign in to comment.