hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [07/13] hbase git commit: HBASE-13305 Get(Get get) is not copying the row key
Date Wed, 25 Mar 2015 16:59:56 GMT
HBASE-13305 Get(Get get) is not copying the row key

Signed-off-by: stack <stack@apache.org>


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

Branch: refs/heads/hbase-12439
Commit: b5c4d9a04f7a3c44728218b913593fd46495f094
Parents: 8579c6d
Author: Ashish Singhi <ashish.singhi@huawei.com>
Authored: Sat Mar 21 20:38:59 2015 +0530
Committer: stack <stack@apache.org>
Committed: Wed Mar 25 07:39:05 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/client/Get.java     | 1 +
 .../src/test/java/org/apache/hadoop/hbase/client/TestGet.java | 7 +++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b5c4d9a0/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java
index 701cd9c..3fa145c 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Get.java
@@ -98,6 +98,7 @@ public class Get extends Query
    * @param get
    */
   public Get(Get get) {
+    this(get.getRow());
     this.filter = get.getFilter();
     this.cacheBlocks = get.getCacheBlocks();
     this.maxVersions = get.getMaxVersions();

http://git-wip-us.apache.org/repos/asf/hbase/blob/b5c4d9a0/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
index 23e538c..fd1ba50 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
@@ -155,6 +155,13 @@ public class TestGet {
     Set<byte[]> qualifiers = get.getFamilyMap().get(family);
     Assert.assertEquals(1, qualifiers.size());
   }
+  
+  @Test
+  public void TestGetRowFromGetCopyConstructor() throws Exception {
+    Get get = new Get(ROW);
+    Get copyGet = new Get(get);
+    assertEquals(0, Bytes.compareTo(get.getRow(), copyGet.getRow()));
+  }
 
   @Test
   public void testDynamicFilter() throws Exception {


Mime
View raw message