Package com.yahoo.omid.client

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


   @Test public void runTestSimple() 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 tread = tm.beginTransaction();
         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, data1);
         tt.put(t1, p);
         tm.tryCommit(t1);

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

   @Test public void runTestManyVersions() 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

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

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

            TransactionState t2 = tm.beginTransaction();
            p = new Put(row);
            p.add(fam, col, data2);
            tt.put(t2, p);
         }
         TransactionState tread = tm.beginTransaction();

         Get g = new Get(row).setMaxVersions(1);
         Result r = tt.get(g);
         assertTrue("Unexpected value for read: " + Bytes.toString(r.getValue(fam, col)),
               Bytes.equals(data2, r.getValue(fam, col)));
View Full Code Here

   @Test public void runTestInterleave() 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-interleave");
         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);

         TransactionState tread = tm.beginTransaction();
View Full Code Here

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

         TransactionState tread = tm.beginTransaction();
         Get g = new Get(row).setMaxVersions(1);
         Result r = tt.get(tread, g);
         assertTrue("Unexpected value for SI read " + tread + ": " + Bytes.toString(r.getValue(fam, col)),
                    Bytes.equals(data1, r.getValue(fam, col)));
         tm.tryCommit(t2);
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

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.