From 2c4289f28443b464d7ccb770bbb1e05da2aefb3e Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Thu, 14 Jan 2010 10:39:48 +0000 Subject: [PATCH] HBASE-2024 [stargate] Deletes not working as expected HBASE-2122 [stargate] Initializing scanner column families doesn't work git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@899154 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 4 ++++ .../org/apache/hadoop/hbase/stargate/RowResource.java | 8 +++++++- .../hadoop/hbase/stargate/ScannerResultGenerator.java | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9c5974946e9..ddc9da33c16 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -159,6 +159,10 @@ Release 0.21.0 - Unreleased HBASE-2120 [stargate] Unable to delete column families (Greg Lu via Andrew Purtell) HBASE-2123 Remove 'master' command-line option from PE + HBASE-2024 [stargate] Deletes not working as expected (Greg Lu via Andrew + Purtell) + HBASE-2122 [stargate] Initializing scanner column families doesn't work + (Greg Lu via Andrew Purtell) IMPROVEMENTS HBASE-1760 Cleanup TODOs in HTable diff --git a/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java b/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java index 4dab7e2f396..6f5f315e18c 100644 --- a/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java +++ b/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java @@ -277,7 +277,13 @@ public class RowResource implements Constants { if (LOG.isDebugEnabled()) { LOG.debug("DELETE " + uriInfo.getAbsolutePath()); } - Delete delete = new Delete(rowspec.getRow()); + + Delete delete = null; + if (rowspec.hasTimestamp()) + delete = new Delete(rowspec.getRow(), rowspec.getTimestamp(), null); + else + delete = new Delete(rowspec.getRow()); + for (byte[] column: rowspec.getColumns()) { byte[][] split = KeyValue.parseColumn(column); if (rowspec.hasTimestamp()) { diff --git a/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResultGenerator.java b/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResultGenerator.java index 0fde791fd68..07abcb0892e 100644 --- a/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResultGenerator.java +++ b/src/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/ScannerResultGenerator.java @@ -59,7 +59,7 @@ public class ScannerResultGenerator extends ResultGenerator { byte[][] columns = rowspec.getColumns(); for (byte[] column: columns) { byte[][] split = KeyValue.parseColumn(column); - if (split.length == 2) { + if (split.length == 2 && split[1].length != 0) { scan.addColumn(split[0], split[1]); } else { scan.addFamily(split[0]);