Package com.yahoo.omid.client

Examples of com.yahoo.omid.client.TransactionManager.tryCommit()


            count++;
         }
         assertTrue("Count should be " + lInts.length + " but is " + count,
                    count == lInts.length);
         LOG.info("Rows found " + count);
         tm.tryCommit(t);
         table.close();
      } catch (Exception e) {
         LOG.error("Exception in test", e);
      }
   }
View Full Code Here


            byte[]data=Bytes.toBytes(lIntsA[i]);
            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
            table.put(t,put);
         }
         tm.tryCommit(t);
  
         TransactionState tu=tm.beginTransaction();
         int[] lIntsB=new int[]{105,24,4342,32,7,3,30,40};
         for (int i=0;i<lIntsB.length;i++) {
            byte[]data=Bytes.toBytes(lIntsB[i]);
View Full Code Here

            byte[]data=Bytes.toBytes(lIntsC[i]);
            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
            table.put(t,put);
         }
         tm.tryCommit(t);
        
         t=tm.beginTransaction();
         Scan s=new Scan();
         ResultScanner res=table.getScanner(t,s);
         Result rr;
View Full Code Here

            count++;
         }
         assertTrue("Count should be " + (lIntsA.length*lIntsC.length) + " but is " + count,
                    count == lIntsA.length + lIntsC.length);
         LOG.info("Rows found " + count);
         tm.tryCommit(t);
         table.close();
      } catch (Exception e) {
         LOG.error("Exception in test", e);
      }
   }
View Full Code Here

      }
      assertTrue("Can't see puts. I should see "
                 + num + " but I see " + count
                 , num == count);

      tm.tryCommit(t);
      t=tm.beginTransaction();

      for(int j=0;j<num/2;j++) {
         byte[]data=Bytes.toBytes(j);
         byte[]ndata=Bytes.toBytes(j*10);
 
View Full Code Here

         byte[]ndata=Bytes.toBytes(j*10);
         Put put=new Put(data);
         put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes("value2"), ndata);
         table1.put(t,put);
      }
      tm.tryCommit(t);
      t=tm.beginTransaction();
      s=new Scan();
      res=table1.getScanner(t,s);
      count = 0;
      int modified = 0, notmodified = 0;
View Full Code Here

                 , num == count);
      assertTrue("Half of rows should equal row id, half not ("
                 + modified + ", " + notmodified + ")"
                 , modified == notmodified && notmodified == (num/2));
     
      tm.tryCommit(t);
      LOG.info("End commiting");
      table1.close();
   }
}
View Full Code Here

         put1.add(family, col1, data);
         table1.put(t,put1);
         Put put2=new Put(data);
         put2.add(family, col2, data);
         table1.put(t,put2);
         tm.tryCommit(t);
         table1.close();

         assertTrue("Invalid value in table", verifyValue(Bytes.toBytes(TEST_TABLE),
                                                          data, family, col1, data));
         assertTrue("Invalid value in table", verifyValue(Bytes.toBytes(TEST_TABLE),
View Full Code Here

            byte[]data=Bytes.toBytes(j);
            Put put=new Put(data);
            put.add(family, col, data);
            table1.put(t,put);
         }
         tm.tryCommit(t);
         table1.close();

         byte[] data=Bytes.toBytes(0);
         assertTrue("Invalid value in table", verifyValue(Bytes.toBytes(TEST_TABLE),
                                                          data, family, col, data));
View Full Code Here

        Result r = rs.next();
        while (r != null) {
            System.out.println(r);
            r = rs.next();
        }
        tm.tryCommit(t1);

        System.out.println();

        t1 = tm.beginTransaction();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.