@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++; } }
void updateIndex(Transaction tx, KahaUpdateMessageCommand updateMessageCommand, Location location) throws IOException { KahaAddMessageCommand command = updateMessageCommand.getMessage(); StoredDestination sd = getStoredDestination(command.getDestination(), tx); ); sd.locationIndex.put(tx, location, id); incrementAndAddSizeToStoreStat(tx, command.getDestination(), location.getSize()); decrementAndSubSizeToStoreStat(tx, command.getDestination(), previousKeys.location.getSize()); Entry<String, SequenceSet> e = iter.next(); if (e.getValue().contains(id)) { incrementAndAddSizeToStoreStat(key(command.getDestination()), e.getKey(), location.getSize()); decrementAndSubSizeToStoreStat(key(command.getDestination()), e.getKey(), previousKeys.location.getSize());
private void upadateIndex(Transaction tx, KahaAddMessageCommand command, ByteSequence data) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); // Skip adding the message to the index if this is a topic and there are // no subscriptions. if (sd.subscriptions != null && sd.ackPositions.isEmpty()) { return; } // Add the message. long id = sd.nextMessageId++; Long previous = sd.messageIdIndex.put(tx, command.getMessageId(), id); if( previous == null ) { sd.orderIndex.put(tx, id, new MessageRecord(command.getMessageId(), data)); } else { // restore the previous value.. Looks like this was a redo of a previously // added message. We don't want to assing it a new id as the other indexes would // be wrong.. sd.messageIdIndex.put(tx, command.getMessageId(), previous); } }
long updateIndex(Transaction tx, KahaAddMessageCommand command, Location location) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); previous = sd.messageIdIndex.put(tx, command.getMessageId(), id); if (previous == null) { incrementAndAddSizeToStoreStat(tx, command.getDestination(), location.getSize()); sd.orderIndex.put(tx, priority, id, new MessageKeys(command.getMessageId(), location)); if (sd.subscriptions != null && !sd.subscriptions.isEmpty(tx)) { addAckLocationForNewMessage(tx, command.getDestination(), sd, id); if (messageKeys != null && messageKeys.location.compareTo(location) < 0) { LOG.warn("Duplicate message add attempt rejected. Destination: {}://{}, Message id: {}", command.getDestination().getType(), command.getDestination().getName(), command.getMessageId());
@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++; } }
@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++; } }
@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++; } }
private void upadateIndex(Transaction tx, KahaAddMessageCommand command, ByteSequence data) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); // Skip adding the message to the index if this is a topic and there are // no subscriptions. if (sd.subscriptions != null && sd.ackPositions.isEmpty()) { return; } // Add the message. long id = sd.nextMessageId++; Long previous = sd.messageIdIndex.put(tx, command.getMessageId(), id); if( previous == null ) { sd.orderIndex.put(tx, id, new MessageRecord(command.getMessageId(), data)); } else { // restore the previous value.. Looks like this was a redo of a previously // added message. We don't want to assing it a new id as the other indexes would // be wrong.. sd.messageIdIndex.put(tx, command.getMessageId(), previous); } }
private void upadateIndex(Transaction tx, KahaAddMessageCommand command, ByteSequence data) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); // Skip adding the message to the index if this is a topic and there are // no subscriptions. if (sd.subscriptions != null && sd.ackPositions.isEmpty()) { return; } // Add the message. long id = sd.nextMessageId++; Long previous = sd.messageIdIndex.put(tx, command.getMessageId(), id); if( previous == null ) { sd.orderIndex.put(tx, id, new MessageRecord(command.getMessageId(), data)); } else { // restore the previous value.. Looks like this was a redo of a previously // added message. We don't want to assing it a new id as the other indexes would // be wrong.. sd.messageIdIndex.put(tx, command.getMessageId(), previous); } }
private void upadateIndex(Transaction tx, KahaAddMessageCommand command, ByteSequence data) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); // Skip adding the message to the index if this is a topic and there are // no subscriptions. if (sd.subscriptions != null && sd.ackPositions.isEmpty()) { return; } // Add the message. long id = sd.nextMessageId++; Long previous = sd.messageIdIndex.put(tx, command.getMessageId(), id); if( previous == null ) { sd.orderIndex.put(tx, id, new MessageRecord(command.getMessageId(), data)); } else { // restore the previous value.. Looks like this was a redo of a previously // added message. We don't want to assing it a new id as the other indexes would // be wrong.. sd.messageIdIndex.put(tx, command.getMessageId(), previous); } }
private void upadateIndex(Transaction tx, KahaAddMessageCommand command, ByteSequence data) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); // Skip adding the message to the index if this is a topic and there are // no subscriptions. if (sd.subscriptions != null && sd.ackPositions.isEmpty()) { return; } // Add the message. long id = sd.nextMessageId++; Long previous = sd.messageIdIndex.put(tx, command.getMessageId(), id); if( previous == null ) { sd.orderIndex.put(tx, id, new MessageRecord(command.getMessageId(), data)); } else { // restore the previous value.. Looks like this was a redo of a previously // added message. We don't want to assing it a new id as the other indexes would // be wrong.. sd.messageIdIndex.put(tx, command.getMessageId(), previous); } }
public int hashCode() { int rc=1601475350; if (hasTransactionInfo()) { rc ^= ( 265667724^getTransactionInfo().hashCode() ); } if (hasDestination()) { rc ^= ( 238021614^getDestination().hashCode() ); } if (hasMessageId()) { rc ^= ( 563954530^getMessageId().hashCode() ); } if (hasMessage()) { rc ^= ( -1675388953^getMessage().hashCode() ); } if (hasPriority()) { rc ^= ( -1100816956^getPriority() ); } if (hasPrioritySupported()) { rc ^= ( 889475914^ (getPrioritySupported()? 6:-6) ); } return rc; }
public int hashCode() { int rc=1601475350; if (hasTransactionInfo()) { rc ^= ( 265667724^getTransactionInfo().hashCode() ); } if (hasDestination()) { rc ^= ( 238021614^getDestination().hashCode() ); } if (hasMessageId()) { rc ^= ( 563954530^getMessageId().hashCode() ); } if (hasMessage()) { rc ^= ( -1675388953^getMessage().hashCode() ); } if (hasPriority()) { rc ^= ( -1100816956^getPriority() ); } if (hasPrioritySupported()) { rc ^= ( 889475914^ (getPrioritySupported()? 6:-6) ); } return rc; }
public boolean equals(KahaAddMessageCommand 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 (hasMessage() ^ obj.hasMessage() ) return false; if (hasMessage() && ( !getMessage().equals(obj.getMessage()) )) return false; if (hasPriority() ^ obj.hasPriority() ) return false; if (hasPriority() && ( getPriority()!=obj.getPriority() )) return false; if (hasPrioritySupported() ^ obj.hasPrioritySupported() ) return false; if (hasPrioritySupported() && ( getPrioritySupported()!=obj.getPrioritySupported() )) 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 (hasMessage()) { output.writeBytes(4, getMessage()); } if (hasPriority()) { output.writeInt32(5, getPriority()); } if (hasPrioritySupported()) { output.writeBool(6, getPrioritySupported()); } }
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 (hasMessage()) { output.writeBytes(4, getMessage()); } if (hasPriority()) { output.writeInt32(5, getPriority()); } if (hasPrioritySupported()) { output.writeBool(6, getPrioritySupported()); } }
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 (hasMessage()) { output.writeBytes(4, getMessage()); } if (hasPriority()) { output.writeInt32(5, getPriority()); } if (hasPrioritySupported()) { output.writeBool(6, getPrioritySupported()); } }
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 (hasMessage()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(4, getMessage()); } if (hasPriority()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(5, getPriority()); } if (hasPrioritySupported()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeBoolSize(6, getPrioritySupported()); } 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 (hasMessage()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeBytesSize(4, getMessage()); } if (hasPriority()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeInt32Size(5, getPriority()); } if (hasPrioritySupported()) { size += org.apache.activemq.protobuf.CodedOutputStream.computeBoolSize(6, getPrioritySupported()); } 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 (hasMessage()) { output.writeBytes(4, getMessage()); } if (hasPriority()) { output.writeInt32(5, getPriority()); } if (hasPrioritySupported()) { output.writeBool(6, getPrioritySupported()); } }