Package com.yahoo.omid.tso.messages

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


         }
      } 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) {
         AbortedTransactionReport r = (AbortedTransactionReport) msg;
         aborted.add(r.startTimestamp);
      } else if (msg instanceof LargestDeletedTimestampReport) {
View Full Code Here


   }

   private TSOMessage decodeFullAbort(byte diff) {
      // Full abort
      lastFullAbortedTimestamp += extractAbortedDifference(diff);
      return new CleanedTransactionReport(lastFullAbortedTimestamp);
   }
View Full Code Here

      return msg;
   }

   private CleanedTransactionReport decodeFullAbort(byte type, ChannelBuffer buffer) {
       CleanedTransactionReport msg;
      if (type == TSOMessage.CleanedTransactionReport) {
         msg = new CleanedTransactionReport();
         msg.readObject(buffer);
      } else {
         msg = new CleanedTransactionReport();
         int diff = buffer.readByte();
         msg.startTimestamp = lastFullAbortedTimestamp + diff;
      }
      lastFullAbortedTimestamp = msg.startTimestamp;
View Full Code Here

     
      //
      // Cleaned Transaction Report
      //
      clientHandler.sendMessage(new TimestampRequest());
      CleanedTransactionReport cltr1 = clientHandler.receiveMessage(CleanedTransactionReport.class);
      assertEquals(tr2.timestamp, cltr1.startTimestamp);     
     
      //
      // Cleaned Transaction Report
      //
      secondClientHandler.sendMessage(new TimestampRequest());
      CleanedTransactionReport cltr2 = secondClientHandler.receiveMessage(CleanedTransactionReport.class);
      assertEquals(tr2.timestamp, cltr2.startTimestamp);     
   }
View Full Code Here

      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 }));
View Full Code Here

                smb.writeCommit(firstTS, secondTS);
                expectedMessages.add(new CommittedTransactionReport(firstTS, secondTS));
                break;
            case 1:
                smb.writeFullAbort(firstTS);
                expectedMessages.add(new CleanedTransactionReport(firstTS));
                break;
            case 2:
                smb.writeHalfAbort(firstTS);
                expectedMessages.add(new AbortedTransactionReport(firstTS));
                break;
View Full Code Here

            assertThat(msg, is(AbortedTransactionReport.class));
            AbortedTransactionReport atr = (AbortedTransactionReport) msg;
            assertThat("startDiff: " + tsDiff, atr.startTimestamp, is(st));
            msg = dezipper.decodeMessage(buffer);
            assertThat(msg, is(CleanedTransactionReport.class));
            CleanedTransactionReport ctr = (CleanedTransactionReport) msg;
            assertThat("startDiff: " + tsDiff, ctr.startTimestamp, is(st));
        }
    }
View Full Code Here

            }
        } 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) {
            AbortedTransactionReport r = (AbortedTransactionReport) msg;
            aborted.add(r.startTimestamp);
        } else if (msg instanceof LargestDeletedTimestampReport) {
View Full Code Here

      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 }));
View Full Code Here

    }

    private TSOMessage decodeFullAbort(byte diff) {
        // Full abort
        lastFullAbortedTimestamp += extractAbortedDifference(diff);
        return new CleanedTransactionReport(lastFullAbortedTimestamp);
    }
View Full Code Here

TOP

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

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.