Skip to content

Commit

Permalink
HBASE-26680 Close and do not write trailer for the broken WAL writer(…
Browse files Browse the repository at this point in the history
…addendum) (#4405)

Signed-off-by: Duo Zhang <[email protected]>
  • Loading branch information
sunhelly authored Jun 2, 2022
1 parent ac8b517 commit 80f410e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void init(FileSystem fs, Path path, Configuration conf, boolean overwrita
}
} catch (Exception e) {
LOG.warn("Init output failed, path={}", path, e);
closeOutput();
closeOutputIfNecessary();
throw e;
}
}
Expand Down Expand Up @@ -269,9 +269,10 @@ protected abstract void initOutput(FileSystem fs, Path path, boolean overwritabl
throws IOException, StreamLacksCapabilityException;

/**
* simply close the output, do not need to write trailer like the Writer.close
* It is straight forward to close the output, do not need to write trailer like the Writer.close
*/
protected abstract void closeOutput();
protected void closeOutputIfNecessary() {
}

/**
* return the file length after written.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ protected void initOutput(FileSystem fs, Path path, boolean overwritable, int bu
}

@Override
protected void closeOutput() {
protected void closeOutputIfNecessary() {
if (this.output != null) {
try {
this.output.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected void initOutput(FileSystem fs, Path path, boolean overwritable, int bu
}

@Override
protected void closeOutput() {
protected void closeOutputIfNecessary() {
if (this.output != null) {
try {
this.output.close();
Expand Down

0 comments on commit 80f410e

Please sign in to comment.