hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1387310 [3/3] - in /hbase/branches/0.89-fb/src: main/java/org/apache/hadoop/hbase/regionserver/ main/java/org/apache/hadoop/hbase/thrift/ main/java/org/apache/hadoop/hbase/thrift/generated/ main/java/org/apache/hadoop/hbase/util/ main/reso...
Date Tue, 18 Sep 2012 18:39:55 GMT
Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
Tue Sep 18 18:39:54 2012
@@ -369,6 +369,8 @@ public class IOError extends java.io.IOE
 
   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException
{
     try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky,
and doesn't call the default constructor.
+      __isset_bit_vector = new BitSet(1);
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
       throw new java.io.IOException(te);

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java.new
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java.new?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java.new
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/IOError.java.new
Tue Sep 18 18:39:54 2012
@@ -369,6 +369,8 @@ public class IOError extends java.io.IOE
 
   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException
{
     try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky,
and doesn't call the default constructor.
+      __isset_bit_vector = new BitSet(1);
       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
     } catch (org.apache.thrift.TException te) {
       throw new java.io.IOException(te);

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
Tue Sep 18 18:39:54 2012
@@ -443,7 +443,7 @@ public class TRowResult implements org.a
                 for (int _i9 = 0; _i9 < _map8.size; ++_i9)
                 {
                   ByteBuffer _key10; // required
-                  TCell _val11; // required
+                  TCell _val11; // optional
                   _key10 = iprot.readBinary();
                   _val11 = new TCell();
                   _val11.read(iprot);
@@ -544,7 +544,7 @@ public class TRowResult implements org.a
           for (int _i15 = 0; _i15 < _map14.size; ++_i15)
           {
             ByteBuffer _key16; // required
-            TCell _val17; // required
+            TCell _val17; // optional
             _key16 = iprot.readBinary();
             _val17 = new TCell();
             _val17.read(iprot);

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/util/Bytes.java?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/util/Bytes.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/util/Bytes.java Tue Sep 18
18:39:54 2012
@@ -1470,4 +1470,12 @@ public class Bytes {
     return toString(b, 0, n);
   }
 
+  /**
+   * @param b a byte buffer
+   * @return true if the given byte buffer is non-null and non-empty (has remaining bytes)
+   */
+  public static boolean isNonEmpty(ByteBuffer b) {
+    return b != null && b.remaining() > 0;
+  }
+
 }

Modified: hbase/branches/0.89-fb/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
(original)
+++ hbase/branches/0.89-fb/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
Tue Sep 18 18:39:54 2012
@@ -172,7 +172,7 @@ exception AlreadyExists {
 // of merging changes between various client and server branches.
 
 service Hbase {
-  /** 
+  /**
    * Atomically increment the column value specified. Returns the next value
    * post increment.
    */
@@ -272,7 +272,9 @@ service Hbase {
     2:Text row,
 
     /** name of column whose value is to be deleted */
-    3:Text column
+    3:Text column,
+
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -286,7 +288,9 @@ service Hbase {
     2:Text row
 
     /** Delete attributes */
-    3:map<Text, Text> attributes
+    3:map<Text, Text> attributes,
+
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -301,7 +305,9 @@ service Hbase {
     2:Text row,
 
     /** timestamp */
-    3:i64 timestamp
+    3:i64 timestamp,
+
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -319,7 +325,9 @@ service Hbase {
     3:Text column,
 
     /** timestamp */
-    4:i64 timestamp
+    4:i64 timestamp,
+
+    5:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -364,7 +372,9 @@ service Hbase {
     2:Text row,
 
     /** column name */
-    3:Text column
+    3:Text column,
+
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -400,7 +410,9 @@ service Hbase {
     1:Text tableName,
 
     /** row key */
-    2:Text row
+    2:Text row,
+
+    3:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -417,7 +429,9 @@ service Hbase {
     2:Text row,
 
     /** timestamp */
-    3:i64 timestamp
+    3:i64 timestamp,
+
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -440,7 +454,9 @@ service Hbase {
      * If only <qualifier prefix> provided then all families are
      * searched
      */
-    3:Text prefix
+    3:Text prefix,
+
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -465,7 +481,9 @@ service Hbase {
      */
     3:Text prefix
 
-    4:i64 timestamp
+    4:i64 timestamp,
+
+    5:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -482,7 +500,9 @@ service Hbase {
     2:Text row,
 
     /** List of columns to return, null for all columns */
-    3:list<Text> columns
+    3:list<Text> columns,
+
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -500,7 +520,8 @@ service Hbase {
 
     /** List of columns to return, null for all columns */
     3:list<Text> columns,
-    4:i64 timestamp
+    4:i64 timestamp,
+    5:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -512,6 +533,7 @@ service Hbase {
   list<TRowResult> getRows(
     1:Text tableName,
     2:list<Text> rows,
+    3:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -522,7 +544,8 @@ service Hbase {
   list<TRowResult> getRowsTs(
     1:Text tableName,
     2:list<Text> rows,
-    3:i64 timestamp
+    3:i64 timestamp,
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -533,7 +556,8 @@ service Hbase {
   list<TRowResult> getRowsWithColumns(
     1:Text tableName,
     2:list<Text> rows,
-    3:list<Text> families
+    3:list<Text> families,
+    4:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -546,7 +570,8 @@ service Hbase {
     1:Text tableName,
     2:list<Text> rows,
     3:list<Text> families
-    4:i64 timestamp
+    4:i64 timestamp,
+    5:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -584,7 +609,9 @@ service Hbase {
     3:Text column,
 
     /** number of versions to retrieve */
-    4:i32 numVersions
+    4:i32 numVersions,
+
+    5:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -608,7 +635,9 @@ service Hbase {
     4:i64 timestamp,
 
     /** number of versions to retrieve */
-    5:i32 numVersions
+    5:i32 numVersions,
+
+    6:Text regionName
   ) throws (1:IOError io)
 
   /**
@@ -623,6 +652,22 @@ service Hbase {
     throws (1:IOError io)
 
   /**
+   * Apply a batch of puts for the target region.
+   * It assumes all the BatchMuations are Put operations
+   * and ignores the isDelete field in Mutation.
+   */
+  void multiPut(
+    /** name of tableName */
+    1:Text tableName,
+
+    /** list of Put */
+    2:list<BatchMutation> rowBatches,
+
+    /** name of the region */
+    3:Text regionName
+  ) throws (1:IOError io, 2:IllegalArgument ia)
+
+  /**
    * Apply a series of mutations (updates/deletes) to a row in a
    * single transaction.  If an exception is thrown, then the
    * transaction is aborted.  Default current timestamp is used, and
@@ -639,7 +684,9 @@ service Hbase {
     3:list<Mutation> mutations,
 
     /** Put attributes */
-    4:map<Text, Text> attributes
+    4:map<Text, Text> attributes,
+
+    7:Text regionName
   ) throws (1:IOError io, 2:IllegalArgument ia)
 
   /**
@@ -662,7 +709,9 @@ service Hbase {
     4:i64 timestamp,
 
     /** Put attributes */
-    5:map<Text, Text> attributes
+    5:map<Text, Text> attributes,
+
+    6:Text regionName
   ) throws (1:IOError io, 2:IllegalArgument ia)
 
   /**
@@ -679,7 +728,9 @@ service Hbase {
     2:list<BatchMutation> rowBatches,
 
     /** Put attributes */
-    3:map<Text, Text> attributes
+    3:map<Text, Text> attributes,
+
+    4:Text regionName
   ) throws (1:IOError io, 2:IllegalArgument ia)
 
   /**
@@ -718,7 +769,9 @@ service Hbase {
     3:i64 timestamp,
 
     /** Put attributes */
-    4:map<Text, Text> attributes
+    4:map<Text, Text> attributes,
+
+    5:Text regionName
   ) throws (1:IOError io, 2:IllegalArgument ia)
 
   /**

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestMutationWriteToWAL.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestMutationWriteToWAL.java?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestMutationWriteToWAL.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestMutationWriteToWAL.java
Tue Sep 18 18:39:54 2012
@@ -110,12 +110,12 @@ public class TestMutationWriteToWAL exte
         final ByteBuffer rowBuf = ByteBuffer.wrap(Bytes.toBytes(row));
         // Exercise both APIs.
         if (i % 2 == 0) {
-          client.mutateRow(HTestConst.DEFAULT_TABLE_BYTE_BUF, rowBuf, mutations, null);
+          client.mutateRow(HTestConst.DEFAULT_TABLE_BYTE_BUF, rowBuf, mutations, null, null);
         } else {
           List<BatchMutation> rowBatches = new ArrayList<BatchMutation>();
           BatchMutation bm = new BatchMutation(rowBuf, mutations);
           rowBatches.add(bm);
-          client.mutateRows(HTestConst.DEFAULT_TABLE_BYTE_BUF, rowBatches, null);
+          client.mutateRows(HTestConst.DEFAULT_TABLE_BYTE_BUF, rowBatches, null, null);
         }
       }
       client.disableTable(HTestConst.DEFAULT_TABLE_BYTE_BUF);
@@ -125,7 +125,7 @@ public class TestMutationWriteToWAL exte
       for (int i = 0; i < NUM_ROWS; ++i) {
         final String row = getRow(i);
         List<TRowResult> results = client.getRow(HTestConst.DEFAULT_TABLE_BYTE_BUF,
-            ByteBuffer.wrap(Bytes.toBytes(row)));
+            ByteBuffer.wrap(Bytes.toBytes(row)), null);
         TRowResult result = results.get(0);
         assertEquals("No results found for row " + row, expectedEntriesForRow[i],
             result.getColumnsSize());

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftMutationAPI.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftMutationAPI.java?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftMutationAPI.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftMutationAPI.java
Tue Sep 18 18:39:54 2012
@@ -134,7 +134,7 @@ public class TestThriftMutationAPI exten
       if (bms.size() == 1) {
         doSingleRowMutation(client, rand, bms, defaultTS);
       } else {
-        client.mutateRowsTs(HTestConst.DEFAULT_TABLE_BYTE_BUF, bms, defaultTS, null);
+        client.mutateRowsTs(HTestConst.DEFAULT_TABLE_BYTE_BUF, bms, defaultTS, null, null);
         numMutateRows++;
       }
       
@@ -165,7 +165,7 @@ public class TestThriftMutationAPI exten
     ByteBuffer colBuf = ByteBuffer.wrap(Bytes.toBytes(col));
     TRowResult rowResult = rowResults.get(row);
     if (rowResult == null) {
-      List<TRowResult> result = client.getRow(HTestConst.DEFAULT_TABLE_BYTE_BUF, rowBuf);
+      List<TRowResult> result = client.getRow(HTestConst.DEFAULT_TABLE_BYTE_BUF, rowBuf,
null);
       if (!result.isEmpty()) {
         assertEquals(1, result.size());
         rowResult = result.get(0);
@@ -221,7 +221,7 @@ public class TestThriftMutationAPI exten
     
     // We did not check-and-mutate, do a normal operation.
     client.mutateRowTs(HTestConst.DEFAULT_TABLE_BYTE_BUF,
-        bm.bufferForRow(), bm.getMutations(), defaultTS, null);
+        bm.bufferForRow(), bm.getMutations(), defaultTS, null, null);
     numMutateRow++;
   }
 

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=1387310&r1=1387309&r2=1387310&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
Tue Sep 18 18:39:54 2012
@@ -263,70 +263,73 @@ public class TestThriftServer {
     handler.createTable(tableAname, getColumnDescriptors());
     try {
       // Apply a few Mutations to rowA
-      handler.mutateRow(tableAname, rowAname, getMutations(), null);
+      handler.mutateRow(tableAname, rowAname, getMutations(), null, null);
   
       // Assert that the changes were made
       assertBufferEquals(valueAname,
-        handler.get(tableAname, rowAname, columnAname).get(0).value);
-      TRowResult rowResult1 = handler.getRow(tableAname, rowAname).get(0);
+        handler.get(tableAname, rowAname, columnAname, null).get(0).value);
+      TRowResult rowResult1 = handler.getRow(tableAname, rowAname, null).get(0);
       assertBufferEquals(rowAname, rowResult1.row);
       assertBufferEquals(valueBname,
         rowResult1.columns.get(columnBname).value);
   
       // Apply a few BatchMutations for rowA and rowB
-      handler.mutateRows(tableAname, getBatchMutations(), null);
+      handler.mutateRows(tableAname, getBatchMutations(), null, null);
   
       // Assert that changes were made to rowA
-      List<TCell> cells = handler.get(tableAname, rowAname, columnAname);
+      List<TCell> cells = handler.get(tableAname, rowAname, columnAname, null);
       assertFalse(cells.size() > 0);
-      assertBufferEquals(valueCname, handler.get(tableAname, rowAname, columnBname).get(0).value);
-      List<TCell> versions = handler.getVer(tableAname, rowAname, columnBname, MAXVERSIONS);
+      assertBufferEquals(valueCname, handler.get(tableAname, rowAname, columnBname, 
+          null).get(0).value);
+      List<TCell> versions = handler.getVer(tableAname, rowAname, columnBname, MAXVERSIONS,
+          null);
       assertBufferEquals(valueCname, versions.get(0).value);
       assertBufferEquals(valueBname, versions.get(1).value);
   
       // Assert that changes were made to rowB
-      TRowResult rowResult2 = handler.getRow(tableAname, rowBname).get(0);
+      TRowResult rowResult2 = handler.getRow(tableAname, rowBname,
+          null).get(0);
       assertBufferEquals(rowBname, rowResult2.row);
       assertBufferEquals(valueCname, rowResult2.columns.get(columnAname).value);
       assertBufferEquals(valueDname, rowResult2.columns.get(columnBname).value);
   
       // Apply some deletes
-      handler.deleteAll(tableAname, rowAname, columnBname);
-      handler.deleteAllRow(tableAname, rowBname, null);
+      handler.deleteAll(tableAname, rowAname, columnBname, null);
+      handler.deleteAllRow(tableAname, rowBname, null, null);
   
       // Assert that the deletes were applied
-      int size = handler.get(tableAname, rowAname, columnBname).size();
+      int size = handler.get(tableAname, rowAname, columnBname, null).size();
       assertEquals(0, size);
-      size = handler.getRow(tableAname, rowBname).size();
+      size = handler.getRow(tableAname, rowBname, null).size();
       assertEquals(0, size);
   
       // Try null mutation
       List<Mutation> mutations = new ArrayList<Mutation>();
       mutations.add(new Mutation(false, columnAname, null, true, HConstants.LATEST_TIMESTAMP));
-      handler.mutateRow(tableAname, rowAname, mutations, null);
-      TRowResult rowResult3 = handler.getRow(tableAname, rowAname).get(0);
+      handler.mutateRow(tableAname, rowAname, mutations, null, null);
+      TRowResult rowResult3 = handler.getRow(tableAname, rowAname, null).get(0);
       assertEquals(rowAname, rowResult3.row);
       assertEquals(0, rowResult3.columns.get(columnAname).value.remaining());
   
       // Try specifying timestamps with mutations
       mutations.clear();
-      handler.deleteAllRow(tableAname, rowAname, null);
-      assertEquals(0, handler.getRow(tableAname, rowAname).size());
+      handler.deleteAllRow(tableAname, rowAname, null, null);
+      assertEquals(0, handler.getRow(tableAname, rowAname, null).size());
 
       // Use a high timestamp to make sure our insertions come later than the above delete-all
with
       // an auto-generated timestamp.
       // Testing mutateRow.
       long highTS = HConstants.LATEST_TIMESTAMP / 2;
-      assertEquals(0, handler.getRow(tableAname, rowAname).size());
+      assertEquals(0, handler.getRow(tableAname, rowAname, null).size());
       mutations.add(new Mutation(false, columnAname, valueAModified, true, highTS + 257));
       mutations.add(new Mutation(false, columnAname, valueAname, true, highTS + 135));
-      handler.mutateRow(tableAname, rowAname, mutations, null);
-      List<TRowResult> results = handler.getRow(tableAname, rowAname);
+      handler.mutateRow(tableAname, rowAname, mutations, null, null);
+      List<TRowResult> results = handler.getRow(tableAname, rowAname, null);
       assertEquals(1, results.size());
       assertBufferEquals(valueAModified, results.get(0).getColumns().get(columnAname).value);
 
-      handler.deleteAllTs(tableAname, rowAname, columnAname, highTS + 999);
-      assertEquals(0, handler.getRow(tableAname, rowAname).size());
+      handler.deleteAllTs(tableAname, rowAname, columnAname, highTS + 999, null);
+      assertEquals(0, handler.getRow(tableAname, rowAname, null).size());
 
       // Testing mutateRowTs.
       for (boolean firstIsDeletion : HConstants.BOOLEAN_VALUES) {
@@ -338,16 +341,16 @@ public class TestThriftServer {
               HConstants.LATEST_TIMESTAMP)); 
           mutations.add(new Mutation(secondIsDeletion, columnAname, valueAname, true,
               highTS + 1200));
-          handler.mutateRowTs(tableAname, rowAname, mutations, highTS + 1100, null);
-          results = handler.getRow(tableAname, rowAname);
+          handler.mutateRowTs(tableAname, rowAname, mutations, highTS + 1100, null, null);
+          results = handler.getRow(tableAname, rowAname, null);
           if (secondIsDeletion) {
             assertEquals(0, results.size());
           } else {
             assertEquals(1, results.size());
             assertBufferEquals(valueAname, results.get(0).getColumns().get(columnAname).value);
           }
-          handler.deleteAllRowTs(tableAname, rowAname, highTS + 10000);
-          assertEquals(0, handler.getRow(tableAname, rowAname).size());
+          handler.deleteAllRowTs(tableAname, rowAname, highTS + 10000, null);
+          assertEquals(0, handler.getRow(tableAname, rowAname, null).size());
           highTS += 20000;
         }
       }
@@ -376,16 +379,16 @@ public class TestThriftServer {
     try {
       // Apply timestamped Mutations to rowA
       long time1 = System.currentTimeMillis();
-      handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null);
+      handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null, null);
   
       Thread.sleep(1000);
   
       // Apply timestamped BatchMutations for rowA and rowB
       long time2 = System.currentTimeMillis();
-      handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null);
+      handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null, null);
   
       // Apply an overlapping timestamped mutation to rowB
-      handler.mutateRowTs(tableAname, rowBname, getMutations(), time2, null);
+      handler.mutateRowTs(tableAname, rowBname, getMutations(), time2, null, null);
   
       // the getVerTs is [inf, ts) so you need to increment one.
       time1 += 1;
@@ -393,12 +396,12 @@ public class TestThriftServer {
   
       // Assert that the timestamp-related methods retrieve the correct data
       assertEquals(2, handler.getVerTs(tableAname, rowAname, columnBname, time2,
-        MAXVERSIONS).size());
+        MAXVERSIONS, null).size());
       assertEquals(1, handler.getVerTs(tableAname, rowAname, columnBname, time1,
-        MAXVERSIONS).size());
+        MAXVERSIONS, null).size());
   
-      TRowResult rowResult1 = handler.getRowTs(tableAname, rowAname, time1).get(0);
-      TRowResult rowResult2 = handler.getRowTs(tableAname, rowAname, time2).get(0);
+      TRowResult rowResult1 = handler.getRowTs(tableAname, rowAname, time1, null).get(0);
+      TRowResult rowResult2 = handler.getRowTs(tableAname, rowAname, time2, null).get(0);
       // columnA was completely deleted
       //assertTrue(Bytes.equals(rowResult1.columns.get(columnAname).value, valueAname));
       assertBufferEquals(rowResult1.columns.get(columnBname).value, valueBname);
@@ -410,31 +413,33 @@ public class TestThriftServer {
       List<ByteBuffer> columns = new ArrayList<ByteBuffer>();
       columns.add(columnBname);
   
-      rowResult1 = handler.getRowWithColumns(tableAname, rowAname, columns).get(0);
+      rowResult1 = handler.getRowWithColumns(tableAname, rowAname, columns, null).get(0);
       assertBufferEquals(rowResult1.columns.get(columnBname).value, valueCname);
       assertFalse(rowResult1.columns.containsKey(columnAname));
   
-      rowResult1 = handler.getRowWithColumnsTs(tableAname, rowAname, columns, time1).get(0);
+      rowResult1 = handler.getRowWithColumnsTs(tableAname, rowAname, columns, time1, null).get(0);
       assertBufferEquals(rowResult1.columns.get(columnBname).value, valueBname);
       assertFalse(rowResult1.columns.containsKey(columnAname));
   
       // Apply some timestamped deletes
       // this actually deletes _everything_.
       // nukes everything in columnB: forever.
-      handler.deleteAllTs(tableAname, rowAname, columnBname, time1);
-      handler.deleteAllRowTs(tableAname, rowBname, time2);
+      handler.deleteAllTs(tableAname, rowAname, columnBname, time1, null);
+      handler.deleteAllRowTs(tableAname, rowBname, time2, null);
   
       // Assert that the timestamp-related methods retrieve the correct data
-      int size = handler.getVerTs(tableAname, rowAname, columnBname, time1, MAXVERSIONS).size();
+      int size = handler.getVerTs(tableAname, rowAname, columnBname, time1, MAXVERSIONS,
+          null).size();
       assertEquals(0, size);
   
-      size = handler.getVerTs(tableAname, rowAname, columnBname, time2, MAXVERSIONS).size();
+      size = handler.getVerTs(tableAname, rowAname, columnBname, time2, MAXVERSIONS, null).size();
       assertEquals(1, size);
   
       // should be available....
-      assertBufferEquals(handler.get(tableAname, rowAname, columnBname).get(0).value, valueCname);
+      assertBufferEquals(handler.get(tableAname, rowAname, columnBname, null).get(0).value,
+          valueCname);
   
-      assertEquals(0, handler.getRow(tableAname, rowBname).size());
+      assertEquals(0, handler.getRow(tableAname, rowBname, null).size());
     } finally {
       // Teardown
       handler.disableTable(tableAname);
@@ -458,7 +463,7 @@ public class TestThriftServer {
     try {
       // Apply timestamped Mutations to rowA
       long time1 = System.currentTimeMillis();
-      handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null);
+      handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null, null);
   
       // Sleep to assure that 'time1' and 'time2' will be different even with a
       // coarse grained system timer.
@@ -466,7 +471,7 @@ public class TestThriftServer {
   
       // Apply timestamped BatchMutations for rowA and rowB
       long time2 = System.currentTimeMillis();
-      handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null);
+      handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null, null);
   
       time1 += 1;
   
@@ -568,7 +573,7 @@ public class TestThriftServer {
     // Create tableA and add two columns to rowA
     handler.createTable(tableAname, getColumnDescriptors());
     try {
-      handler.mutateRow(tableAname, rowAname, getMutations(), null);
+      handler.mutateRow(tableAname, rowAname, getMutations(), null, null);
       byte[] searchRow = HRegionInfo.createRegionName(
           tableAname.array(), rowAname.array(), HConstants.NINES, false);
       TRegionInfo regionInfo = handler.getRegionInfo(ByteBuffer.wrap(searchRow));

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerLegacy.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerLegacy.java?rev=1387310&r1=1387309&r2=1387310&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerLegacy.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServerLegacy.java
Tue Sep 18 18:39:54 2012
@@ -146,11 +146,12 @@ public class TestThriftServerLegacy exte
     // Apply a few Mutations to rowA
     //     mutations.add(new Mutation(false, columnAname, valueAname));
     //     mutations.add(new Mutation(false, columnBname, valueBname));
-    handler.mutateRow(tableAname, rowAname, getMutations(), null);
+    handler.mutateRow(tableAname, rowAname, getMutations(), null, null);
 
     // Assert that the changes were made
-    assertBufferEquals(valueAname, handler.get(tableAname, rowAname, columnAname).get(0).value);
-    TRowResult rowResult1 = handler.getRow(tableAname, rowAname).get(0);
+    assertBufferEquals(valueAname, handler.get(tableAname, rowAname, columnAname,
+        null).get(0).value);
+    TRowResult rowResult1 = handler.getRow(tableAname, rowAname, null).get(0);
     assertBufferEquals(rowAname, rowResult1.row);
     assertBufferEquals(valueBname, rowResult1.columns.get(columnBname).value);
 
@@ -162,37 +163,38 @@ public class TestThriftServerLegacy exte
     // rowBmutations.add(new Mutation(false, columnAname, valueCname));
     // rowBmutations.add(new Mutation(false, columnBname, valueDname));
     // batchMutations.add(new BatchMutation(rowBname, rowBmutations));
-    handler.mutateRows(tableAname, getBatchMutations(), null);
+    handler.mutateRows(tableAname, getBatchMutations(), null, null);
 
     // Assert that changes were made to rowA
-    List<TCell> cells = handler.get(tableAname, rowAname, columnAname);
+    List<TCell> cells = handler.get(tableAname, rowAname, columnAname, null);
     assertFalse(cells.size() > 0);
-    assertBufferEquals(valueCname, handler.get(tableAname, rowAname, columnBname).get(0).value);
-    List<TCell> versions = handler.getVer(tableAname, rowAname, columnBname, MAXVERSIONS);
+    assertBufferEquals(valueCname, handler.get(tableAname, rowAname, columnBname,
+        null).get(0).value);
+    List<TCell> versions = handler.getVer(tableAname, rowAname, columnBname, MAXVERSIONS,
null);
     assertBufferEquals(valueCname, versions.get(0).value);
     assertBufferEquals(valueBname, versions.get(1).value);
 
     // Assert that changes were made to rowB
-    TRowResult rowResult2 = handler.getRow(tableAname, rowBname).get(0);
+    TRowResult rowResult2 = handler.getRow(tableAname, rowBname, null).get(0);
     assertBufferEquals(rowBname, rowResult2.row);
     assertBufferEquals(valueCname, rowResult2.columns.get(columnAname).value);
 	  assertBufferEquals(valueDname, rowResult2.columns.get(columnBname).value);
 
     // Apply some deletes
-    handler.deleteAll(tableAname, rowAname, columnBname);
-    handler.deleteAllRow(tableAname, rowBname, null);
+    handler.deleteAll(tableAname, rowAname, columnBname, null);
+    handler.deleteAllRow(tableAname, rowBname, null, null);
 
     // Assert that the deletes were applied
-    int size = handler.get(tableAname, rowAname, columnBname).size();
+    int size = handler.get(tableAname, rowAname, columnBname, null).size();
     assertEquals(0, size);
-    size = handler.getRow(tableAname, rowBname).size();
+    size = handler.getRow(tableAname, rowBname, null).size();
     assertEquals(0, size);
 
     // Try null mutation
     List<Mutation> mutations = new ArrayList<Mutation>();
     mutations.add(new Mutation(false, columnAname, null, true, HConstants.LATEST_TIMESTAMP));
-    handler.mutateRow(tableAname, rowAname, mutations, null);
-    TRowResult rowResult3 = handler.getRow(tableAname, rowAname).get(0);
+    handler.mutateRow(tableAname, rowAname, mutations, null, null);
+    TRowResult rowResult3 = handler.getRow(tableAname, rowAname, null).get(0);
     assertEquals(rowAname, rowResult3.row);
     assertEquals(0, rowResult3.columns.get(columnAname).value.remaining());
 
@@ -215,16 +217,16 @@ public class TestThriftServerLegacy exte
 
     // Apply timestamped Mutations to rowA
     long time1 = System.currentTimeMillis();
-    handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null);
+    handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null, null);
 
     Thread.sleep(1000);
 
     // Apply timestamped BatchMutations for rowA and rowB
     long time2 = System.currentTimeMillis();
-    handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null);
+    handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null, null);
 
     // Apply an overlapping timestamped mutation to rowB
-    handler.mutateRowTs(tableAname, rowBname, getMutations(), time2, null);
+    handler.mutateRowTs(tableAname, rowBname, getMutations(), time2, null, null);
 
     // the getVerTs is [inf, ts) so you need to increment one.
     time1 += 1;
@@ -232,12 +234,12 @@ public class TestThriftServerLegacy exte
 
     // Assert that the timestamp-related methods retrieve the correct data
     assertEquals(2, handler.getVerTs(tableAname, rowAname, columnBname, time2,
-      MAXVERSIONS).size());
+      MAXVERSIONS, null).size());
     assertEquals(1, handler.getVerTs(tableAname, rowAname, columnBname, time1,
-      MAXVERSIONS).size());
+      MAXVERSIONS, null).size());
 
-    TRowResult rowResult1 = handler.getRowTs(tableAname, rowAname, time1).get(0);
-    TRowResult rowResult2 = handler.getRowTs(tableAname, rowAname, time2).get(0);
+    TRowResult rowResult1 = handler.getRowTs(tableAname, rowAname, time1, null).get(0);
+    TRowResult rowResult2 = handler.getRowTs(tableAname, rowAname, time2, null).get(0);
     // columnA was completely deleted
     //assertBufferEquals(rowResult1.columns.get(columnAname).value, valueAname);
     assertBufferEquals(rowResult1.columns.get(columnBname).value, valueBname);
@@ -249,31 +251,34 @@ public class TestThriftServerLegacy exte
     List<ByteBuffer> columns = new ArrayList<ByteBuffer>();
     columns.add(columnBname);
 
-    rowResult1 = handler.getRowWithColumns(tableAname, rowAname, columns).get(0);
+    rowResult1 = handler.getRowWithColumns(tableAname, rowAname, columns, null).get(0);
     assertBufferEquals(rowResult1.columns.get(columnBname).value, valueCname);
     assertFalse(rowResult1.columns.containsKey(columnAname));
 
-    rowResult1 = handler.getRowWithColumnsTs(tableAname, rowAname, columns, time1).get(0);
+    rowResult1 = handler.getRowWithColumnsTs(tableAname, rowAname, columns, time1, null).get(0);
     assertBufferEquals(rowResult1.columns.get(columnBname).value, valueBname);
     assertFalse(rowResult1.columns.containsKey(columnAname));
 
     // Apply some timestamped deletes
     // this actually deletes _everything_.
     // nukes everything in columnB: forever.
-    handler.deleteAllTs(tableAname, rowAname, columnBname, time1);
-    handler.deleteAllRowTs(tableAname, rowBname, time2);
+    handler.deleteAllTs(tableAname, rowAname, columnBname, time1, null);
+    handler.deleteAllRowTs(tableAname, rowBname, time2, null);
 
     // Assert that the timestamp-related methods retrieve the correct data
-    int size = handler.getVerTs(tableAname, rowAname, columnBname, time1, MAXVERSIONS).size();
+    int size = handler.getVerTs(tableAname, rowAname, columnBname, time1, MAXVERSIONS,
+        null).size();
     assertEquals(0, size);
 
-    size = handler.getVerTs(tableAname, rowAname, columnBname, time2, MAXVERSIONS).size();
+    size = handler.getVerTs(tableAname, rowAname, columnBname, time2, MAXVERSIONS,
+        null).size();
     assertEquals(1, size);
 
     // should be available....
-    assertBufferEquals(handler.get(tableAname, rowAname, columnBname).get(0).value, valueCname);
+    assertBufferEquals(handler.get(tableAname, rowAname, columnBname, null).get(0).value,
+        valueCname);
 
-    assertEquals(0, handler.getRow(tableAname, rowBname).size());
+    assertEquals(0, handler.getRow(tableAname, rowBname, null).size());
 
     // Teardown
     handler.disableTable(tableAname);
@@ -293,7 +298,7 @@ public class TestThriftServerLegacy exte
 
     // Apply timestamped Mutations to rowA
     long time1 = System.currentTimeMillis();
-    handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null);
+    handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null, null);
 
     // Sleep to assure that 'time1' and 'time2' will be different even with a
     // coarse grained system timer.
@@ -301,7 +306,7 @@ public class TestThriftServerLegacy exte
 
     // Apply timestamped BatchMutations for rowA and rowB
     long time2 = System.currentTimeMillis();
-    handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null);
+    handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null, null);
 
     time1 += 1;
 
@@ -360,7 +365,7 @@ public class TestThriftServerLegacy exte
 
     // Apply timestamped Mutations to rowA
     long time1 = System.currentTimeMillis();
-    handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null);
+    handler.mutateRowTs(tableAname, rowAname, getMutations(), time1, null, null);
 
     // Sleep to assure that 'time1' and 'time2' will be different even with a
     // coarse grained system timer.
@@ -368,7 +373,7 @@ public class TestThriftServerLegacy exte
 
     // Apply timestamped BatchMutations for rowA and rowB
     long time2 = System.currentTimeMillis();
-    handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null);
+    handler.mutateRowsTs(tableAname, getBatchMutations(), time2, null, null);
 
     time1 += 1;
 
@@ -377,7 +382,7 @@ public class TestThriftServerLegacy exte
     rows.add(rowAname);
     rows.add(rowBname);
 
-    List<TRowResult> results = handler.getRows(tableAname, rows);
+    List<TRowResult> results = handler.getRows(tableAname, rows, null);
     assertEquals(results.get(0).row, rowAname);
     assertEquals(results.get(1).row, rowBname);
 
@@ -405,7 +410,7 @@ public class TestThriftServerLegacy exte
     handler.checkAndMutateRowTs(tableAname, rowAname, columnAname, null,
         getMutations(), time1, null);
 
-    List<TRowResult> res1 = handler.getRow(tableAname, rowAname);
+    List<TRowResult> res1 = handler.getRow(tableAname, rowAname, null);
     // Check that all went according to plan
     assertEquals(res1.get(0).columns.get(columnAname).value, valueAname);
     assertEquals(res1.get(0).columns.get(columnBname).value, valueBname);
@@ -441,7 +446,7 @@ public class TestThriftServerLegacy exte
     handler.checkAndMutateRowTs(tableAname, rowAname, columnAname, valueAname,
         getMutations2(), time2, null);
 
-    res1 = handler.getRow(tableAname, rowAname);
+    res1 = handler.getRow(tableAname, rowAname, null);
 
     // Check that actually changed!
     assertEquals(res1.get(0).columns.get(columnAname).value, valueCname);



Mime
View raw message