You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2016/09/02 08:38:09 UTC
svn commit: r1758900 - in /qpid/java/trunk:
broker-core/src/main/java/org/apache/qpid/server/message/
broker-core/src/main/java/org/apache/qpid/server/model/
broker-core/src/main/java/org/apache/qpid/server/queue/
broker-core/src/main/java/org/apache/q...
Author: rgodfrey
Date: Fri Sep 2 08:38:09 2016
New Revision: 1758900
URL: http://svn.apache.org/viewvc?rev=1758900&view=rev
Log:
QPID-7381 : Flip priority to have large numbers mean high priority
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageSource.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumerImpl.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSource.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractSystemMessageSource.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostPropertiesNode.java
qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java
qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageSource.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageSource.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageSource.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageSource.java Fri Sep 2 08:38:09 2016
@@ -35,7 +35,7 @@ public interface MessageSource extends T
Class<? extends ServerMessage> messageClass,
String consumerName,
EnumSet<ConsumerImpl.Option> options,
- int priority)
+ Integer priority)
throws ExistingExclusiveConsumer, ExistingConsumerPreventsExclusive,
ConsumerAccessRefused;
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Consumer.java Fri Sep 2 08:38:09 2016
@@ -53,9 +53,9 @@ public interface Consumer<X extends Cons
@ManagedAttribute
String getSelector();
- @ManagedAttribute(defaultValue = "0",
- description="Non-negative number representing the priority of the consumer versus other "
- + "consumers. Priority 0 is the highest priority.")
+ @ManagedAttribute(defaultValue = "2147483647",
+ description="Number representing the priority of the consumer versus other "
+ + "consumers. Priority 2147483647 is the highest priority.")
int getPriority();
@ManagedStatistic(statisticType = StatisticType.CUMULATIVE, units = StatisticUnit.BYTES, label = "Outbound")
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java Fri Sep 2 08:38:09 2016
@@ -708,7 +708,7 @@ public abstract class AbstractQueue<X ex
final Class<? extends ServerMessage> messageClass,
final String consumerName,
final EnumSet<ConsumerImpl.Option> optionSet,
- final int priority)
+ final Integer priority)
throws ExistingExclusiveConsumer, ExistingConsumerPreventsExclusive,
ConsumerAccessRefused
{
@@ -761,7 +761,7 @@ public abstract class AbstractQueue<X ex
final Class<? extends ServerMessage> messageClass,
final String consumerName,
EnumSet<ConsumerImpl.Option> optionSet,
- final int priority)
+ final Integer priority)
throws ExistingExclusiveConsumer, ConsumerAccessRefused,
ExistingConsumerPreventsExclusive
{
@@ -1302,7 +1302,7 @@ public abstract class AbstractQueue<X ex
// if consumer at end, and active, offer
final QueueConsumer<?> sub = nextNode.getConsumer();
- if(sub.getPriority() == 0)
+ if(sub.getPriority() == Integer.MAX_VALUE)
{
deliverToConsumer(sub, entry);
}
@@ -2219,7 +2219,7 @@ public abstract class AbstractQueue<X ex
QueueEntry node = getNextAvailableEntry(sub);
boolean subActive = sub.isActive() && !sub.isSuspended();
- if (subActive && (sub.getPriority() == 0 || noHigherPriorityWithCredit(sub)))
+ if (subActive && (sub.getPriority() == Integer.MAX_VALUE || noHigherPriorityWithCredit(sub)))
{
if (_virtualHost.getState() != State.ACTIVE)
@@ -2281,7 +2281,7 @@ public abstract class AbstractQueue<X ex
{
final ConsumerNode node = iterator.getNode();
QueueConsumer consumer = node.getConsumer();
- if(consumer.getPriority() < sub.getPriority())
+ if(consumer.getPriority() > sub.getPriority())
{
if(getNextAvailableEntry(consumer) != null && consumer.hasCredit())
{
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumerImpl.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumerImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/QueueConsumerImpl.java Fri Sep 2 08:38:09 2016
@@ -123,7 +123,7 @@ class QueueConsumerImpl
final FilterManager filters,
final Class<? extends ServerMessage> messageClass,
EnumSet<Option> optionSet,
- final int priority)
+ final Integer priority)
{
super(parentsMap(queue, target.getSessionModel().getModelObject()),
createAttributeMap(consumerName, filters, optionSet, priority));
@@ -169,7 +169,7 @@ class QueueConsumerImpl
private static Map<String, Object> createAttributeMap(String name,
FilterManager filters,
EnumSet<Option> optionSet,
- int priority)
+ Integer priority)
{
Map<String,Object> attributes = new HashMap<String, Object>();
attributes.put(ID, UUID.randomUUID());
@@ -179,7 +179,10 @@ class QueueConsumerImpl
attributes.put(DISTRIBUTION_MODE, optionSet.contains(Option.ACQUIRES) ? "MOVE" : "COPY");
attributes.put(DURABLE,optionSet.contains(Option.DURABLE));
attributes.put(LIFETIME_POLICY, LifetimePolicy.DELETE_ON_SESSION_END);
- attributes.put(PRIORITY, priority);
+ if(priority != null)
+ {
+ attributes.put(PRIORITY, priority);
+ }
if(filters != null)
{
Iterator<MessageFilter> iter = filters.filters();
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSource.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSource.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSource.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/TrustStoreMessageSource.java Fri Sep 2 08:38:09 2016
@@ -118,7 +118,7 @@ public class TrustStoreMessageSource ext
final FilterManager filters,
final Class<? extends ServerMessage> messageClass,
final String consumerName,
- final EnumSet<ConsumerImpl.Option> options, final int priority)
+ final EnumSet<ConsumerImpl.Option> options, final Integer priority)
throws ExistingExclusiveConsumer, ExistingConsumerPreventsExclusive,
ConsumerAccessRefused
{
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractSystemMessageSource.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractSystemMessageSource.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractSystemMessageSource.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractSystemMessageSource.java Fri Sep 2 08:38:09 2016
@@ -86,7 +86,7 @@ public abstract class AbstractSystemMess
final FilterManager filters,
final Class<? extends ServerMessage> messageClass,
final String consumerName,
- final EnumSet<ConsumerImpl.Option> options, final int priority)
+ final EnumSet<ConsumerImpl.Option> options, final Integer priority)
throws ExistingExclusiveConsumer, ExistingConsumerPreventsExclusive,
ConsumerAccessRefused
{
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostPropertiesNode.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostPropertiesNode.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostPropertiesNode.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostPropertiesNode.java Fri Sep 2 08:38:09 2016
@@ -51,7 +51,7 @@ public class VirtualHostPropertiesNode e
final FilterManager filters,
final Class<? extends ServerMessage> messageClass,
final String consumerName,
- final EnumSet<ConsumerImpl.Option> options, final int priority)
+ final EnumSet<ConsumerImpl.Option> options, final Integer priority)
throws ExistingExclusiveConsumer, ExistingConsumerPreventsExclusive,
ConsumerAccessRefused
{
Modified: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java (original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ServerSessionDelegate.java Fri Sep 2 08:38:09 2016
@@ -319,7 +319,7 @@ public class ServerSessionDelegate exten
method.getArguments()
);
- int priority;
+ Integer priority = null;
if(method.hasArguments() && method.getArguments().containsKey("x-priority"))
{
Object value = method.getArguments().get("x-priority");
@@ -335,22 +335,8 @@ public class ServerSessionDelegate exten
}
catch (NumberFormatException e)
{
- priority = 0;
}
}
- else
- {
- priority = 0;
- }
-
- if (priority < 0)
- {
- priority = 0;
- }
- }
- else
- {
- priority = 0;
}
((ServerSession)session).register(destination, target);
Modified: qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java (original)
+++ qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQChannel.java Fri Sep 2 08:38:09 2016
@@ -322,7 +322,7 @@ public class AMQChannel
singleMessageCredit, getDeliveryMethod, getRecordMethod);
}
- ConsumerImpl sub = queue.addConsumer(target, null, AMQMessage.class, "", options, 0);
+ ConsumerImpl sub = queue.addConsumer(target, null, AMQMessage.class, "", options, null);
sub.flush();
sub.close();
return getDeliveryMethod.hasDeliveredMessage();
@@ -802,7 +802,7 @@ public class AMQChannel
}
- int priority;
+ Integer priority = null;
if(arguments != null && arguments.containsKey("x-priority"))
{
Object value = arguments.get("x-priority");
@@ -818,23 +818,10 @@ public class AMQChannel
}
catch (NumberFormatException e)
{
- priority = 0;
+ // use default vlaue
}
}
- else
- {
- priority = 0;
- }
- if (priority < 0)
- {
- priority = 0;
- }
-
- }
- else
- {
- priority = 0;
}
Modified: qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java (original)
+++ qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java Fri Sep 2 08:38:09 2016
@@ -76,17 +76,17 @@ public class SendingLinkEndpoint extends
}
catch (NumberFormatException e)
{
- _priority = 0;
+ _priority = Integer.MAX_VALUE;
}
}
else
{
- _priority = 0;
+ _priority = Integer.MAX_VALUE;
}
- if (_priority < 0)
+ if (_priority < Integer.MAX_VALUE)
{
- _priority = 0;
+ _priority = Integer.MAX_VALUE;
}
actualProperties.put(PRIORITY, _priority);
}
Modified: qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java?rev=1758900&r1=1758899&r2=1758900&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java (original)
+++ qpid/java/trunk/broker-plugins/management-amqp/src/main/java/org/apache/qpid/server/management/amqp/ManagementNode.java Fri Sep 2 08:38:09 2016
@@ -982,7 +982,7 @@ class ManagementNode implements MessageS
final Class<? extends ServerMessage> messageClass,
final String consumerName,
final EnumSet<ConsumerImpl.Option> options,
- final int priority)
+ final Integer priority)
{
final ManagementNodeConsumer managementNodeConsumer = new ManagementNodeConsumer(consumerName,this, target);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org