Package com.yahoo.omid.client

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


         assertTrue("Expected " + rowcount + " rows but " + count + " found",
                    count == rowcount);

         tm.tryCommit(t2);
        
         tscan = tm.beginTransaction();
         rs = tt.getScanner(tscan, new Scan());
         r = rs.next();
         count = 0;
         while (r != null) {
            count++;           
View Full Code Here


   @Test public void testGet() throws Exception {
      try{
         TransactionManager tm = new TransactionManager(hbaseConf);
         TransactionalTable table = new TransactionalTable(hbaseConf, TEST_TABLE);
         TransactionState t=tm.beginTransaction();
         int[] lInts=new int[]{100,243,2342,22,1,5,43,56};
         for (int i=0;i<lInts.length;i++) {
            byte[]data=Bytes.toBytes(lInts[i]);
            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
View Full Code Here

            filters.addFilter(new WhileMatchFilter(toFilter));
            s.setFilter(filters);
         } else {
            s.setFilter(new WhileMatchFilter(toFilter));
         }
         t=tm.beginTransaction();
         ResultScanner res=table.getScanner(t,s);
         Result rr;
         int count = 0;
         while ((rr=res.next())!=null) {
            int iTmp=Bytes.toInt(rr.getValue(Bytes.toBytes(TEST_FAMILY),
View Full Code Here

   @Test public void testScan() throws Exception {
      try{
         TransactionManager tm = new TransactionManager(hbaseConf);
         TransactionalTable table = new TransactionalTable(hbaseConf, TEST_TABLE);
         TransactionState t=tm.beginTransaction();
         int[] lInts=new int[]{100,243,2342,22,1,5,43,56};
         for (int i=0;i<lInts.length;i++) {
            byte[]data=Bytes.toBytes(lInts[i]);
            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
View Full Code Here

                    count == lInts.length);
         LOG.info("Rows found " + count);

         tm.tryCommit(t);

         t=tm.beginTransaction();
         res=table.getScanner(t,s);
         count = 0;
         while ((rr=res.next())!=null) {
            int iTmp=Bytes.toInt(rr.getValue(Bytes.toBytes(TEST_FAMILY),
                                             Bytes.toBytes(TEST_COL)));
View Full Code Here

   @Test public void testScanUncommitted() throws Exception {
      try{
         TransactionManager tm = new TransactionManager(hbaseConf);
         TransactionalTable table = new TransactionalTable(hbaseConf, TEST_TABLE);
         TransactionState t=tm.beginTransaction();
         int[] lIntsA=new int[]{100,243,2342,22,1,5,43,56};
         for (int i=0;i<lIntsA.length;i++) {
            byte[]data=Bytes.toBytes(lIntsA[i]);
            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
View Full Code Here

            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]);
            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
View Full Code Here

            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
            table.put(tu,put);
         }
  
         t=tm.beginTransaction();
         int[] lIntsC=new int[]{109,224,242,2,16,59,23,26};
         for (int i=0;i<lIntsC.length;i++) {
            byte[]data=Bytes.toBytes(lIntsC[i]);
            Put put=new Put(data);
            put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes(TEST_COL), data);
View Full Code Here

            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;
         int count = 0;
  
View Full Code Here

   @Test public void testSingleColumnFamily() throws Exception {
      TransactionManager tm = new TransactionManager(hbaseConf);
      TransactionalTable table1 = new TransactionalTable(hbaseConf, TEST_TABLE);
      int num=10;
      TransactionState t=tm.beginTransaction();
      for(int j=0;j<num;j++) {
         byte[]data=Bytes.toBytes(j);
         Put put=new Put(data);
         put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes("value1"), data);
         put.add(Bytes.toBytes(TEST_FAMILY), Bytes.toBytes("value2"), data);
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.