hbase git commit: HBASE-19031 Align exist method in Table and AsyncTable interfaces

2017-10-28 Thread chia7712
Repository: hbase
Updated Branches:
  refs/heads/master e5e2bde87 -> 482d6bd3a


HBASE-19031 Align exist method in Table and AsyncTable interfaces

Deprecate Table::existsAll method and add Table::exists.
RemoteHTable already had a deprecated exists method, remove that
and implement the new exists from Table interface.

Signed-off-by: Chia-Ping Tsai 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/482d6bd3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/482d6bd3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/482d6bd3

Branch: refs/heads/master
Commit: 482d6bd3a4209b3c642b41ed4e42602a789e8369
Parents: e5e2bde
Author: Peter Somogyi 
Authored: Wed Oct 25 20:10:11 2017 -0700
Committer: Chia-Ping Tsai 
Committed: Sun Oct 29 07:11:27 2017 +0800

--
 .../org/apache/hadoop/hbase/client/HTable.java  |  5 +
 .../org/apache/hadoop/hbase/client/Table.java   | 20 +++-
 .../hadoop/hbase/rest/client/RemoteHTable.java  | 16 +---
 .../hbase/regionserver/RegionAsTable.java   |  2 +-
 4 files changed, 22 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/482d6bd3/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
--
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 7da1662..61d955f 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
@@ -945,11 +945,8 @@ public class HTable implements Table {
 return r.getExists();
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
-  public boolean[] existsAll(final List gets) throws IOException {
+  public boolean[] exists(List gets) throws IOException {
 if (gets.isEmpty()) return new boolean[]{};
 if (gets.size() == 1) return new boolean[]{exists(gets.get(0))};
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/482d6bd3/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
index f3dae4e..36a0883 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
@@ -110,7 +110,25 @@ public interface Table extends Closeable {
* @return Array of boolean.  True if the specified Get matches one or more 
keys, false if not.
* @throws IOException e
*/
-  boolean[] existsAll(List gets) throws IOException;
+  boolean[] exists(List gets) throws IOException;
+
+  /**
+   * Test for the existence of columns in the table, as specified by the Gets.
+   * This will return an array of booleans. Each value will be true if the 
related Get matches
+   * one or more keys, false if not.
+   * This is a server-side call so it prevents any data from being transferred 
to
+   * the client.
+   *
+   * @param gets the Gets
+   * @return Array of boolean.  True if the specified Get matches one or more 
keys, false if not.
+   * @throws IOException e
+   * @deprecated since 2.0 version and will be removed in 3.0 version.
+   * use {@link #exists(List)}
+   */
+  @Deprecated
+  default boolean[] existsAll(List gets) throws IOException {
+return exists(gets);
+  }
 
   /**
* Method that does a batch call on Deletes, Gets, Puts, Increments, 
Appends, RowMutations.

http://git-wip-us.apache.org/repos/asf/hbase/blob/482d6bd3/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
--
diff --git 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
index 5051d47..1eaaa65 100644
--- 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
+++ 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
@@ -367,12 +367,8 @@ public class RemoteHTable implements Table {
 return (result != null && !(result.isEmpty()));
   }
 
-  /**
-   * exists(List) is really a list of get() calls. Just use get().
-   * @param gets list of Get to test for the existence
-   */
   @Override
-  public boolean[] existsAll(List gets) throws IOException {
+  public boolean[] exists(List gets) throws IOException {
 LOG.warn("exists(List) is really list of get() calls, 

hbase git commit: HBASE-19031 Align exist method in Table and AsyncTable interfaces

2017-10-28 Thread chia7712
Repository: hbase
Updated Branches:
  refs/heads/branch-2 817dc5644 -> 0ad8a6f51


HBASE-19031 Align exist method in Table and AsyncTable interfaces

Deprecate Table::existsAll method and add Table::exists.
RemoteHTable already had a deprecated exists method, remove that
and implement the new exists from Table interface.

Signed-off-by: Chia-Ping Tsai 


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0ad8a6f5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0ad8a6f5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0ad8a6f5

Branch: refs/heads/branch-2
Commit: 0ad8a6f51b7e13f46ed67613c9382101d0d7b4f6
Parents: 817dc56
Author: Peter Somogyi 
Authored: Wed Oct 25 20:10:11 2017 -0700
Committer: Chia-Ping Tsai 
Committed: Sun Oct 29 07:17:41 2017 +0800

--
 .../org/apache/hadoop/hbase/client/HTable.java  |  5 +
 .../org/apache/hadoop/hbase/client/Table.java   | 20 +++-
 .../hadoop/hbase/rest/client/RemoteHTable.java  | 16 +---
 .../hbase/regionserver/RegionAsTable.java   |  2 +-
 4 files changed, 22 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/0ad8a6f5/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
--
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 7da1662..61d955f 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
@@ -945,11 +945,8 @@ public class HTable implements Table {
 return r.getExists();
   }
 
-  /**
-   * {@inheritDoc}
-   */
   @Override
-  public boolean[] existsAll(final List gets) throws IOException {
+  public boolean[] exists(List gets) throws IOException {
 if (gets.isEmpty()) return new boolean[]{};
 if (gets.size() == 1) return new boolean[]{exists(gets.get(0))};
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/0ad8a6f5/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
--
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
index f3dae4e..36a0883 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java
@@ -110,7 +110,25 @@ public interface Table extends Closeable {
* @return Array of boolean.  True if the specified Get matches one or more 
keys, false if not.
* @throws IOException e
*/
-  boolean[] existsAll(List gets) throws IOException;
+  boolean[] exists(List gets) throws IOException;
+
+  /**
+   * Test for the existence of columns in the table, as specified by the Gets.
+   * This will return an array of booleans. Each value will be true if the 
related Get matches
+   * one or more keys, false if not.
+   * This is a server-side call so it prevents any data from being transferred 
to
+   * the client.
+   *
+   * @param gets the Gets
+   * @return Array of boolean.  True if the specified Get matches one or more 
keys, false if not.
+   * @throws IOException e
+   * @deprecated since 2.0 version and will be removed in 3.0 version.
+   * use {@link #exists(List)}
+   */
+  @Deprecated
+  default boolean[] existsAll(List gets) throws IOException {
+return exists(gets);
+  }
 
   /**
* Method that does a batch call on Deletes, Gets, Puts, Increments, 
Appends, RowMutations.

http://git-wip-us.apache.org/repos/asf/hbase/blob/0ad8a6f5/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
--
diff --git 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
index 5051d47..1eaaa65 100644
--- 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
+++ 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
@@ -367,12 +367,8 @@ public class RemoteHTable implements Table {
 return (result != null && !(result.isEmpty()));
   }
 
-  /**
-   * exists(List) is really a list of get() calls. Just use get().
-   * @param gets list of Get to test for the existence
-   */
   @Override
-  public boolean[] existsAll(List gets) throws IOException {
+  public boolean[] exists(List gets) throws IOException {
 LOG.warn("exists(List) is really list of get()