You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2018/06/07 13:29:10 UTC

[1/3] qpid-broker-j git commit: QPID-8204: [Broker-J] Rename new statistics into 'inboundMessageHighWatermark' and remove extra switch enabling the statistics evaluation

Repository: qpid-broker-j
Updated Branches:
  refs/heads/7.0.x a052b415c -> 47270098c


QPID-8204: [Broker-J] Rename new statistics into 'inboundMessageHighWatermark' and remove extra switch enabling the statistics evaluation

(cherry picked from commit 0b63b074e0e61e026caab0122aa4fa404aec25ff)


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/0df1680d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/0df1680d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/0df1680d

Branch: refs/heads/7.0.x
Commit: 0df1680d9d008d306c5f5e6319e1c5f618f4b5cb
Parents: a052b41
Author: Alex Rudyy <or...@apache.org>
Authored: Wed Jun 6 20:02:35 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Thu Jun 7 10:17:37 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/qpid/server/model/Broker.java  | 14 +++-----------
 .../org/apache/qpid/server/model/BrokerImpl.java   | 17 ++++++-----------
 .../server/virtualhost/AbstractVirtualHost.java    | 15 +++++----------
 .../virtualhost/QueueManagingVirtualHost.java      |  8 +++-----
 4 files changed, 17 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0df1680d/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java b/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
index 770709a..e959818 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
@@ -126,12 +126,6 @@ public interface Broker<X extends Broker<X>> extends ConfiguredObject<X>, EventL
 
     String PROPERTY_DISABLED_FEATURES = "qpid.broker_disabled_features";
 
-    String MAX_MESSAGE_SIZE__STATISTICS_ENABLED = "qpid.broker.maxMessageSizeStatisticsEnabled";
-    @ManagedContextDefault(name = MAX_MESSAGE_SIZE__STATISTICS_ENABLED,
-                            description = "Flag to enable collection of maximum message size statistics.")
-    @SuppressWarnings("unused")
-    boolean DEFAULT_MAX_MESSAGE_SIZE_STATISTICS_ENABLED = false;
-
     @DerivedAttribute
     String getBuildVersion();
 
@@ -303,11 +297,9 @@ public interface Broker<X extends Broker<X>> extends ConfiguredObject<X>, EventL
     @SuppressWarnings("unused")
     @ManagedStatistic(statisticType = StatisticType.POINT_IN_TIME,
             units = StatisticUnit.BYTES,
-            label = "Maximum inbound message size",
-            description = "Maximum size of messages published into the Broker since start-up."
-                          + " The statistics is only evaluated when context variable"
-                          + " 'qpid.broker.maxMessageSizeStatisticsEnabled' is set to 'true'.")
-    long getMaximumMessageSize();
+            label = "Maximum recorded size of inbound messages",
+            description = "Maximum size of messages published into the Broker since start-up.")
+    long getInboundMessageSizeHighWatermark();
 
     @ManagedOperation(nonModifying = true,
             description = "Restart the broker within the same JVM",

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0df1680d/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
index 84554bf..656f184 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
@@ -121,7 +121,7 @@ public class BrokerImpl extends AbstractContainer<BrokerImpl> implements Broker<
     private final AtomicLong _transactedMessagesOut = new AtomicLong();
     private final AtomicLong _bytesIn = new AtomicLong();
     private final AtomicLong _bytesOut = new AtomicLong();
-    private final AtomicLong _maximumMessageSizeIn = new AtomicLong();
+    private final AtomicLong _maximumMessageSize = new AtomicLong();
 
     @ManagedAttributeField
     private int _statisticsReportingPeriod;
@@ -146,7 +146,6 @@ public class BrokerImpl extends AbstractContainer<BrokerImpl> implements Broker<
     private ScheduledFuture<?> _assignTargetSizeSchedulingFuture;
     private volatile ScheduledFuture<?> _statisticsReportingFuture;
     private long _housekeepingCheckPeriod;
-    private volatile boolean _maximumMessageSizeStatisticsEnabled;
 
     @ManagedObjectFactoryConstructor
     public BrokerImpl(Map<String, Object> attributes,
@@ -630,7 +629,6 @@ public class BrokerImpl extends AbstractContainer<BrokerImpl> implements Broker<
         _compactMemoryThreshold = getContextValue(Long.class, Broker.COMPACT_MEMORY_THRESHOLD);
         _compactMemoryInterval = getContextValue(Long.class, Broker.COMPACT_MEMORY_INTERVAL);
         _housekeepingCheckPeriod = getContextValue(Long.class, Broker.QPID_BROKER_HOUSEKEEPING_CHECK_PERIOD);
-        _maximumMessageSizeStatisticsEnabled = getContextValue(Boolean.class, Broker.MAX_MESSAGE_SIZE__STATISTICS_ENABLED);
 
         if (SystemUtils.getProcessPid() != null)
         {
@@ -873,9 +871,10 @@ public class BrokerImpl extends AbstractContainer<BrokerImpl> implements Broker<
     {
         _messagesIn.incrementAndGet();
         _bytesIn.addAndGet(messageSize);
-        if (_maximumMessageSizeStatisticsEnabled)
+        long hwm;
+        while((hwm = _maximumMessageSize.get()) < messageSize)
         {
-           _maximumMessageSizeIn.getAndUpdate(current -> messageSize > current ? messageSize : current);
+            _maximumMessageSize.compareAndSet(hwm, messageSize);
         }
     }
 
@@ -900,13 +899,9 @@ public class BrokerImpl extends AbstractContainer<BrokerImpl> implements Broker<
     }
 
     @Override
-    public long getMaximumMessageSize()
+    public long getInboundMessageSizeHighWatermark()
     {
-        if (_maximumMessageSizeStatisticsEnabled)
-        {
-            return _maximumMessageSizeIn.get();
-        }
-        return 0;
+        return _maximumMessageSize.get();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0df1680d/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
index f5b97b4..6226617 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
@@ -216,7 +216,6 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>> exte
     private final AccessControl _accessControl;
 
     private volatile boolean _createDefaultExchanges;
-    private volatile boolean _maximumMessageSizeStatisticsEnabled;
 
     private final AccessControl _systemUserAllowed = new SubjectFixedResultAccessControl(new ResultCalculator()
     {
@@ -605,7 +604,6 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>> exte
         _fileSystemMaxUsagePercent = getContextValue(Integer.class, Broker.STORE_FILESYSTEM_MAX_USAGE_PERCENT);
         _flowToDiskCheckPeriod = getContextValue(Long.class, FLOW_TO_DISK_CHECK_PERIOD);
         _isDiscardGlobalSharedSubscriptionLinksOnDetach = getContextValue(Boolean.class, DISCARD_GLOBAL_SHARED_SUBSCRIPTION_LINKS_ON_DETACH);
-        _maximumMessageSizeStatisticsEnabled = getContextValue(Boolean.class, Broker.MAX_MESSAGE_SIZE__STATISTICS_ENABLED);
 
         QpidServiceLoader serviceLoader = new QpidServiceLoader();
         for(ConnectionValidator validator : serviceLoader.instancesOf(ConnectionValidator.class))
@@ -1507,13 +1505,9 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>> exte
     }
 
     @Override
-    public long getMaximumMessageSize()
+    public long getInboundMessageSizeHighWatermark()
     {
-        if (_maximumMessageSizeStatisticsEnabled)
-        {
-            return _maximumMessageSize.get();
-        }
-        return 0;
+        return _maximumMessageSize.get();
     }
 
     @Override
@@ -1678,9 +1672,10 @@ public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>> exte
         _messagesIn.incrementAndGet();
         _bytesIn.addAndGet(messageSize);
         _broker.registerMessageReceived(messageSize);
-        if (_maximumMessageSizeStatisticsEnabled)
+        long hwm;
+        while((hwm = _maximumMessageSize.get()) < messageSize)
         {
-            _maximumMessageSize.getAndUpdate(current ->  messageSize > current ? messageSize : current);
+            _maximumMessageSize.compareAndSet(hwm, messageSize);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/0df1680d/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
----------------------------------------------------------------------
diff --git a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
index 5484923..9f1b318 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/virtualhost/QueueManagingVirtualHost.java
@@ -283,11 +283,9 @@ public interface QueueManagingVirtualHost<X extends QueueManagingVirtualHost<X>>
     @SuppressWarnings("unused")
     @ManagedStatistic(statisticType = StatisticType.POINT_IN_TIME,
             units = StatisticUnit.BYTES,
-            label = "Maximum inbound message size",
-            description = "Maximum size of message published into the Virtual Host since start-up."
-                          + " The statistics is only evaluated when context variable"
-                          + " 'qpid.broker.maxMessageSizeStatisticsEnabled' is set to 'true'.")
-    long getMaximumMessageSize();
+            label = "Maximum recorded size of inbound messages",
+            description = "Maximum size of message published into the Virtual Host since start-up.")
+    long getInboundMessageSizeHighWatermark();
 
     @Override
     @ManagedOperation(nonModifying = true, changesConfiguredObjectState = false)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[2/3] qpid-broker-j git commit: QPID-8202: [Broker-J] Address review comments from Keith Wall

Posted by or...@apache.org.
QPID-8202: [Broker-J] Address review comments from Keith Wall

(cherry picked from commit 9d08c765155f4d70e53f972f1a63b4a73cccc26f)


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/daf346ef
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/daf346ef
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/daf346ef

Branch: refs/heads/7.0.x
Commit: daf346efcd5ca2652f49077c622a3ffccab03049
Parents: 0df1680
Author: Alex Rudyy <or...@apache.org>
Authored: Thu Jun 7 11:25:38 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Thu Jun 7 13:26:06 2018 +0100

----------------------------------------------------------------------
 .../v0_8/ProtocolOutputConverterImpl.java       | 52 +++++++++-----------
 1 file changed, 22 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/daf346ef/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java
----------------------------------------------------------------------
diff --git a/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java b/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java
index bcc515b..10146cb 100644
--- a/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java
+++ b/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolOutputConverterImpl.java
@@ -176,29 +176,28 @@ public class ProtocolOutputConverterImpl implements ProtocolOutputConverter
         }
         else
         {
-            int maxBodySize = (int) _connection.getMaxFrameSize() - AMQFrame.getFrameOverhead();
-
-
-            int capacity = bodySize > maxBodySize ? maxBodySize : bodySize;
-
-            int writtenSize = capacity;
-
+            int maxFrameBodySize = (int) _connection.getMaxFrameSize() - AMQFrame.getFrameOverhead();
             try (QpidByteBuffer contentByteBuffer = content.getContent())
             {
-                AMQBody firstContentBody = new MessageContentSourceBody(contentByteBuffer, 0, capacity);
-
-                CompositeAMQBodyBlock
-                        compositeBlock =
-                        new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody, firstContentBody);
-                writeFrame(compositeBlock);
+                int contentChunkSize = bodySize > maxFrameBodySize ? maxFrameBodySize : bodySize;
+                try (QpidByteBuffer chunk = contentByteBuffer.view(0, contentChunkSize))
+                {
+                    writeFrame(new CompositeAMQBodyBlock(channelId,
+                                                         deliverBody,
+                                                         contentHeaderBody,
+                                                         new MessageContentSourceBody(chunk)));
+                }
 
+                int writtenSize = contentChunkSize;
                 while (writtenSize < bodySize)
                 {
-                    capacity = bodySize - writtenSize > maxBodySize ? maxBodySize : bodySize - writtenSize;
-                    AMQBody body = new MessageContentSourceBody(contentByteBuffer, writtenSize, capacity);
-                    writtenSize += capacity;
-
-                    writeFrame(new AMQFrame(channelId, body));
+                    contentChunkSize =
+                            (bodySize - writtenSize) > maxFrameBodySize ? maxFrameBodySize : bodySize - writtenSize;
+                    try (QpidByteBuffer chunk = contentByteBuffer.view(writtenSize, contentChunkSize))
+                    {
+                        writtenSize += contentChunkSize;
+                        writeFrame(new AMQFrame(channelId, new MessageContentSourceBody(chunk)));
+                    }
                 }
             }
         }
@@ -214,13 +213,11 @@ public class ProtocolOutputConverterImpl implements ProtocolOutputConverter
         public static final byte TYPE = 3;
         private final int _length;
         private final QpidByteBuffer _content;
-        private final int _offset;
 
-        public MessageContentSourceBody(QpidByteBuffer content, int offset, int length)
+        private MessageContentSourceBody(QpidByteBuffer content)
         {
             _content = content;
-            _offset = offset;
-            _length = length;
+            _length = content.remaining();
         }
 
         @Override
@@ -238,13 +235,8 @@ public class ProtocolOutputConverterImpl implements ProtocolOutputConverter
         @Override
         public long writePayload(final ByteBufferSender sender)
         {
-            long size;
-            try (final QpidByteBuffer content = _content.view(_offset, _length))
-            {
-                size = content.remaining();
-                sender.send(content);
-            }
-            return size;
+            sender.send(_content);
+            return _length;
         }
 
         @Override
@@ -256,7 +248,7 @@ public class ProtocolOutputConverterImpl implements ProtocolOutputConverter
         @Override
         public String toString()
         {
-            return "[" + getClass().getSimpleName() + " offset: " + _offset + ", length: " + _length + "]";
+            return "[" + getClass().getSimpleName() + ", length: " + _length + "]";
         }
 
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


[3/3] qpid-broker-j git commit: NO-JIRA: Bump Qpid JMS Client dependency from 0.29.0 to 0.32.0

Posted by or...@apache.org.
NO-JIRA: Bump Qpid JMS Client dependency from 0.29.0 to 0.32.0


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/47270098
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/47270098
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/47270098

Branch: refs/heads/7.0.x
Commit: 47270098c99ba26226a553d1c015912b639e97ab
Parents: daf346e
Author: Alex Rudyy <or...@apache.org>
Authored: Thu Jun 7 14:07:36 2018 +0100
Committer: Alex Rudyy <or...@apache.org>
Committed: Thu Jun 7 14:07:36 2018 +0100

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/47270098/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 97f5625..673dd19 100644
--- a/pom.xml
+++ b/pom.xml
@@ -152,7 +152,7 @@
     <maven-core-version>3.5.0</maven-core-version>
     <maven-resolver-version>1.0.3</maven-resolver-version>
     <httpclient-version>4.5.3</httpclient-version>
-    <qpid-jms-client-version>0.29.0</qpid-jms-client-version>
+    <qpid-jms-client-version>0.32.0</qpid-jms-client-version>
     <qpid-jms-client-amqp-0-x-version>6.1.4</qpid-jms-client-amqp-0-x-version>
 
     <exec-maven-plugin-version>1.3.2</exec-maven-plugin-version>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org