hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-13305 Get(Get get) is not copying the row key
Date Wed, 25 Mar 2015 14:38:40 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 cc750c656 -> 01fdafb5e


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/01fdafb5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/01fdafb5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/01fdafb5

Branch: refs/heads/branch-1
Commit: 01fdafb5eeaf681d7eb98e0aba4f1b1ee6f8c646
Parents: cc750c6
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:45 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/01fdafb5/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 1d3310e..eb3553b 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/01fdafb5/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 335103c..1f8ad49 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
@@ -154,6 +154,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