@Override public void recover(TransactionRecoveryListener listener) throws IOException { for (Map.Entry<TransactionId, ArrayList<Operation>> entry : preparedTransactions.entrySet()) { XATransactionId xid = (XATransactionId)entry.getKey(); ArrayList<Message> messageList = new ArrayList<Message>(); ArrayList<MessageAck> ackList = new ArrayList<MessageAck>(); for (Operation op : entry.getValue()) { if( op.getClass() == AddOpperation.class ) { AddOpperation addOp = (AddOpperation)op; Message msg = (Message)wireFormat.unmarshal( new DataInputStream(addOp.getCommand().getMessage().newInput()) ); messageList.add(msg); } else { RemoveOpperation rmOp = (RemoveOpperation)op; MessageAck ack = (MessageAck)wireFormat.unmarshal( new DataInputStream(rmOp.getCommand().getAck().newInput()) ); ackList.add(ack); } } Message[] addedMessages = new Message[messageList.size()]; MessageAck[] acks = new MessageAck[ackList.size()]; messageList.toArray(addedMessages); ackList.toArray(acks); listener.recover(xid, addedMessages, acks); } } @Override
@Override public synchronized void recover(TransactionRecoveryListener listener) throws IOException { for (Map.Entry<TransactionId, List<Operation>> entry : theStore.preparedTransactions.entrySet()) { XATransactionId xid = (XATransactionId) entry.getKey(); ArrayList<Message> messageList = new ArrayList<Message>(); ArrayList<MessageAck> ackList = new ArrayList<MessageAck>(); for (Operation op : entry.getValue()) { if (op.getClass() == MessageDatabase.AddOperation.class) { MessageDatabase.AddOperation addOp = (MessageDatabase.AddOperation) op; Message msg = (Message) wireFormat().unmarshal(new DataInputStream(addOp.getCommand().getMessage() .newInput())); messageList.add(msg); } else { MessageDatabase.RemoveOperation rmOp = (MessageDatabase.RemoveOperation) op; Buffer ackb = rmOp.getCommand().getAck(); MessageAck ack = (MessageAck) wireFormat().unmarshal(new DataInputStream(ackb.newInput())); ackList.add(ack); } } Message[] addedMessages = new Message[messageList.size()]; MessageAck[] acks = new MessageAck[ackList.size()]; messageList.toArray(addedMessages); ackList.toArray(acks); xid.setPreparedAcks(ackList); theStore.trackRecoveredAcks(ackList); listener.recover(xid, addedMessages, acks); } }
if (command.getAck() != UNMATCHED) { sd.orderIndex.get(tx, sequence); byte priority = sd.orderIndex.lastGetPriority();
@Override public void recover(TransactionRecoveryListener listener) throws IOException { for (Map.Entry<TransactionId, ArrayList<Operation>> entry : preparedTransactions.entrySet()) { XATransactionId xid = (XATransactionId)entry.getKey(); ArrayList<Message> messageList = new ArrayList<Message>(); ArrayList<MessageAck> ackList = new ArrayList<MessageAck>(); for (Operation op : entry.getValue()) { if( op.getClass() == AddOpperation.class ) { AddOpperation addOp = (AddOpperation)op; Message msg = (Message)wireFormat.unmarshal( new DataInputStream(addOp.getCommand().getMessage().newInput()) ); messageList.add(msg); } else { RemoveOpperation rmOp = (RemoveOpperation)op; MessageAck ack = (MessageAck)wireFormat.unmarshal( new DataInputStream(rmOp.getCommand().getAck().newInput()) ); ackList.add(ack); } } Message[] addedMessages = new Message[messageList.size()]; MessageAck[] acks = new MessageAck[ackList.size()]; messageList.toArray(addedMessages); ackList.toArray(acks); listener.recover(xid, addedMessages, acks); } } @Override
public int hashCode() { int rc=-64211337; if (hasTransactionInfo()) { rc ^= ( 265667724^getTransactionInfo().hashCode() ); } if (hasDestination()) { rc ^= ( 238021614^getDestination().hashCode() ); } if (hasMessageId()) { rc ^= ( 563954530^getMessageId().hashCode() ); } if (hasAck()) { rc ^= ( 65641^getAck().hashCode() ); } if (hasSubscriptionKey()) { rc ^= ( 1895830498^getSubscriptionKey().hashCode() ); } return rc; }
public int hashCode() { int rc=-64211337; if (hasTransactionInfo()) { rc ^= ( 265667724^getTransactionInfo().hashCode() ); } if (hasDestination()) { rc ^= ( 238021614^getDestination().hashCode() ); } if (hasMessageId()) { rc ^= ( 563954530^getMessageId().hashCode() ); } if (hasAck()) { rc ^= ( 65641^getAck().hashCode() ); } if (hasSubscriptionKey()) { rc ^= ( 1895830498^getSubscriptionKey().hashCode() ); } return rc; }
public int hashCode() { int rc=-64211337; if (hasTransactionInfo()) { rc ^= ( 265667724^getTransactionInfo().hashCode() ); } if (hasDestination()) { rc ^= ( 238021614^getDestination().hashCode() ); } if (hasMessageId()) { rc ^= ( 563954530^getMessageId().hashCode() ); } if (hasAck()) { rc ^= ( 65641^getAck().hashCode() ); } if (hasSubscriptionKey()) { rc ^= ( 1895830498^getSubscriptionKey().hashCode() ); } return rc; }
public int hashCode() { int rc=-64211337; if (hasTransactionInfo()) { rc ^= ( 265667724^getTransactionInfo().hashCode() ); } if (hasDestination()) { rc ^= ( 238021614^getDestination().hashCode() ); } if (hasMessageId()) { rc ^= ( 563954530^getMessageId().hashCode() ); } if (hasAck()) { rc ^= ( 65641^getAck().hashCode() ); } if (hasSubscriptionKey()) { rc ^= ( 1895830498^getSubscriptionKey().hashCode() ); } return rc; }
public boolean equals(KahaRemoveMessageCommand obj) { if (hasTransactionInfo() ^ obj.hasTransactionInfo() ) return false; if (hasTransactionInfo() && ( !getTransactionInfo().equals(obj.getTransactionInfo()) )) return false; if (hasDestination() ^ obj.hasDestination() ) return false; if (hasDestination() && ( !getDestination().equals(obj.getDestination()) )) return false; if (hasMessageId() ^ obj.hasMessageId() ) return false; if (hasMessageId() && ( !getMessageId().equals(obj.getMessageId()) )) return false; if (hasAck() ^ obj.hasAck() ) return false; if (hasAck() && ( !getAck().equals(obj.getAck()) )) return false; if (hasSubscriptionKey() ^ obj.hasSubscriptionKey() ) return false; if (hasSubscriptionKey() && ( !getSubscriptionKey().equals(obj.getSubscriptionKey()) )) return false; return true; }
public boolean equals(KahaRemoveMessageCommand obj) { if (hasTransactionInfo() ^ obj.hasTransactionInfo() ) return false; if (hasTransactionInfo() && ( !getTransactionInfo().equals(obj.getTransactionInfo()) )) return false; if (hasDestination() ^ obj.hasDestination() ) return false; if (hasDestination() && ( !getDestination().equals(obj.getDestination()) )) return false; if (hasMessageId() ^ obj.hasMessageId() ) return false; if (hasMessageId() && ( !getMessageId().equals(obj.getMessageId()) )) return false; if (hasAck() ^ obj.hasAck() ) return false; if (hasAck() && ( !getAck().equals(obj.getAck()) )) return false; if (hasSubscriptionKey() ^ obj.hasSubscriptionKey() ) return false; if (hasSubscriptionKey() && ( !getSubscriptionKey().equals(obj.getSubscriptionKey()) )) return false; return true; }
public boolean equals(KahaRemoveMessageCommand obj) { if (hasTransactionInfo() ^ obj.hasTransactionInfo() ) return false; if (hasTransactionInfo() && ( !getTransactionInfo().equals(obj.getTransactionInfo()) )) return false; if (hasDestination() ^ obj.hasDestination() ) return false; if (hasDestination() && ( !getDestination().equals(obj.getDestination()) )) return false; if (hasMessageId() ^ obj.hasMessageId() ) return false; if (hasMessageId() && ( !getMessageId().equals(obj.getMessageId()) )) return false; if (hasAck() ^ obj.hasAck() ) return false; if (hasAck() && ( !getAck().equals(obj.getAck()) )) return false; if (hasSubscriptionKey() ^ obj.hasSubscriptionKey() ) return false; if (hasSubscriptionKey() && ( !getSubscriptionKey().equals(obj.getSubscriptionKey()) )) return false; return true; }
public boolean equals(KahaRemoveMessageCommand obj) { if (hasTransactionInfo() ^ obj.hasTransactionInfo() ) return false; if (hasTransactionInfo() && ( !getTransactionInfo().equals(obj.getTransactionInfo()) )) return false; if (hasDestination() ^ obj.hasDestination() ) return false; if (hasDestination() && ( !getDestination().equals(obj.getDestination()) )) return false; if (hasMessageId() ^ obj.hasMessageId() ) return false; if (hasMessageId() && ( !getMessageId().equals(obj.getMessageId()) )) return false; if (hasAck() ^ obj.hasAck() ) return false; if (hasAck() && ( !getAck().equals(obj.getAck()) )) return false; if (hasSubscriptionKey() ^ obj.hasSubscriptionKey() ) return false; if (hasSubscriptionKey() && ( !getSubscriptionKey().equals(obj.getSubscriptionKey()) )) return false; return true; }
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasTransactionInfo()) { writeMessage(output, 1, getTransactionInfo()); } if (hasDestination()) { writeMessage(output, 2, getDestination()); } if (hasMessageId()) { output.writeString(3, getMessageId()); } if (hasAck()) { output.writeBytes(4, getAck()); } if (hasSubscriptionKey()) { output.writeString(5, getSubscriptionKey()); } }
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasTransactionInfo()) { writeMessage(output, 1, getTransactionInfo()); } if (hasDestination()) { writeMessage(output, 2, getDestination()); } if (hasMessageId()) { output.writeString(3, getMessageId()); } if (hasAck()) { output.writeBytes(4, getAck()); } if (hasSubscriptionKey()) { output.writeString(5, getSubscriptionKey()); } }
public int serializedSizeUnframed() { if (memoizedSerializedSize != -1) return memoizedSerializedSize; int size = 0; if (hasTransactionInfo()) { size += computeMessageSize(1, getTransactionInfo()); } if (hasDestination()) { size += computeMessageSize(2, getDestination()); } if (hasMessageId()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(3, getMessageId()); } if (hasAck()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(4, getAck()); } if (hasSubscriptionKey()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(5, getSubscriptionKey()); } memoizedSerializedSize = size; return size; }
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasTransactionInfo()) { writeMessage(output, 1, getTransactionInfo()); } if (hasDestination()) { writeMessage(output, 2, getDestination()); } if (hasMessageId()) { output.writeString(3, getMessageId()); } if (hasAck()) { output.writeBytes(4, getAck()); } if (hasSubscriptionKey()) { output.writeString(5, getSubscriptionKey()); } }
public void writeUnframed(org.apache.activemq.protobuf.CodedOutputStream output) throws java.io.IOException { if (hasTransactionInfo()) { writeMessage(output, 1, getTransactionInfo()); } if (hasDestination()) { writeMessage(output, 2, getDestination()); } if (hasMessageId()) { output.writeString(3, getMessageId()); } if (hasAck()) { output.writeBytes(4, getAck()); } if (hasSubscriptionKey()) { output.writeString(5, getSubscriptionKey()); } }
public int serializedSizeUnframed() { if (memoizedSerializedSize != -1) return memoizedSerializedSize; int size = 0; if (hasTransactionInfo()) { size += computeMessageSize(1, getTransactionInfo()); } if (hasDestination()) { size += computeMessageSize(2, getDestination()); } if (hasMessageId()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(3, getMessageId()); } if (hasAck()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(4, getAck()); } if (hasSubscriptionKey()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(5, getSubscriptionKey()); } memoizedSerializedSize = size; return size; }
public int serializedSizeUnframed() { if (memoizedSerializedSize != -1) return memoizedSerializedSize; int size = 0; if (hasTransactionInfo()) { size += computeMessageSize(1, getTransactionInfo()); } if (hasDestination()) { size += computeMessageSize(2, getDestination()); } if (hasMessageId()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(3, getMessageId()); } if (hasAck()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(4, getAck()); } if (hasSubscriptionKey()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeStringSize(5, getSubscriptionKey()); } memoizedSerializedSize = size; return size; }
public KahaRemoveMessageCommand mergeFrom(KahaRemoveMessageCommand other) { if (other.hasTransactionInfo()) { if (hasTransactionInfo()) { getTransactionInfo().mergeFrom(other.getTransactionInfo()); } else { setTransactionInfo(other.getTransactionInfo().clone()); } } if (other.hasDestination()) { if (hasDestination()) { getDestination().mergeFrom(other.getDestination()); } else { setDestination(other.getDestination().clone()); } } if (other.hasMessageId()) { setMessageId(other.getMessageId()); } if (other.hasAck()) { setAck(other.getAck()); } if (other.hasSubscriptionKey()) { setSubscriptionKey(other.getSubscriptionKey()); } return this; }