@SuppressWarnings("rawtypes") public void track(Operation operation) { if (location == null ) { location = operation.getLocation(); } KahaDestination destination; boolean isAdd = false; if (operation instanceof AddOperation) { AddOperation add = (AddOperation) operation; destination = add.getCommand().getDestination(); isAdd = true; } else { RemoveOperation removeOpperation = (RemoveOperation) operation; destination = removeOpperation.getCommand().getDestination(); } opCount opCount = destinationOpCount.get(destination); if (opCount == null) { opCount = new opCount(); destinationOpCount.put(destination, opCount); } if (isAdd) { opCount.add++; } else { opCount.remove++; } }
decrementAndSubSizeToStoreStat(command.getDestination(), subscriptionKey, key.location.getSize()); sd.messageIdIndex.remove(tx, entry.getValue().messageId); sd.orderIndex.remove(tx, entry.getKey()); decrementAndSubSizeToStoreStat(tx, command.getDestination(), entry.getValue().location.getSize());
void updateIndex(Transaction tx, KahaRemoveMessageCommand command, Location ackLocation) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); if (!command.hasSubscriptionKey()) { if (keys != null) { sd.locationIndex.remove(tx, keys.location); decrementAndSubSizeToStoreStat(tx, command.getDestination(), keys.location.getSize()); recordAckMessageReferenceLocation(ackLocation, keys.location); metadata.lastUpdate = ackLocation;
private void updateIndex(Transaction tx, KahaRemoveMessageCommand command) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); if (!command.hasSubscriptionKey()) { // In the queue case we just remove the message from the index.. Long sequenceId = sd.messageIdIndex.remove(tx, command.getMessageId()); if (sequenceId != null) { sd.orderIndex.remove(tx, sequenceId); } } else { // In the topic case we need remove the message once it's been acked // by all the subs Long sequence = sd.messageIdIndex.get(tx, command.getMessageId()); // Make sure it's a valid message id... if (sequence != null) { String subscriptionKey = command.getSubscriptionKey(); Long prev = sd.subscriptionAcks.put(tx, subscriptionKey, sequence); // The following method handles deleting un-referenced messages. removeAckByteSequence(tx, sd, subscriptionKey, prev); // Add it to the new location set. addAckByteSequence(sd, sequence, subscriptionKey); } } }
public java.util.ArrayList<String> missingFields() { java.util.ArrayList<String> missingFields = super.missingFields(); if( !hasDestination() ) { missingFields.add("destination"); } if( !hasMessageId() ) { missingFields.add("messageId"); } if( hasTransactionInfo() ) { try { getTransactionInfo().assertInitialized(); } catch (org.apache.activemq.protobuf.UninitializedMessageException e){ missingFields.addAll(prefix(e.getMissingFields(),"transaction_info.")); } } if( hasDestination() ) { try { getDestination().assertInitialized(); } catch (org.apache.activemq.protobuf.UninitializedMessageException e){ missingFields.addAll(prefix(e.getMissingFields(),"destination.")); } } return missingFields; }
public java.util.ArrayList<String> missingFields() { java.util.ArrayList<String> missingFields = super.missingFields(); if( !hasDestination() ) { missingFields.add("destination"); } if( !hasMessageId() ) { missingFields.add("messageId"); } if( hasTransactionInfo() ) { try { getTransactionInfo().assertInitialized(); } catch (org.apache.activemq.protobuf.UninitializedMessageException e){ missingFields.addAll(prefix(e.getMissingFields(),"transaction_info.")); } } if( hasDestination() ) { try { getDestination().assertInitialized(); } catch (org.apache.activemq.protobuf.UninitializedMessageException e){ missingFields.addAll(prefix(e.getMissingFields(),"destination.")); } } return missingFields; }
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; }
private void updateIndex(Transaction tx, KahaRemoveMessageCommand command) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); if (!command.hasSubscriptionKey()) { // In the queue case we just remove the message from the index.. Long sequenceId = sd.messageIdIndex.remove(tx, command.getMessageId()); if (sequenceId != null) { sd.orderIndex.remove(tx, sequenceId); } } else { // In the topic case we need remove the message once it's been acked // by all the subs Long sequence = sd.messageIdIndex.get(tx, command.getMessageId()); // Make sure it's a valid message id... if (sequence != null) { String subscriptionKey = command.getSubscriptionKey(); Long prev = sd.subscriptionAcks.put(tx, subscriptionKey, sequence); // The following method handles deleting un-referenced messages. removeAckByteSequence(tx, sd, subscriptionKey, prev); // Add it to the new location set. addAckByteSequence(sd, sequence, subscriptionKey); } } }
private void updateIndex(Transaction tx, KahaRemoveMessageCommand command) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); if (!command.hasSubscriptionKey()) { // In the queue case we just remove the message from the index.. Long sequenceId = sd.messageIdIndex.remove(tx, command.getMessageId()); if (sequenceId != null) { sd.orderIndex.remove(tx, sequenceId); } } else { // In the topic case we need remove the message once it's been acked // by all the subs Long sequence = sd.messageIdIndex.get(tx, command.getMessageId()); // Make sure it's a valid message id... if (sequence != null) { String subscriptionKey = command.getSubscriptionKey(); Long prev = sd.subscriptionAcks.put(tx, subscriptionKey, sequence); // The following method handles deleting un-referenced messages. removeAckByteSequence(tx, sd, subscriptionKey, prev); // Add it to the new location set. addAckByteSequence(sd, sequence, subscriptionKey); } } }
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 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 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; }