Package com.yahoo.omid.client

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


         } catch (CommitUnsuccessfulException e) {
            aborted = true;
         }
         assertTrue("Didn't raise exception", aborted);

         TransactionState 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 runTestInterleaveScan() throws Exception {
      try {
         TransactionManager tm = new TransactionManager(conf);
         TransactionalTable tt = new TransactionalTable(conf, TEST_TABLE);
        
         TransactionState t1 = tm.beginTransaction();
         LOG.info("Transaction created " + t1);
        
         byte[] fam = Bytes.toBytes(TEST_FAMILY);
         byte[] col = Bytes.toBytes("testdata");
         byte[] data1 = Bytes.toBytes("testWrite-1");
View Full Code Here

            p.add(fam, col, data1);
            tt.put(t1, p);
         }
         tm.tryCommit(t1);

         TransactionState t2 = tm.beginTransaction();
         Put p = new Put(modrow);
         p.add(fam, col, data2);
         tt.put(t2, p);        
        
         int modifiedrows = 0;
View Full Code Here

        
         assertTrue("Expected 1 row modified, but " + modifiedrows + " are.",
                    modifiedrows == 1);
         tm.abort(t2);
        
         TransactionState tscan = tm.beginTransaction();
         rs = tt.getScanner(tscan, new Scan().setStartRow(startrow).setStopRow(stoprow).addColumn(fam, col));
         r = rs.next();
         while (r != null) {
            if (LOG.isTraceEnabled()) {
               LOG.trace("Scan1 :" + Bytes.toString(r.getRow()) + " => " + Bytes.toString(r.getValue(fam, col)));
View Full Code Here

      try{
         TransactionManager tm = new TransactionManager(conf);
         TransactionalTable table1 = new TransactionalTable(conf, 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("value"), data);
            table1.put(t,put);
View Full Code Here

   @Test public void testDeleteOld() throws Exception {
      try {
         TransactionManager tm = new TransactionManager(conf);
         TransactionalTable tt = new TransactionalTable(conf, TEST_TABLE);

         TransactionState t1 = tm.beginTransaction();
         LOG.info("Transaction created " + t1);

         byte[] row = Bytes.toBytes("test-simple");
         byte[] fam = Bytes.toBytes(TEST_FAMILY);
         byte[] col = Bytes.toBytes("testdata");
View Full Code Here

         Put p = new Put(row);
         p.add(fam, col, data1);
         tt.put(t1, p);
         tm.tryCommit(t1);

         TransactionState t2 = tm.beginTransaction();
         p = new Put(row);
         p.add(fam, col, data2);
         tt.put(t2, p);
         tm.tryCommit(t2);
View Full Code Here

         p.add(fam, col, data2);
         tt.put(t2, p);
         tm.tryCommit(t2);

         for (int i = 0; i < 500; ++i) {
            t2 = tm.beginTransaction();
            p = new Put(row);
            p.add(fam, col2, data2);
            tt.put(t2, p);
            tm.tryCommit(t2);
         }
View Full Code Here

        
         HBaseAdmin admin = new HBaseAdmin(conf);
         admin.flush(TEST_TABLE);
        
         for (int i = 0; i < 500; ++i) {
            t2 = tm.beginTransaction();
            p = new Put(row);
            p.add(fam, col2, data2);
            tt.put(t2, p);
            tm.tryCommit(t2);
         }
View Full Code Here

   @Test public void testLimitEqualToColumns() throws Exception {
      try {
         TransactionManager tm = new TransactionManager(conf);
         TransactionalTable tt = new TransactionalTable(conf, TEST_TABLE);

         TransactionState t1 = tm.beginTransaction();

         byte[] row = Bytes.toBytes("test-simple");
         byte[] row2 = Bytes.toBytes("test-simple2");
         byte[] row3 = Bytes.toBytes("test-simple3");
         byte[] row4 = Bytes.toBytes("test-simple4");
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.