From afc58b13d75dedfdb7badaea2702842cc963318f Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Thu, 25 Feb 2010 07:57:24 +0000 Subject: [PATCH] HBASE-2257 [stargate] multiuser mode; fix error introduced with KV.parseColumn git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@916167 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/hbase/stargate/RowResource.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java b/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java index 04aa5699bc4..c640b58ff79 100644 --- a/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java +++ b/contrib/stargate/src/java/org/apache/hadoop/hbase/stargate/RowResource.java @@ -156,7 +156,11 @@ public class RowResource implements Constants { Put put = new Put(key); for (CellModel cell: row.getCells()) { byte [][] parts = KeyValue.parseColumn(cell.getColumn()); - put.add(parts[0], parts[1], cell.getTimestamp(), cell.getValue()); + if (parts.length == 2 && parts[1].length > 0) { + put.add(parts[0], parts[1], cell.getTimestamp(), cell.getValue()); + } else { + put.add(parts[0], null, cell.getTimestamp(), cell.getValue()); + } } table.put(put); if (LOG.isDebugEnabled()) { @@ -205,7 +209,11 @@ public class RowResource implements Constants { } Put put = new Put(row); byte parts[][] = KeyValue.parseColumn(column); - put.add(parts[0], parts[1], timestamp, message); + if (parts.length == 2 && parts[1].length > 0) { + put.add(parts[0], parts[1], timestamp, message); + } else { + put.add(parts[0], null, timestamp, message); + } table = pool.getTable(actualTableName); table.put(put); if (LOG.isDebugEnabled()) {