You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2011/02/23 23:56:12 UTC
svn commit: r1073976 [3/3] - in /hbase/branches/0.90: ./
src/main/java/org/apache/hadoop/hbase/thrift/
src/main/java/org/apache/hadoop/hbase/thrift/generated/
src/main/resources/org/apache/hadoop/hbase/thrift/
src/test/java/org/apache/hadoop/hbase/thrift/
Modified: hbase/branches/0.90/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift?rev=1073976&r1=1073975&r2=1073976&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift (original)
+++ hbase/branches/0.90/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift Wed Feb 23 22:56:12 2011
@@ -364,6 +364,72 @@ service Hbase {
4:i64 timestamp
) throws (1:IOError io)
+ /**
+ * Get all the data for the specified table and rows at the latest
+ * timestamp. Returns an empty list if no rows exist.
+ *
+ * @return TRowResult containing the rows and map of columns to TCells
+ */
+ list<TRowResult> getRows(
+ /** name of table */
+ 1:Text tableName,
+
+ /** row keys */
+ 2:list<Text> rows
+ ) throws (1:IOError io)
+
+ /**
+ * Get the specified columns for the specified table and rows at the latest
+ * timestamp. Returns an empty list if no rows exist.
+ *
+ * @return TRowResult containing the rows and map of columns to TCells
+ */
+ list<TRowResult> getRowsWithColumns(
+ /** name of table */
+ 1:Text tableName,
+
+ /** row keys */
+ 2:list<Text> rows
+
+ /** List of columns to return, null for all columns */
+ 3:list<Text> columns
+ ) throws (1:IOError io)
+
+ /**
+ * Get all the data for the specified table and rows at the specified
+ * timestamp. Returns an empty list if no rows exist.
+ *
+ * @return TRowResult containing the rows and map of columns to TCells
+ */
+ list<TRowResult> getRowsTs(
+ /** name of the table */
+ 1:Text tableName,
+
+ /** row keys */
+ 2:list<Text> rows
+
+ /** timestamp */
+ 3:i64 timestamp
+ ) throws (1:IOError io)
+
+ /**
+ * Get the specified columns for the specified table and rows at the specified
+ * timestamp. Returns an empty list if no rows exist.
+ *
+ * @return TRowResult containing the rows and map of columns to TCells
+ */
+ list<TRowResult> getRowsWithColumnsTs(
+ /** name of table */
+ 1:Text tableName,
+
+ /** row keys */
+ 2:list<Text> rows
+
+ /** List of columns to return, null for all columns */
+ 3:list<Text> columns,
+ 4:i64 timestamp
+ ) throws (1:IOError io)
+
/**
* Apply a series of mutations (updates/deletes) to a row in a
* single transaction. If an exception is thrown, then the
Modified: hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java?rev=1073976&r1=1073975&r2=1073976&view=diff
==============================================================================
--- hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java (original)
+++ hbase/branches/0.90/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java Wed Feb 23 22:56:12 2011
@@ -184,7 +184,7 @@ public class TestThriftServer extends HB
// Apply an overlapping timestamped mutation to rowB
handler.mutateRowTs(tableAname, rowBname, getMutations(), time2);
- // the getVerTs is [inf, ts) so you need to increment one.
+ // the getVerTs is [-inf, ts) so you need to increment one.
time1 += 1;
time2 += 2;
@@ -215,6 +215,15 @@ public class TestThriftServer extends HB
assertTrue(Bytes.equals(rowResult1.columns.get(columnBname).value, valueBname));
assertFalse(rowResult1.columns.containsKey(columnAname));
+ // query using the getRows() api:
+ List<byte[]> rows = new ArrayList<byte[]>();
+ rows.add(rowAname); rows.add(rowBname);
+ List<TRowResult> r = handler.getRows(tableAname, rows);
+ assertEquals(2, r.size());
+
+ r = handler.getRowsWithColumns(tableAname, rows, columns);
+ assertEquals(2, r.size());
+
// Apply some timestamped deletes
// this actually deletes _everything_.
// nukes everything in columnB: forever.