HDFS-3789. JournalManager#format() should be able to throw IOException. Contributed by Ivan Kelly.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1372566 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2012-08-13 19:36:31 +00:00
parent bbe0e823db
commit 7aacfd5a08
6 changed files with 8 additions and 5 deletions

View File

@ -114,6 +114,9 @@ Trunk (unreleased changes)
HDFS-3695. Genericize format() to non-file JournalManagers. (todd) HDFS-3695. Genericize format() to non-file JournalManagers. (todd)
HDFS-3789. JournalManager#format() should be able to throw IOException
(Ivan Kelly via todd)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES

View File

@ -272,7 +272,7 @@ public void processResult(int rc, String path, Object ctx, String name) {
} }
@Override @Override
public void format(NamespaceInfo ns) { public void format(NamespaceInfo ns) throws IOException {
// Currently, BKJM automatically formats itself when first accessed. // Currently, BKJM automatically formats itself when first accessed.
// TODO: change over to explicit formatting so that the admin can // TODO: change over to explicit formatting so that the admin can
// clear out the BK storage when reformatting a cluster. // clear out the BK storage when reformatting a cluster.

View File

@ -79,7 +79,7 @@ public FileJournalManager(StorageDirectory sd,
public void close() throws IOException {} public void close() throws IOException {}
@Override @Override
public void format(NamespaceInfo ns) { public void format(NamespaceInfo ns) throws IOException {
// Formatting file journals is done by the StorageDirectory // Formatting file journals is done by the StorageDirectory
// format code, since they may share their directory with // format code, since they may share their directory with
// checkpoints, etc. // checkpoints, etc.

View File

@ -41,7 +41,7 @@ public interface JournalManager extends Closeable, FormatConfirmable {
* Format the underlying storage, removing any previously * Format the underlying storage, removing any previously
* stored data. * stored data.
*/ */
void format(NamespaceInfo ns); void format(NamespaceInfo ns) throws IOException;
/** /**
* Begin writing to a new segment of the log stream, which starts at * Begin writing to a new segment of the log stream, which starts at

View File

@ -174,7 +174,7 @@ public boolean isRequired() {
} }
@Override @Override
public void format(NamespaceInfo nsInfo) { public void format(NamespaceInfo nsInfo) throws IOException {
// The iteration is done by FSEditLog itself // The iteration is done by FSEditLog itself
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -154,7 +154,7 @@ public DummyJournalManager(Configuration conf, URI u,
} }
@Override @Override
public void format(NamespaceInfo nsInfo) { public void format(NamespaceInfo nsInfo) throws IOException {
formatCalled = true; formatCalled = true;
} }