From b81cec47ec921faa5afc4cb9e882450a0a4e72a0 Mon Sep 17 00:00:00 2001 From: zhangduo Date: Tue, 27 Nov 2018 20:58:34 +0800 Subject: [PATCH] Revert "HBASE-21507 Compaction failed when execute AbstractMultiFileWriter.beforeShipped() method" This reverts commit 13955ba532e05fb2f811f2835c0a78d99fa2adf1. --- .../hbase/regionserver/AbstractMultiFileWriter.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMultiFileWriter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMultiFileWriter.java index 43d0ad8858a..2fdab813132 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMultiFileWriter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMultiFileWriter.java @@ -21,10 +21,12 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; + import org.apache.hadoop.fs.Path; import org.apache.yetus.audience.InterfaceAudience; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.hadoop.hbase.regionserver.CellSink; /** * Base class for cell sink that separates the provided cells into multiple files. @@ -117,12 +119,9 @@ public abstract class AbstractMultiFileWriter implements CellSink, ShipperListen @Override public void beforeShipped() throws IOException { - Collection writers = writers(); - if (writers != null) { - for (StoreFileWriter writer : writers) { - if (writer != null) { - writer.beforeShipped(); - } + if (this.writers() != null) { + for (StoreFileWriter writer : writers()) { + writer.beforeShipped(); } } }