Package com.yahoo.omid.tso.messages

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


            LOG.error("Receiving a timestamp response, but none requested: " + timestamp);
            return;
         }
         cb.complete(timestamp);
      } else if (msg instanceof CommitQueryResponse) {
         CommitQueryResponse r = (CommitQueryResponse)msg;
         if (r.commitTimestamp != 0) {
            committed.commit(r.queryTimestamp, r.commitTimestamp);
         } else if (r.committed) {
            committed.commit(r.queryTimestamp, largestDeletedTimestamp);
         }
View Full Code Here


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

   /**
    * Handle the CommitQueryRequest message
    */
   public void handle(CommitQueryRequest msg, ChannelHandlerContext ctx) {
      CommitQueryResponse reply = new CommitQueryResponse(msg.startTimestamp);
      reply.queryTimestamp = msg.queryTimestamp;
      synchronized (sharedState) {
         queries++;
         //1. check the write-write conflicts
         long value;
View Full Code Here

      //
      // Test Commit query of uncommitted transaction
      //
      clientHandler.sendMessage(new CommitQueryRequest(tr2.timestamp, tr1.timestamp));
      CommitQueryResponse cqr1 = clientHandler.receiveMessage(CommitQueryResponse.class);
      assertFalse(cqr1.committed);
      assertFalse(cqr1.retry);

      clientHandler.sendMessage(new CommitRequest(tr1.timestamp, new RowKey[] { r1 }));
      CommitResponse cr1 = clientHandler.receiveMessage(CommitResponse.class);
      assertTrue(cr1.committed);
      assertTrue(cr1.commitTimestamp > tr1.timestamp);
      assertEquals(tr1.timestamp, cr1.startTimestamp);

      //
      // Test Commit query of concurrent committed transaction
      //
      clientHandler.sendMessage(new CommitQueryRequest(tr2.timestamp, tr1.timestamp));
      CommitQueryResponse cqr2 = clientHandler.receiveMessage(CommitQueryResponse.class);
      assertFalse(cqr2.committed);
      assertFalse(cqr2.retry);

      clientHandler.sendMessage(new CommitRequest(tr2.timestamp, new RowKey[] { r1, r2 }));
      CommitResponse cr2 = clientHandler.receiveMessage(CommitResponse.class);
      assertFalse(cr2.committed);

      // Queued reports
      clientHandler.sendMessage(new TimestampRequest());
      clientHandler.receiveMessage(CommittedTransactionReport.class);
      clientHandler.receiveMessage(AbortedTransactionReport.class);

      TimestampResponse tr3 = clientHandler.receiveMessage(TimestampResponse.class);
      assertTrue(tr3.timestamp > tr2.timestamp);

      state.largestDeletedTimestamp = 1000000;

      //
      // Test Commit query of half aborted transaction
      //
      clientHandler.sendMessage(new CommitQueryRequest(tr3.timestamp, tr2.timestamp));
      CommitQueryResponse cqr3 = clientHandler.receiveMessage(CommitQueryResponse.class);
      assertFalse(cqr3.committed);
      assertFalse(cqr3.retry);

      clientHandler.sendMessage(new FullAbortRequest(tr2.timestamp));

      //
      // Test Commit query of full aborted transaction
      //
      clientHandler.sendMessage(new CommitQueryRequest(tr3.timestamp, tr2.timestamp));
      CommitQueryResponse cqr4 = clientHandler.receiveMessage(CommitQueryResponse.class);
      assertFalse(cqr4.committed);
      assertTrue(cqr4.retry);

      //
      // Test Commit query of committed transaction
      //
      clientHandler.sendMessage(new CommitQueryRequest(tr3.timestamp, tr1.timestamp));
      CommitQueryResponse cqr5 = clientHandler.receiveMessage(CommitQueryResponse.class);
      assertTrue(cqr5.committed);
      assertFalse(cqr5.retry);
   }
View Full Code Here

                LOG.error("Receiving a timestamp response, but none requested: " + timestamp);
                return;
            }
            cb.complete(timestamp);
        } else if (msg instanceof CommitQueryResponse) {
            CommitQueryResponse r = (CommitQueryResponse) msg;
            if (r.commitTimestamp != 0) {
                committed.commit(r.queryTimestamp, r.commitTimestamp);
            } else if (r.committed) {
                committed.commit(r.queryTimestamp, largestDeletedTimestamp);
            }
View Full Code Here

    /**
     * Handle the CommitQueryRequest message
     */
    public void handle(CommitQueryRequest msg, ChannelHandlerContext ctx) {
        CommitQueryResponse reply = new CommitQueryResponse(msg.startTimestamp);
        reply.queryTimestamp = msg.queryTimestamp;
        synchronized (sharedState) {
            queries++;
            //1. check the write-write conflicts
            long value;
View Full Code Here

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

TOP

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

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.