Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-26680 Close and do not write trailer for the broken WAL writer(addendum) #4405

Merged
merged 1 commit into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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