qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1767331 - in /qpid/java/branches/6.1.x: ./ bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/ broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/main/java/org/apache/qpid/server/virtualhost/ broker-c...
Date Mon, 31 Oct 2016 17:09:42 GMT
Author: orudyy
Date: Mon Oct 31 17:09:42 2016
New Revision: 1767331

URL: http://svn.apache.org/viewvc?rev=1767331&view=rev
Log:
QPID-7474 : Only virtual hosts capable of processing messages should implement StatisticsGatherer

merged from trunk with:
svn merge -c 1766796  ^/qpid/java/trunk

Modified:
    qpid/java/branches/6.1.x/   (props changed)
    qpid/java/branches/6.1.x/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java
    qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
    qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
    qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
    qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java

Propchange: qpid/java/branches/6.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Oct 31 17:09:42 2016
@@ -9,5 +9,5 @@
 /qpid/branches/java-broker-vhost-refactor/java:1493674-1494547
 /qpid/branches/java-network-refactor/qpid/java:805429-821809
 /qpid/branches/qpid-2935/qpid/java:1061302-1072333
-/qpid/java/trunk:1766797,1766806,1767251,1767267-1767268,1767275,1767310
+/qpid/java/trunk:1766796-1766797,1766806,1767251,1767267-1767268,1767275,1767310
 /qpid/trunk/qpid:796646-796653

Modified: qpid/java/branches/6.1.x/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/branches/6.1.x/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java?rev=1767331&r1=1767330&r2=1767331&view=diff
==============================================================================
--- qpid/java/branches/6.1.x/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java
(original)
+++ qpid/java/branches/6.1.x/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHostImpl.java
Mon Oct 31 17:09:42 2016
@@ -50,7 +50,6 @@ import org.apache.qpid.server.model.Virt
 import org.apache.qpid.server.model.port.AmqpPort;
 import org.apache.qpid.server.model.preferences.UserPreferences;
 import org.apache.qpid.server.protocol.LinkRegistry;
-import org.apache.qpid.server.stats.StatisticsCounter;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.transport.AMQPConnection;
@@ -66,7 +65,6 @@ import org.apache.qpid.server.virtualhos
 @ManagedObject( category = false, type = "BDB_HA_REPLICA", register = false )
 public class BDBHAReplicaVirtualHostImpl extends AbstractConfiguredObject<BDBHAReplicaVirtualHostImpl>
implements BDBHAReplicaVirtualHost<BDBHAReplicaVirtualHostImpl>
 {
-    private final StatisticsCounter _messagesDelivered, _dataDelivered, _messagesReceived,
_dataReceived;
     private final Broker<?> _broker;
     private final VirtualHostPrincipal _principal;
 
@@ -114,10 +112,6 @@ public class BDBHAReplicaVirtualHostImpl
         super(parentsMap(virtualHostNode), attributes);
 
         _broker = virtualHostNode.getParent(Broker.class);
-        _messagesDelivered = new StatisticsCounter("messages-delivered-" + getName());
-        _dataDelivered = new StatisticsCounter("bytes-delivered-" + getName());
-        _messagesReceived = new StatisticsCounter("messages-received-" + getName());
-        _dataReceived = new StatisticsCounter("bytes-received-" + getName());
         _principal = new VirtualHostPrincipal(this);
         setState(State.UNAVAILABLE);
     }
@@ -409,47 +403,6 @@ public class BDBHAReplicaVirtualHostImpl
     }
 
     @Override
-    public void registerMessageReceived(final long messageSize, final long timestamp)
-    {
-        throwUnsupportedForReplica();
-    }
-
-    @Override
-    public void registerMessageDelivered(final long messageSize)
-    {
-        throwUnsupportedForReplica();
-    }
-
-    @Override
-    public StatisticsCounter getMessageDeliveryStatistics()
-    {
-        return _messagesDelivered;
-    }
-
-    @Override
-    public StatisticsCounter getMessageReceiptStatistics()
-    {
-        return _messagesReceived;
-    }
-
-    @Override
-    public StatisticsCounter getDataDeliveryStatistics()
-    {
-        return _dataDelivered;
-    }
-
-    @Override
-    public StatisticsCounter getDataReceiptStatistics()
-    {
-        return _dataReceived;
-    }
-
-    @Override
-    public void resetStatistics()
-    {
-    }
-
-    @Override
     public boolean authoriseCreateConnection(final AMQPConnection<?> connection)
     {
         return false;

Modified: qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java?rev=1767331&r1=1767330&r2=1767331&view=diff
==============================================================================
--- qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
(original)
+++ qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
Mon Oct 31 17:09:42 2016
@@ -847,9 +847,9 @@ public class BrokerImpl extends Abstract
         for (VirtualHostNode<?> virtualHostNode : getChildren(VirtualHostNode.class))
         {
             VirtualHost<?> virtualHost = virtualHostNode.getVirtualHost();
-            if (virtualHost != null)
+            if (virtualHost instanceof StatisticsGatherer)
             {
-                virtualHost.resetStatistics();
+                ((StatisticsGatherer)virtualHost).resetStatistics();
             }
         }
     }
@@ -897,13 +897,14 @@ public class BrokerImpl extends Abstract
                 for (VirtualHostNode<?> virtualHostNode : getChildren(VirtualHostNode.class))
                 {
                     VirtualHost<?> virtualHost = virtualHostNode.getVirtualHost();
-                    if (virtualHost != null)
+                    if (virtualHost instanceof StatisticsGatherer)
                     {
+                        StatisticsGatherer statGatherer = (StatisticsGatherer) virtualHost;
                         String name = virtualHost.getName();
-                        StatisticsCounter dataDelivered = virtualHost.getDataDeliveryStatistics();
-                        StatisticsCounter messagesDelivered = virtualHost.getMessageDeliveryStatistics();
-                        StatisticsCounter dataReceived = virtualHost.getDataReceiptStatistics();
-                        StatisticsCounter messagesReceived = virtualHost.getMessageReceiptStatistics();
+                        StatisticsCounter dataDelivered = statGatherer.getDataDeliveryStatistics();
+                        StatisticsCounter messagesDelivered = statGatherer.getMessageDeliveryStatistics();
+                        StatisticsCounter dataReceived = statGatherer.getDataReceiptStatistics();
+                        StatisticsCounter messagesReceived = statGatherer.getMessageReceiptStatistics();
                         EventLogger logger = virtualHost.getEventLogger();
                         logger.message(VirtualHostMessages.STATS_DATA(name,
                                                                       DELIVERED,

Modified: qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java?rev=1767331&r1=1767330&r2=1767331&view=diff
==============================================================================
--- qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
(original)
+++ qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
Mon Oct 31 17:09:42 2016
@@ -33,7 +33,6 @@ import java.util.concurrent.ScheduledFut
 import org.apache.qpid.server.logging.EventLoggerProvider;
 import org.apache.qpid.server.message.MessageDestination;
 import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.stats.StatisticsGatherer;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.store.preferences.UserPreferencesCreator;
@@ -42,7 +41,7 @@ import org.apache.qpid.server.virtualhos
 import org.apache.qpid.server.virtualhost.NodeAutoCreationPolicy;
 
 @ManagedObject( defaultType = "ProvidedStore", description = VirtualHost.CLASS_DESCRIPTION)
-public interface VirtualHost<X extends VirtualHost<X>> extends ConfiguredObject<X>,
StatisticsGatherer,
+public interface VirtualHost<X extends VirtualHost<X>> extends ConfiguredObject<X>,
                                                                EventLoggerProvider, NamedAddressSpace,
                                                                UserPreferencesCreator
 {

Modified: qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java?rev=1767331&r1=1767330&r2=1767331&view=diff
==============================================================================
--- qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
(original)
+++ qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
Mon Oct 31 17:09:42 2016
@@ -111,6 +111,7 @@ import org.apache.qpid.server.security.S
 import org.apache.qpid.server.security.access.Operation;
 import org.apache.qpid.server.security.auth.AuthenticatedPrincipal;
 import org.apache.qpid.server.stats.StatisticsCounter;
+import org.apache.qpid.server.stats.StatisticsGatherer;
 import org.apache.qpid.server.store.ConfiguredObjectRecord;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.Event;
@@ -144,7 +145,7 @@ import org.apache.qpid.server.util.House
 import org.apache.qpid.server.util.MapValueConverter;
 
 public abstract class AbstractVirtualHost<X extends AbstractVirtualHost<X>> extends
AbstractConfiguredObject<X>
-        implements VirtualHost<X>, EventListener
+        implements VirtualHost<X>, EventListener, StatisticsGatherer
 {
     private final Collection<ConnectionValidator> _connectionValidators = new ArrayList<>();
 

Modified: qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java?rev=1767331&r1=1767330&r2=1767331&view=diff
==============================================================================
--- qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
(original)
+++ qpid/java/branches/6.1.x/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/RedirectingVirtualHostImpl.java
Mon Oct 31 17:09:42 2016
@@ -52,7 +52,6 @@ import org.apache.qpid.server.model.Virt
 import org.apache.qpid.server.model.port.AmqpPort;
 import org.apache.qpid.server.model.preferences.UserPreferences;
 import org.apache.qpid.server.protocol.LinkRegistry;
-import org.apache.qpid.server.stats.StatisticsCounter;
 import org.apache.qpid.server.store.DurableConfigurationStore;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.transport.AMQPConnection;
@@ -69,7 +68,6 @@ class RedirectingVirtualHostImpl
 {
     public static final String VIRTUAL_HOST_TYPE = "REDIRECTOR";
 
-    private final StatisticsCounter _messagesDelivered, _dataDelivered, _messagesReceived,
_dataReceived;
     private final Broker<?> _broker;
     private final VirtualHostPrincipal _principal;
 
@@ -117,10 +115,6 @@ class RedirectingVirtualHostImpl
         super(parentsMap(virtualHostNode), attributes);
 
         _broker = virtualHostNode.getParent(Broker.class);
-        _messagesDelivered = new StatisticsCounter("messages-delivered-" + getName());
-        _dataDelivered = new StatisticsCounter("bytes-delivered-" + getName());
-        _messagesReceived = new StatisticsCounter("messages-received-" + getName());
-        _dataReceived = new StatisticsCounter("bytes-received-" + getName());
         _principal = new VirtualHostPrincipal(this);
         setState(State.UNAVAILABLE);
     }
@@ -442,47 +436,6 @@ class RedirectingVirtualHostImpl
     }
 
     @Override
-    public void registerMessageReceived(final long messageSize, final long timestamp)
-    {
-        throwUnsupportedForRedirector();
-    }
-
-    @Override
-    public void registerMessageDelivered(final long messageSize)
-    {
-        throwUnsupportedForRedirector();
-    }
-
-    @Override
-    public StatisticsCounter getMessageDeliveryStatistics()
-    {
-        return _messagesDelivered;
-    }
-
-    @Override
-    public StatisticsCounter getMessageReceiptStatistics()
-    {
-        return _messagesReceived;
-    }
-
-    @Override
-    public StatisticsCounter getDataDeliveryStatistics()
-    {
-        return _dataDelivered;
-    }
-
-    @Override
-    public StatisticsCounter getDataReceiptStatistics()
-    {
-        return _dataReceived;
-    }
-
-    @Override
-    public void resetStatistics()
-    {
-    }
-
-    @Override
     public boolean authoriseCreateConnection(final AMQPConnection<?> connection)
     {
         return false;



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


Mime
View raw message