You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ns...@apache.org on 2011/10/28 05:32:28 UTC
svn commit: r1190144 -
/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java
Author: nspiegelberg
Date: Fri Oct 28 03:32:28 2011
New Revision: 1190144
URL: http://svn.apache.org/viewvc?rev=1190144&view=rev
Log:
HBASE-4679 Thrift null mutation error
Summary: When using null as a value for a mutation, HB90 failed and threw an
error. Fixed by checking for null bytebuffer, and added unit test in thrift for
hb90 and hb89, to make sure doesn't throw exception.
Test Plan: Run Unit tests, make sure rli's script works again on those tiers
once rolled out.
Reviewers: kranganathan, dhruba
Reviewed By: dhruba
CC: rli, gqchen, dhruba
Differential Revision: 327775
Task ID: 709103
Modified:
hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java
Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java?rev=1190144&r1=1190143&r2=1190144&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java Fri Oct 28 03:32:28 2011
@@ -155,6 +155,14 @@ public class TestThriftServer extends HB
size = handler.getRow(tableAname, rowBname).size();
assertEquals(0, size);
+ // Try null mutation
+ List<Mutation> mutations = new ArrayList<Mutation>();
+ mutations.add(new Mutation(false, columnAname, null));
+ handler.mutateRow(tableAname, rowAname, mutations);
+ TRowResult rowResult3 = handler.getRow(tableAname, rowAname).get(0);
+ assertEquals(rowAname, rowResult3.row);
+ assertEquals(0, rowResult3.columns.get(columnAname).value.length);
+
// Teardown
handler.disableTable(tableAname);
handler.deleteTable(tableAname);