You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2009/01/27 15:58:47 UTC

svn commit: r738107 - in /qpid/trunk/qpid/cpp/src: cluster.mk qpid/cluster/Cluster.cpp qpid/cluster/Connection.cpp qpid/cluster/Event.cpp qpid/cluster/EventFrame.cpp qpid/cluster/EventFrame.h

Author: aconway
Date: Tue Jan 27 14:58:47 2009
New Revision: 738107

URL: http://svn.apache.org/viewvc?rev=738107&view=rev
Log:
cluster/EventFrame.cpp: Add operator<<  for EventFrame

Added:
    qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.cpp   (with props)
Modified:
    qpid/trunk/qpid/cpp/src/cluster.mk
    qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Event.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.h

Modified: qpid/trunk/qpid/cpp/src/cluster.mk
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/cluster.mk?rev=738107&r1=738106&r2=738107&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/cluster.mk (original)
+++ qpid/trunk/qpid/cpp/src/cluster.mk Tue Jan 27 14:58:47 2009
@@ -57,6 +57,7 @@
   qpid/cluster/Event.cpp			\
   qpid/cluster/Event.h				\
   qpid/cluster/EventFrame.h			\
+  qpid/cluster/EventFrame.cpp			\
   qpid/cluster/FailoverExchange.cpp		\
   qpid/cluster/FailoverExchange.h		\
   qpid/cluster/Multicaster.cpp			\

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=738107&r1=738106&r2=738107&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Tue Jan 27 14:58:47 2009
@@ -234,12 +234,12 @@
 }
 
 void Cluster::deliveredFrame(const EventFrame& e) {
+    QPID_LOG(trace, *this << " DLVR: " << e);
     QPID_LATENCY_RECORD("delivered frame queue", e.frame);
-    if (e.connection)   {
+    if (e.connection) {
         e.connection->deliveredFrame(e);
     }
     else {
-        QPID_LOG(trace, *this << " DLVR: " << e.frame);
         Mutex::ScopedLock l(lock); // FIXME aconway 2008-12-11: lock scope too big?
         ClusterDispatcher dispatch(*this, e.member, l);
         if (!framing::invoke(dispatch, *e.frame.getBody()).wasHandled())

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp?rev=738107&r1=738106&r2=738107&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp Tue Jan 27 14:58:47 2009
@@ -155,7 +155,6 @@
 
 // Delivered from cluster.
 void Connection::deliveredFrame(const EventFrame& f) {
-    QPID_LOG(trace, cluster << " DLVR: " << *this << ": " << f.frame);
     assert(!catchUp);
     currentChannel = f.frame.getChannel(); 
     if (!framing::invoke(*this, *f.frame.getBody()).wasHandled() // Connection contol.

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Event.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Event.cpp?rev=738107&r1=738106&r2=738107&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Event.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Event.cpp Tue Jan 27 14:58:47 2009
@@ -111,7 +111,7 @@
 static const char* EVENT_TYPE_NAMES[] = { "data", "control" };
 
 std::ostream& operator << (std::ostream& o, const EventHeader& e) {
-    o << "[event " << e.getConnectionId() 
+    o << "[event " << e.getConnectionId()  << "/" << e.getSequence()
       << " " << EVENT_TYPE_NAMES[e.getType()]
       << " " << e.getSize() << " bytes]";
     return o;

Added: qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.cpp?rev=738107&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.cpp (added)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.cpp Tue Jan 27 14:58:47 2009
@@ -0,0 +1,46 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+#include "EventFrame.h"
+#include "Connection.h"
+
+namespace qpid {
+namespace cluster {
+
+EventFrame::EventFrame() : sequence(0) {}
+
+EventFrame::EventFrame(
+    const boost::intrusive_ptr<Connection>& c, const Event& e,
+    const framing::AMQFrame& f, int rc
+) : connection(c), member(e.getMemberId()), frame(f),
+    sequence(e.getSequence()), readCredit(rc)
+{
+    QPID_LATENCY_INIT(frame);
+}
+
+std::ostream& operator<<(std::ostream& o, const EventFrame& e) {
+    if (e.connection)
+        o << e.connection->getId();
+    else
+        o << e.member;
+    return o  << "/" << e.sequence << " " << e.frame << " rc=" << e.readCredit;
+}
+
+}} // namespace qpid::cluster

Propchange: qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.h?rev=738107&r1=738106&r2=738107&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/EventFrame.h Tue Jan 27 14:58:47 2009
@@ -27,6 +27,7 @@
 #include "qpid/framing/AMQFrame.h"
 #include "qpid/sys/LatencyMetric.h"
 #include <boost/intrusive_ptr.hpp>
+#include <iosfwd>
 
 namespace qpid {
 namespace cluster {
@@ -38,13 +39,10 @@
  */
 struct EventFrame
 {
-    EventFrame() : sequence(0) {}
-    // Connection event frame
-    EventFrame(const boost::intrusive_ptr<Connection>& c, const Event& e, const framing::AMQFrame& f, int rc=0)
-        : connection(c), member(e.getMemberId()), frame(f), sequence(e.getSequence()), readCredit(rc)
-    {
-        QPID_LATENCY_INIT(frame);
-    }
+    EventFrame();
+
+    EventFrame(const boost::intrusive_ptr<Connection>& c, const Event& e,
+               const framing::AMQFrame& f, int rc=0);
 
     bool isCluster() const { return !connection; }
     bool isConnection() const { return connection; }
@@ -63,6 +61,9 @@
     uint64_t sequence;
     int readCredit;             // last frame in an event, give credit when processed.
 };
+
+std::ostream& operator<<(std::ostream& o, const EventFrame& e);
+
 }} // namespace qpid::cluster
 
 #endif  /*!QPID_CLUSTER_EVENTFRAME_H*/



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org