diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java index 8437fef3bc23..608032b8e4ac 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufLogWriter.java @@ -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; } } @@ -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. diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java index 44affaf734a0..42d9a1f15f53 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java @@ -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(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java index a94449fe01e7..b15c9dd958c3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java @@ -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();