Skip to content

Commit

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

This reverts commit f133df4.
  • Loading branch information
wenwj0 authored Jun 14, 2022
1 parent 41e5b6c commit 5796b0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 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);
closeOutputIfNecessary();
closeOutput();
throw e;
}
}
Expand Down Expand Up @@ -269,10 +269,9 @@ protected abstract void initOutput(FileSystem fs, Path path, boolean overwritabl
throws IOException, StreamLacksCapabilityException;

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

/**
* 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 closeOutputIfNecessary() {
protected void closeOutput() {
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 closeOutputIfNecessary() {
protected void closeOutput() {
if (this.output != null) {
try {
this.output.close();
Expand Down

0 comments on commit 5796b0c

Please sign in to comment.