Package com.yahoo.omid.tso.messages

Examples of com.yahoo.omid.tso.messages.CommittedTransactionReport


         }
         for (CommitQueryCallback cb : cbs) {
            cb.complete(r.committed);
         }
      } else if (msg instanceof CommittedTransactionReport) {
         CommittedTransactionReport ctr = (CommittedTransactionReport) msg;
         committed.commit(ctr.startTimestamp, ctr.commitTimestamp);
      } else if (msg instanceof CleanedTransactionReport) {
          CleanedTransactionReport r = (CleanedTransactionReport) msg;
         aborted.remove(r.startTimestamp);
      } else if (msg instanceof AbortedTransactionReport) {
View Full Code Here


                break;
            case TSOMessage.CommitQueryResponse:
                msg = new CommitQueryResponse();
                break;
            case TSOMessage.CommittedTransactionReport:
                msg = new CommittedTransactionReport();
                break;
            case TSOMessage.LargestDeletedTimestampReport:
                msg = new LargestDeletedTimestampReport();
                break;
            case TSOMessage.AbortRequest:
View Full Code Here

      }

      lastStartTimestamp = startTimestamp;
      lastCommitTimestamp = commitTimestamp;

      return new CommittedTransactionReport(startTimestamp, commitTimestamp);
   }
View Full Code Here

      CommitResponse cr2 = secondClientHandler.receiveMessage(CommitResponse.class);
      assertEquals(tr2.timestamp, cr2.startTimestamp);
      assertFalse(cr2.committed);
     
      clientHandler.sendMessage(new TimestampRequest());
      CommittedTransactionReport ctr2 = clientHandler.receiveMessage(CommittedTransactionReport.class);
      assertEquals(cr1.commitTimestamp, ctr2.commitTimestamp);
      assertEquals(cr1.startTimestamp, ctr2.startTimestamp);
     
      //
      // Half Aborted Transaction Report
      //
      AbortedTransactionReport atr1 = clientHandler.receiveMessage(AbortedTransactionReport.class);
      assertEquals(tr2.timestamp, atr1.startTimestamp);     

      clientHandler.receiveMessage(TimestampResponse.class);
     
      secondClientHandler.sendMessage(new TimestampRequest());
      CommittedTransactionReport ctr3 = secondClientHandler.receiveMessage(CommittedTransactionReport.class);
      assertEquals(cr1.commitTimestamp, ctr3.commitTimestamp);
      assertEquals(cr1.startTimestamp, ctr3.startTimestamp);

      //
      // Half Aborted Transaction Report
View Full Code Here

      assertEquals(tr1.timestamp, cr2.startTimestamp);
      assertEquals(++timestamp, cr2.commitTimestamp);

      {
         clientHandler.sendMessage(new TimestampRequest());
         CommittedTransactionReport ctr1 = clientHandler.receiveMessage(CommittedTransactionReport.class);
         assertEquals(cr1.startTimestamp, ctr1.startTimestamp);
         assertEquals(cr1.commitTimestamp, ctr1.commitTimestamp);

         CommittedTransactionReport ctr2 = clientHandler.receiveMessage(CommittedTransactionReport.class);
         assertEquals(cr2.startTimestamp, ctr2.startTimestamp);
         assertEquals(cr2.commitTimestamp, ctr2.commitTimestamp);

         TimestampResponse tr3 = clientHandler.receiveMessage(TimestampResponse.class);
         assertEquals(++timestamp, tr3.timestamp);
View Full Code Here

      assertTrue(cr3.commitTimestamp > tr3.timestamp);
      assertEquals(tr3.timestamp, cr3.startTimestamp);
     
      clientHandler.sendMessage(new TimestampRequest());
      // Txn 3 did write, so we must receive CommittedReport
      CommittedTransactionReport ctr = clientHandler.receiveMessage(CommittedTransactionReport.class);
      assertEquals(cr3.startTimestamp, ctr.startTimestamp);
      assertEquals(cr3.commitTimestamp, ctr.commitTimestamp);
     
      clientHandler.receiveMessage(TimestampResponse.class);
   }
View Full Code Here

//      CommitResponse cr3 = (CommitResponse) messageReceived;
//      assertFalse(cr3.committed);
     
      clientHandler.sendMessage(new TimestampRequest());
      // Pending commit report
      CommittedTransactionReport ctr1 = clientHandler.receiveMessage(CommittedTransactionReport.class);
      assertEquals(cr1.startTimestamp, ctr1.startTimestamp);
      assertEquals(cr1.commitTimestamp, ctr1.commitTimestamp);
      // Aborted transaction report
      AbortedTransactionReport atr = clientHandler.receiveMessage(AbortedTransactionReport.class);
      assertEquals(cr2.startTimestamp, atr.startTimestamp);
      // Full Abort report
      CleanedTransactionReport cltr = clientHandler.receiveMessage(CleanedTransactionReport.class);
      assertEquals(cr2.startTimestamp, cltr.startTimestamp);
     
      TimestampResponse tr3 = clientHandler.receiveMessage(TimestampResponse.class);

      clientHandler.sendMessage(new CommitRequest(tr3.timestamp, new RowKey[] { r1, r2 }));
      CommitResponse cr3 = clientHandler.receiveMessage(CommitResponse.class);
      assertTrue(cr3.committed);
      assertEquals(tr3.timestamp, cr3.startTimestamp);

      clientHandler.sendMessage(new TimestampRequest());

      // Pending commit report
      CommittedTransactionReport ctr3 = clientHandler.receiveMessage(CommittedTransactionReport.class);
      assertEquals(cr3.startTimestamp, ctr3.startTimestamp);
      assertEquals(cr3.commitTimestamp, ctr3.commitTimestamp);
     
      TimestampResponse tr4 = clientHandler.receiveMessage(TimestampResponse.class);
View Full Code Here

        long firstTS = rand.nextLong();
        long secondTS = rand.nextLong();
        switch (rand.nextInt(4)) {
            case 0:
                smb.writeCommit(firstTS, secondTS);
                expectedMessages.add(new CommittedTransactionReport(firstTS, secondTS));
                break;
            case 1:
                smb.writeFullAbort(firstTS);
                expectedMessages.add(new CleanedTransactionReport(firstTS));
                break;
View Full Code Here

                long ct = zipper.lastCommitTimestamp + commitDiff;
                buffer.clear();
                zipper.encodeCommit(buffer, st, ct);
                TSOMessage msg = dezipper.decodeMessage(buffer);
                assertThat(msg, is(CommittedTransactionReport.class));
                CommittedTransactionReport ctr = (CommittedTransactionReport) msg;
                assertThat("startDiff: " + startDiff + " commitDiff: " + commitDiff, ctr.commitTimestamp, is(ct));
                assertThat("startDiff: " + startDiff + " commitDiff: " + commitDiff, ctr.startTimestamp, is(st));
            }
        }
    }
View Full Code Here

       clientHandler.sendMessage(new CommitRequest(tr1.timestamp, new RowKey[] { r1 }));
       CommitResponse cr1 = clientHandler.receiveMessage(CommitResponse.class);
      
       clientHandler.sendMessage(new TimestampRequest());
       // Pending commit report
       CommittedTransactionReport ctr1 = clientHandler.receiveMessage(CommittedTransactionReport.class);
       assertEquals(cr1.startTimestamp, ctr1.startTimestamp);
       assertEquals(cr1.commitTimestamp, ctr1.commitTimestamp);
      
       tr1 = clientHandler.receiveMessage(TimestampResponse.class);
View Full Code Here

TOP

Related Classes of com.yahoo.omid.tso.messages.CommittedTransactionReport

Copyright © 2018 www.massapicom. 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.