commit a51e89102ef171db38faf182e967571dab90bc13 Author: Yu Li Date: Tue Jan 12 15:25:44 2016 +0800 HBASE-15089 Compatibility issue on HTable#flushCommits diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutator.java index 3287335..0075f84 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutator.java @@ -25,6 +25,7 @@ import org.apache.hadoop.hbase.classification.InterfaceStability; import java.io.Closeable; import java.io.IOException; +import java.io.InterruptedIOException; import java.util.List; /** @@ -106,10 +107,10 @@ public interface BufferedMutator extends Closeable { /** * Executes all the buffered, asynchronous {@link Mutation} operations and waits until they * are done. - * - * @throws IOException if a remote or network exception occurs. + * @throws InterruptedIOException if a remote or network exception occurs + * @throws RetriesExhaustedWithDetailsException if retry more than max setting */ - void flush() throws IOException; + void flush() throws InterruptedIOException, RetriesExhaustedWithDetailsException; /** * Returns the maximum size in bytes of the write buffer for this HTable. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Connection.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Connection.java index a3f6fe6..04d619a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Connection.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Connection.java @@ -134,7 +134,7 @@ public interface Connection extends Abortable, Closeable { * @param params details on how to instantiate the {@code BufferedMutator}. * @return a {@link BufferedMutator} for the supplied tableName. */ - public BufferedMutator getBufferedMutator(BufferedMutatorParams params) throws IOException; + public BufferedMutator getBufferedMutator(BufferedMutatorParams params); /** * Retrieve a RegionLocator implementation to inspect region information on a table. The returned diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java index ce5a44c..da7f6b5 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java @@ -938,10 +938,9 @@ public class HTable implements HTableInterface { /** * {@inheritDoc} - * @throws IOException */ @Override - public void flushCommits() throws IOException { + public void flushCommits() throws InterruptedIOException, RetriesExhaustedWithDetailsException { if (mutator == null) { // nothing to flush if there's no mutator; don't bother creating one. return; @@ -1306,7 +1305,7 @@ public class HTable implements HTableInterface { } @VisibleForTesting - BufferedMutator getBufferedMutator() throws IOException { + BufferedMutator getBufferedMutator() { if (mutator == null) { this.mutator = (BufferedMutatorImpl) connection.getBufferedMutator( new BufferedMutatorParams(tableName) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java index 4cd81e7..819f3b5 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.client; import java.io.IOException; +import java.io.InterruptedIOException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; @@ -106,11 +107,12 @@ public interface HTableInterface extends Table { * This method gets called once automatically for every {@link Put} or batch * of {@link Put}s (when put(List<Put>) is used) when * {@link #isAutoFlush} is {@code true}. - * @throws IOException if a remote or network exception occurs. + * @throws InterruptedIOException if a remote or network exception occurs + * @throws RetriesExhaustedWithDetailsException if retry more than max setting * @deprecated as of 1.0.0. Replaced by {@link BufferedMutator#flush()} */ @Deprecated - void flushCommits() throws IOException; + void flushCommits() throws InterruptedIOException, RetriesExhaustedWithDetailsException; /** * Returns the maximum size in bytes of the write buffer for this HTable.