HBASE-13305 Get(Get get) is not copying the row key

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Ashish Singhi 2015-03-21 20:38:59 +05:30 committed by stack
parent 8579c6dd49
commit b5c4d9a04f
2 changed files with 8 additions and 0 deletions

View File

@ -98,6 +98,7 @@ public class Get extends Query
* @param get * @param get
*/ */
public Get(Get get) { public Get(Get get) {
this(get.getRow());
this.filter = get.getFilter(); this.filter = get.getFilter();
this.cacheBlocks = get.getCacheBlocks(); this.cacheBlocks = get.getCacheBlocks();
this.maxVersions = get.getMaxVersions(); this.maxVersions = get.getMaxVersions();

View File

@ -156,6 +156,13 @@ public class TestGet {
Assert.assertEquals(1, qualifiers.size()); 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 @Test
public void testDynamicFilter() throws Exception { public void testDynamicFilter() throws Exception {
Configuration conf = HBaseConfiguration.create(); Configuration conf = HBaseConfiguration.create();