diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java index 2ee00d939fc..0b222b106c2 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorImpl.java @@ -23,6 +23,8 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.ipc.RpcControllerFactory; +import com.google.common.annotations.VisibleForTesting; + import java.io.IOException; import java.io.InterruptedIOException; import java.util.LinkedList; @@ -52,7 +54,8 @@ public class BufferedMutatorImpl implements BufferedMutator { protected ClusterConnection connection; // non-final so can be overridden in test private final TableName tableName; private volatile Configuration conf; - private List writeAsyncBuffer = new LinkedList<>(); + @VisibleForTesting + List writeAsyncBuffer = new LinkedList<>(); private long writeBufferSize; private final int maxKeyValueSize; protected long currentWriteBufferSize = 0; @@ -245,14 +248,4 @@ public class BufferedMutatorImpl implements BufferedMutator { public long getWriteBufferSize() { return this.writeBufferSize; } - - /** - * This is used for legacy purposes only. This should not beÓ - * called from production uses. - * @deprecated Going away when we drop public support for {@link HTableInterface}. -Ó */ - @Deprecated - public List getWriteBuffer() { - return this.writeAsyncBuffer; - } } diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java index 8340f971312..fa3ed32d7a7 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncProcess.java @@ -729,13 +729,13 @@ public class TestAsyncProcess { // puts, we may raise an exception in the middle of the list. It's then up to the caller to // manage what was inserted, what was tried but failed, and what was not even tried. p = createPut(1, true); - Assert.assertEquals(0, mutator.getWriteBuffer().size()); + Assert.assertEquals(0, mutator.writeAsyncBuffer.size()); try { mutator.mutate(p); Assert.fail(); } catch (RetriesExhaustedException expected) { } - Assert.assertEquals("the put should not been inserted.", 0, mutator.getWriteBuffer().size()); + Assert.assertEquals("the put should not been inserted.", 0, mutator.writeAsyncBuffer.size()); }