Package com.yahoo.omid.tso.messages

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


         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) {
         LargestDeletedTimestampReport r = (LargestDeletedTimestampReport) msg;
         largestDeletedTimestamp = r.largestDeletedTimestamp;
         committed.raiseLargestDeletedTransaction(r.largestDeletedTimestamp);
View Full Code Here


   }

   private TSOMessage decodeHalfAbort(byte diff) {
      // Half abort
      lastHalfAbortedTimestamp += extractAbortedDifference(diff);
      return new AbortedTransactionReport(lastHalfAbortedTimestamp);
   }
View Full Code Here

      // extend the sign
      return (extracted << 27) >> 27;
   }

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

                 channel.write(buffer.getZipperState());
                 buffer.initializeIndexes();
              }
           }
           for (AbortedTransaction halfAborted : sharedState.hashmap.halfAborted) {
              channel.write(new AbortedTransactionReport(halfAborted.getStartTimestamp()));
           }
        }
        ChannelBuffer cb;
        ChannelFuture future = Channels.future(channel);
        synchronized (sharedMsgBufLock) {
View Full Code Here

      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
      //
      AbortedTransactionReport atr2 = secondClientHandler.receiveMessage(AbortedTransactionReport.class);
      assertEquals(tr2.timestamp, atr2.startTimestamp);  

      secondClientHandler.receiveMessage(TimestampResponse.class);
     
      secondClientHandler.sendMessage(new FullAbortRequest(tr2.timestamp));
View Full Code Here

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

                smb.writeFullAbort(firstTS);
                expectedMessages.add(new CleanedTransactionReport(firstTS));
                break;
            case 2:
                smb.writeHalfAbort(firstTS);
                expectedMessages.add(new AbortedTransactionReport(firstTS));
                break;
            case 3:
                smb.writeLargestIncrease(firstTS);
                expectedMessages.add(new LargestDeletedTimestampReport(firstTS));
                break;
View Full Code Here

            buffer.clear();
            zipper.encodeHalfAbort(buffer, st);
            zipper.encodeFullAbort(buffer, st);
            TSOMessage msg = dezipper.decodeMessage(buffer);
            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

            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) {
            LargestDeletedTimestampReport r = (LargestDeletedTimestampReport) msg;
            largestDeletedTimestamp = r.largestDeletedTimestamp;
            committed.raiseLargestDeletedTransaction(r.largestDeletedTimestamp);
View Full Code Here

                    channel.write(buffer.getZipperState());
                    buffer.initializeIndexes(); //进行完channel.write(buffer.getZipperState())后并不对buffer的read和write有任何影响
                }
            }
            for (AbortedTransaction halfAborted : sharedState.hashmap.halfAborted) {
                channel.write(new AbortedTransactionReport(halfAborted.getStartTimestamp()));
            }
        }
        ChannelBuffer cb;
        ChannelFuture future = Channels.future(channel);
        synchronized (sharedMsgBufLock) {
View Full Code Here

TOP

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

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.