diff --git a/CHANGES.txt b/CHANGES.txt index 8bc4fe2571c..2e10f0bd8f6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -23,6 +23,7 @@ Release 0.3.0 - Unreleased HBASE-808,809 MAX_VERSIONS not respected, and Deletall doesn't and inserts after delete don't work as expected (Jean-Daniel Cryans via Stack) + HBASE-831 committing BatchUpdate with no row should complain IMPROVEMENTS HBASE-801 When a table haven't disable, shell could response in a "user diff --git a/src/java/org/apache/hadoop/hbase/client/HTable.java b/src/java/org/apache/hadoop/hbase/client/HTable.java index 676da7b6b35..9771e0db524 100644 --- a/src/java/org/apache/hadoop/hbase/client/HTable.java +++ b/src/java/org/apache/hadoop/hbase/client/HTable.java @@ -1252,6 +1252,8 @@ public class HTable { public synchronized void commit(final BatchUpdate batchUpdate, final RowLock rl) throws IOException { + if (batchUpdate.getRow() == null) + throw new IllegalArgumentException("update has null row"); connection.getRegionServerWithRetries( new ServerCallable(connection, tableName, batchUpdate.getRow()) { public Boolean call() throws IOException { diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index fb5eca4cf01..f75acf6820e 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -1129,6 +1129,8 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { /** {@inheritDoc} */ public void batchUpdate(final byte [] regionName, BatchUpdate b, long lockId) throws IOException { + if (b.getRow() == null) + throw new IllegalArgumentException("update has null row"); checkOpen(); this.requestCount.incrementAndGet(); HRegion region = getRegion(regionName);