[11/50] [abbrv] hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7abaf22a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7abaf22a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7abaf22a Branch: refs/heads/HBASE-19064 Commit: 7abaf22a12cc9e2655ff57ad46f66e2189fd52e2 Parents: 5937202 Author: Pankaj Kumar Authored: Wed Apr 4 10:11:09 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 10:11:09 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 9 +--- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 28 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/7abaf22a/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 cc3efdd..29b48e1 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 @@ -115,13 +115,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { - sb.append(toURLEncodedBytes((byte[])o)); + sb.append(':'); + sb.append(toURLEncodedBytes((byte[]) o)); } else if (o instanceof KeyValue) { - sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue)o))); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue) o))); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/7abaf22a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 5053d91..c6f5195 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -353,18 +353,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); put.addColumn(COLUMN_2, QUALIFIER_2, VALUE_2); +put.addColumn(COLUMN_3, QUALIFIER_1, VALUE_1); +put.addColumn(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -394,6 +403,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);
hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
Repository: hbase Updated Branches: refs/heads/branch-1.2 76f599de9 -> 8eac32fe9 HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8eac32fe Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8eac32fe Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8eac32fe Branch: refs/heads/branch-1.2 Commit: 8eac32fe92cc960490a9f560133b5be2c05558b4 Parents: 76f599d Author: Pankaj Kumar Authored: Wed Apr 4 14:44:12 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 14:44:12 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 7 +-- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 27 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/8eac32fe/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 8c5c168..e878794 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 @@ -109,13 +109,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(Bytes.toStringBinary((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { + sb.append(':'); sb.append(Bytes.toStringBinary((byte[])o)); } else if (o instanceof KeyValue) { - sb.append(Bytes.toStringBinary(((KeyValue)o).getQualifier())); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(Bytes.toStringBinary(((KeyValue) o).getQualifier())); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/8eac32fe/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 121ff65..cd33edd 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -330,18 +330,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.add(COLUMN_1, QUALIFIER_1, VALUE_1); put.add(COLUMN_2, QUALIFIER_2, VALUE_2); +put.add(COLUMN_3, QUALIFIER_1, VALUE_1); +put.add(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -371,6 +380,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);
hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
Repository: hbase Updated Branches: refs/heads/branch-1.3 0db4bd3aa -> 090adcd37 HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/090adcd3 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/090adcd3 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/090adcd3 Branch: refs/heads/branch-1.3 Commit: 090adcd375e5df8d24e16f88c15cc2bfda383808 Parents: 0db4bd3 Author: Pankaj Kumar Authored: Wed Apr 4 14:43:02 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 14:43:02 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 7 +-- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 27 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/090adcd3/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 8fa1b8a..6b0aad1 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 @@ -109,13 +109,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(Bytes.toStringBinary((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { + sb.append(':'); sb.append(Bytes.toStringBinary((byte[])o)); } else if (o instanceof KeyValue) { - sb.append(Bytes.toStringBinary(((KeyValue)o).getQualifier())); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(Bytes.toStringBinary(((KeyValue) o).getQualifier())); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/090adcd3/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 121ff65..cd33edd 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -330,18 +330,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.add(COLUMN_1, QUALIFIER_1, VALUE_1); put.add(COLUMN_2, QUALIFIER_2, VALUE_2); +put.add(COLUMN_3, QUALIFIER_1, VALUE_1); +put.add(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -371,6 +380,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);
hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
Repository: hbase Updated Branches: refs/heads/branch-1.4 98c6f8a3f -> 0ccdffe95 HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/0ccdffe9 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0ccdffe9 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0ccdffe9 Branch: refs/heads/branch-1.4 Commit: 0ccdffe95236617678bf09f5bf670524cb2ae666 Parents: 98c6f8a Author: Pankaj Kumar Authored: Wed Apr 4 10:16:58 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 10:16:58 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 7 +-- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 27 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/0ccdffe9/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 463b232..fc6a90f 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 @@ -112,13 +112,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { + sb.append(':'); sb.append(toURLEncodedBytes((byte[])o)); } else if (o instanceof KeyValue) { - sb.append(toURLEncodedBytes(((KeyValue)o).getQualifier())); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(toURLEncodedBytes(((KeyValue) o).getQualifier())); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/0ccdffe9/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 342fc4e..28f3798 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -349,18 +349,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.add(COLUMN_1, QUALIFIER_1, VALUE_1); put.add(COLUMN_2, QUALIFIER_2, VALUE_2); +put.add(COLUMN_3, QUALIFIER_1, VALUE_1); +put.add(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -390,6 +399,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);
hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
Repository: hbase Updated Branches: refs/heads/branch-1 9ced0c936 -> 2eae8104d HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2eae8104 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2eae8104 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2eae8104 Branch: refs/heads/branch-1 Commit: 2eae8104d19cc8be1b69f4969623b9a9f15e2593 Parents: 9ced0c9 Author: Pankaj Kumar Authored: Wed Apr 4 10:16:11 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 10:16:11 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 7 +-- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 27 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/2eae8104/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 463b232..fc6a90f 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 @@ -112,13 +112,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { + sb.append(':'); sb.append(toURLEncodedBytes((byte[])o)); } else if (o instanceof KeyValue) { - sb.append(toURLEncodedBytes(((KeyValue)o).getQualifier())); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(toURLEncodedBytes(((KeyValue) o).getQualifier())); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/2eae8104/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 342fc4e..28f3798 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -349,18 +349,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.add(COLUMN_1, QUALIFIER_1, VALUE_1); put.add(COLUMN_2, QUALIFIER_2, VALUE_2); +put.add(COLUMN_3, QUALIFIER_1, VALUE_1); +put.add(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -390,6 +399,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);
hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
Repository: hbase Updated Branches: refs/heads/branch-2.0 79bb54ddf -> d7cb0bd41 HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d7cb0bd4 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d7cb0bd4 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d7cb0bd4 Branch: refs/heads/branch-2.0 Commit: d7cb0bd4179951d973d60eff6ad68b4a5822f507 Parents: 79bb54d Author: Pankaj Kumar Authored: Wed Apr 4 10:14:46 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 10:14:46 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 9 +--- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 28 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/d7cb0bd4/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 cc3efdd..29b48e1 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 @@ -115,13 +115,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { - sb.append(toURLEncodedBytes((byte[])o)); + sb.append(':'); + sb.append(toURLEncodedBytes((byte[]) o)); } else if (o instanceof KeyValue) { - sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue)o))); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue) o))); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/d7cb0bd4/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 5053d91..c6f5195 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -353,18 +353,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); put.addColumn(COLUMN_2, QUALIFIER_2, VALUE_2); +put.addColumn(COLUMN_3, QUALIFIER_1, VALUE_1); +put.addColumn(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -394,6 +403,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);
hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
Repository: hbase Updated Branches: refs/heads/branch-2 b8a13ba10 -> a761f175a HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/a761f175 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a761f175 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a761f175 Branch: refs/heads/branch-2 Commit: a761f175ab1ab48be3462b4a2161a1663a719620 Parents: b8a13ba Author: Pankaj Kumar Authored: Wed Apr 4 10:13:34 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 10:13:34 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 9 +--- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 28 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/a761f175/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 cc3efdd..29b48e1 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 @@ -115,13 +115,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { - sb.append(toURLEncodedBytes((byte[])o)); + sb.append(':'); + sb.append(toURLEncodedBytes((byte[]) o)); } else if (o instanceof KeyValue) { - sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue)o))); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue) o))); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/a761f175/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 5053d91..c6f5195 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -353,18 +353,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); put.addColumn(COLUMN_2, QUALIFIER_2, VALUE_2); +put.addColumn(COLUMN_3, QUALIFIER_1, VALUE_1); +put.addColumn(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -394,6 +403,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);
hbase git commit: HBASE-20231 Not able to delete column family from a row using RemoteHTable
Repository: hbase Updated Branches: refs/heads/master 5937202fd -> 7abaf22a1 HBASE-20231 Not able to delete column family from a row using RemoteHTable Signed-off-by: Ashish Singhi Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7abaf22a Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7abaf22a Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7abaf22a Branch: refs/heads/master Commit: 7abaf22a12cc9e2655ff57ad46f66e2189fd52e2 Parents: 5937202 Author: Pankaj Kumar Authored: Wed Apr 4 10:11:09 2018 +0530 Committer: Ashish Singhi Committed: Wed Apr 4 10:11:09 2018 +0530 -- .../hadoop/hbase/rest/client/RemoteHTable.java | 9 +--- .../hbase/rest/client/TestRemoteTable.java | 22 2 files changed, 28 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hbase/blob/7abaf22a/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 cc3efdd..29b48e1 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 @@ -115,13 +115,16 @@ public class RemoteHTable implements Table { Iterator ii = quals.iterator(); while (ii.hasNext()) { sb.append(toURLEncodedBytes((byte[])e.getKey())); -sb.append(':'); Object o = ii.next(); // Puts use byte[] but Deletes use KeyValue if (o instanceof byte[]) { - sb.append(toURLEncodedBytes((byte[])o)); + sb.append(':'); + sb.append(toURLEncodedBytes((byte[]) o)); } else if (o instanceof KeyValue) { - sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue)o))); + if (((KeyValue) o).getQualifierLength() != 0) { +sb.append(':'); +sb.append(toURLEncodedBytes(CellUtil.cloneQualifier((KeyValue) o))); + } } else { throw new RuntimeException("object type not handled"); } http://git-wip-us.apache.org/repos/asf/hbase/blob/7abaf22a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java -- diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java index 5053d91..c6f5195 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java @@ -353,18 +353,27 @@ public class TestRemoteTable { Put put = new Put(ROW_3); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); put.addColumn(COLUMN_2, QUALIFIER_2, VALUE_2); +put.addColumn(COLUMN_3, QUALIFIER_1, VALUE_1); +put.addColumn(COLUMN_3, QUALIFIER_2, VALUE_2); remoteTable.put(put); Get get = new Get(ROW_3); get.addFamily(COLUMN_1); get.addFamily(COLUMN_2); +get.addFamily(COLUMN_3); Result result = remoteTable.get(get); byte[] value1 = result.getValue(COLUMN_1, QUALIFIER_1); byte[] value2 = result.getValue(COLUMN_2, QUALIFIER_2); +byte[] value3 = result.getValue(COLUMN_3, QUALIFIER_1); +byte[] value4 = result.getValue(COLUMN_3, QUALIFIER_2); assertNotNull(value1); assertTrue(Bytes.equals(VALUE_1, value1)); assertNotNull(value2); assertTrue(Bytes.equals(VALUE_2, value2)); +assertNotNull(value3); +assertTrue(Bytes.equals(VALUE_1, value3)); +assertNotNull(value4); +assertTrue(Bytes.equals(VALUE_2, value4)); Delete delete = new Delete(ROW_3); delete.addColumn(COLUMN_2, QUALIFIER_2); @@ -394,6 +403,19 @@ public class TestRemoteTable { assertTrue(Bytes.equals(VALUE_1, value1)); assertNull(value2); +// Delete column family from row +delete = new Delete(ROW_3); +delete.addFamily(COLUMN_3); +remoteTable.delete(delete); + +get = new Get(ROW_3); +get.addFamily(COLUMN_3); +result = remoteTable.get(get); +value3 = result.getValue(COLUMN_3, QUALIFIER_1); +value4 = result.getValue(COLUMN_3, QUALIFIER_2); +assertNull(value3); +assertNull(value4); + delete = new Delete(ROW_3); remoteTable.delete(delete);