Date   

Loading bridges at runtime

Alessandro Bellina
 

Could someone please post a quick example on how to use/load payload
bridges at runtime?

The docs point to mama_loadPayloadBridge, however this function
doesn't seem to have a "WithPath" variant. As I understand it, the
payload bridge is just like a middleware bridge and could be loaded
dynamically too. It seems that Avis specifies its default, at first
glance it isn't clear to me how this is done. I read another message
around the release of documentation for payload bridges, I would be
interested in seeing this too.

Thank you,

Alessandro


Re: Loading bridges at runtime

Mike Schonberg <mschonberg@...>
 

-----Original Message-----
From: openmama-dev-bounces@... [mailto:openmama-
dev-bounces@...] On Behalf Of Alessandro Bellina
Sent: Saturday, December 17, 2011 3:12 PM
To: openmama-dev@...
Subject: [Openmama-dev] Loading bridges at runtime

Could someone please post a quick example on how to use/load payload
bridges at runtime?

The docs point to mama_loadPayloadBridge, however this function
doesn't seem to have a "WithPath" variant. As I understand it, the
payload bridge is just like a middleware bridge and could be loaded
dynamically too. It seems that Avis specifies its default, at first
glance it isn't clear to me how this is done. I read another message
around the release of documentation for payload bridges, I would be
interested in seeing this too.
I am working on the bridge developer's documentation, and I will post it to this list and the web site once it is complete.

When you load a middleware bridge, OpenMAMA will query the middleware bridge for a default payload bridge and load that automatically. This is for backwards compatibility, and new applications should explicitly load each payload that they use.

There is no "WithPath" variant for payloads. The mama_loadXXXBridge functions call dlopen() which searches the LD_LIBRARY_PATH for the shared object. If your payload bridge .so is in the LD_LIBRARY_PATH, mama_loadPayloadBridge() should find it.

Regards,
-Mike

Thank you,

Alessandro
_______________________________________________
Openmama-dev mailing list
Openmama-dev@...
http://lists.openmama.org/listinfo/openmama-dev
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com

****************************************************

Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.


Questions about rodmap & bridge creation

Benjamin Taieb
 

Hi,

I'm working for a hardware based MOM vendor (Solace Systems) and we are thinking about developing a mw bridge for openMama.

I've some questions :

 

1)When I look at http://www.openmama.org/what-is-openmama/openmama-roadmaps, C++ wrapper and MAMDA C++ should be released by now.

Do you have any update you can share on the roadmap ?

 

2) As previously mentioned on this list, there is no documentation at the moment regarding building a middleware bridge. From my reading of the avis example, below is my understanding, Mike, could you please comment ?

 -A MW bridge implement all the stuff defined in the mamaBridgeImpl structure, for example if the implIdentifier is sol,

bridgeOpen of the mamaBridgeImpl struct is a pointer to solBridge_open function...

 

-The signature of each function is given in bridge.h as well. For example :

typedef mama_status (*bridgeMamaIo_create)(ioBridge*    result,

                                           void*        nativeQueueHandle,

                                           uint32_t     descriptor,

                                           mamaIoCb     action,

                                           mamaIoType   ioType,

                                           mamaIo       parent,

                                           void*        closure);

 

is implemented in  io.c of the avis bridge :

 

mama_status

avisBridgeMamaIo_create(ioBridge*  result,

                         void*      nativeQueueHandle,

                         uint32_t   descriptor,

                         mamaIoCb   action,

                         mamaIoType ioType,

                         mamaIo     parent,

                         void*      closure)

{

    *result = 0;

    return MAMA_STATUS_NOT_IMPLEMENTED;

}

 

Thanks,

 

Benjamin Taieb.

Senior Systems Engineer - EMEA

9 Devonshire Square

London, EC2M 4YF

+44 203 178 5579 (w)

+44 793 995 6731 (m)

www.solacesystems.com

 


Re: Questions about rodmap & bridge creation

Mike Schonberg <mschonberg@...>
 

Benjamin,

See my answers inline.

-----Original Message-----
From: openmama-dev-bounces@... [mailto:openmama-dev-
bounces@...] On Behalf Of Benjamin Taieb
Sent: Monday, January 09, 2012 8:29 AM
To: openmama-dev@...
Subject: [Openmama-dev] Questions about rodmap & bridge creation

Hi,

I'm working for a hardware based MOM vendor (Solace Systems) and we are
thinking about developing a mw bridge for openMama.

I've some questions :



1)When I look at http://www.openmama.org/what-is-openmama/openmama-
roadmaps, C++ wrapper and MAMDA C++ should be released by now.

Do you have any update you can share on the roadmap ?
We are currently working on the C++ MAMA wrappers and MAMDA C++. Our intention is to have all of the components (MAMDA C++, MAMA C++, MAMA JNI, MAMDA JAVA, etc.) complete by April. MAMA C++ and MAMDA C++ will be the first to be completed. I can not commit to a specific date at this point, but I will send an update to the list when I can.




2) As previously mentioned on this list, there is no documentation at
the moment regarding building a middleware bridge. From my reading of
the avis example, below is my understanding, Mike, could you please
comment ?
I am working on the bridge documentation.


-A MW bridge implement all the stuff defined in the mamaBridgeImpl
structure, for example if the implIdentifier is sol,
This is correct. The mamaBridgeImpl structure contains all the methods required by MAMA for a fully functional bridge. Some middlewares may not support all of the functionality and return MAMA_STATUS_NOT_IMPLEMENTED. For example Avis does not implement the mama_bridgeMamaIO_create, method mentioned below because it does not have the ability to process IO events (read/write readiness on a file descriptor). In this case and some others, we may at some point add capabilities at the MAMA level for middlewares that do not support features natively.

The bridge documentation, when complete, will address which functions and capabilities are optional.

bridgeOpen of the mamaBridgeImpl struct is a pointer to solBridge_open
function...



-The signature of each function is given in bridge.h as well. For
example :

typedef mama_status (*bridgeMamaIo_create)(ioBridge* result,

void*
nativeQueueHandle,

uint32_t descriptor,

mamaIoCb action,

mamaIoType ioType,

mamaIo parent,

void* closure);



is implemented in io.c of the avis bridge :



mama_status

avisBridgeMamaIo_create(ioBridge* result,

void* nativeQueueHandle,

uint32_t descriptor,

mamaIoCb action,

mamaIoType ioType,

mamaIo parent,

void* closure)

{

*result = 0;

return MAMA_STATUS_NOT_IMPLEMENTED;

}



Thanks,



Benjamin Taieb.

Senior Systems Engineer - EMEA

9 Devonshire Square

London, EC2M 4YF

+44 203 178 5579 (w)

+44 793 995 6731 (m)

www.solacesystems.com <http://www.solacesystems.com/>

Regards,
-Mike

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com

****************************************************

Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.


Bridge API doc

alex.stovboun@...
 

Mike,
 
When do you plan to publish the first cut of the bridge API doc?
 
Regards,
Alex
 

PLEASE READ: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Nomura Holding America Inc., Nomura Securities International, Inc, and their respective subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state the views of such entity. Unless otherwise stated, any pricing information in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation.


Re: Bridge API doc

Mike Schonberg <mschonberg@...>
 

Alex,

I started working on the bridge documentation; however, at the moment we are very busy getting the remaining components of MAMA and MAMDA ready for open source: C++, Java, Windows support etc.

I plan to return to the bridge documentation as soon as I get some spare cycles. I will post a draft when I have some content worthy of review.

Is there a particular middleware or payload that interests you?

Regards,
-Mike

-----Original Message-----
From: openmama-dev-bounces@... [mailto:openmama-dev-
bounces@...] On Behalf Of alex.stovboun@...
Sent: Thursday, January 19, 2012 3:00 PM
To: openmama-dev@...
Subject: [Openmama-dev] Bridge API doc

Mike,

When do you plan to publish the first cut of the bridge API doc?

Regards,
Alex


PLEASE READ: This message is for the named person's use only. It may
contain confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please delete it and all copies
from your system, destroy any hard copies and notify the sender. You
must not, directly or indirectly, use, disclose, distribute, print, or
copy any part of this message if you are not the intended recipient.
Nomura Holding America Inc., Nomura Securities International, Inc, and
their respective subsidiaries each reserve the right to monitor all e-
mail communications through its networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorized to state the views of
such entity. Unless otherwise stated, any pricing information in this
message is indicative only, is subject to change and does not
constitute an offer to deal at any price quoted. Any reference to the
terms of executed transactions should be treated as preliminary only
and subject to our formal written confirmation.
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com

****************************************************

Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.


Re: Bridge API doc

alex.stovboun@...
 

Mike,

I am researching various middleware options. ZeroMQ looks promising. Any plans to implement a bridge for it? If yes, is there a timeline?
I am also looking into writing a bridge for our proprietary middleware.

If you could briefly describe the bridge interface functions (at least the most important ones) - that would already be a great starting point for anyone trying to write a bridge.

Regards,
Alex


PLEASE READ: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Nomura Holding America Inc., Nomura Securities International, Inc, and their respective subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state the views of such entity. Unless otherwise stated, any pricing information in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation.


Re: Bridge API doc

Daniel Cegiełka <daniel.cegielka@...>
 

Hi Alex,

2012/1/20 <alex.stovboun@...>
Mike,

I am researching various middleware options. ZeroMQ looks promising.

There is already an idea to add support for RDMA/IB in ZeroMQ - that would cut latency into 2-3 us.


 
Any plans to implement a bridge for it? If yes, is there a timeline?

I'm planning to get involved in the preparation of support for ZeroMQ and I hope that in future the ZeroMQ bridge will be a part of the MAMA. It would be very good if we could build for ZeroMQ active and stable support - especially look forward to working here with NYSE Technologies.

 
I am also looking into writing a bridge for our proprietary middleware.

If you could briefly describe the bridge interface functions (at least the most important ones) - that would already be a great starting point for anyone trying to write a bridge.

MAMA is based on the dlopen() function but it's very important to prepare bridge with a deep understanding of the messages, which is necessary for MAMDA:


There is also a lot of questions about how to prepare ZeroMQ bridge - using raw zmq C API (zmq.h) or maybe C++ (zmq.hpp) with MAMA C++ wrapper (not published yet by NYSE).. or C API with czmq?

best regards,
Daniel


 

Regards,
Alex


PLEASE READ: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Nomura Holding America Inc., Nomura Securities International, Inc, and their respective subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state the views of such entity. Unless otherwise stated, any pricing information in this message is indicative only, is subject to change and does not constitute an offer
 to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation.

_______________________________________________
Openmama-dev mailing list
Openmama-dev@...
http://lists.openmama.org/listinfo/openmama-dev


[PATCH 1.1] mamainternal.h: Added types.h to includes

John Gray <jgray@...>
 

Needed to include types.h to mamainternal.h to enable building

 

Index: c_cpp/src/c/mamainternal.h

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/mamainternal.h,v

retrieving revision 1.16.22.6

diff -u -r1.16.22.6 mamainternal.h

--- c_cpp/src/c/mamainternal.h  18 Aug 2011 10:54:08 -0000  1.16.22.6

+++ c_cpp/src/c/mamainternal.h  6 Jan 2012 21:21:27 -0000

@@ -23,6 +23,7 @@

#define MamaInternalH__

 

#include <property.h>

+#include "mama/types.h"

 

#if defined(__cplusplus)

extern "C"

 

Signed-off-by: John Gray <jgray@...>

 


[PATCH 1.1] Properties: Fixed Memory Leaks in Properties

John Gray <jgray@...>
 

Free memory and fail if realloc fails in propertiesImpl_addKey(). When we

replace a value in the hash table in propertiesImpl_addProperty(), free the old

value.

 

Index: c_cpp/src/c/property.c

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/property.c,v

retrieving revision 1.22.2.2.2.1.2.4

diff -u -r1.22.2.2.2.1.2.4 property.c

--- c_cpp/src/c/property.c  7 Sep 2011 09:45:08 -0000   1.22.2.2.2.1.2.4

+++ c_cpp/src/c/property.c  18 Jan 2012 02:56:09 -0000

@@ -326,7 +326,7 @@

    propertiesImpl_ *this = (propertiesImpl_ *)handle;

    const char*      rval = NULL;

 

-   if( name == NULL || strlen( name ) == 0 )

+   if( name == NULL || NULL == this || strlen( name ) == 0 )

    {

        return NULL;

    }

@@ -554,9 +554,19 @@

         }

         else

         {

-            this->mKeys = (const char* *)realloc(

-                (void* )this->mKeys,

-                allocSize * sizeof( const char* ) );

+            void* reallocBlock =

+                realloc((void* )this->mKeys, (allocSize * sizeof(const char*)));

+

+            if(NULL != reallocBlock)

+            {

+                this->mKeys = (const char**)reallocBlock;

+            }

+            else

+            {

+                free((void* )this->mKeys);

+                this->mKeys = NULL;

+                return 0;

+            }

         }

     }

 

@@ -571,28 +581,36 @@

                             const char* value )

{

     propertiesImpl_ *this = (propertiesImpl_*)properties;

+    void* data = NULL;

+    int ret = 0;

 

-    if( gPropertyDebug )

-    {

-        fprintf (stderr,

-                 "\nAddProperty KEY: %s, VALUE: %s\n",

-                 name,

-                 value);

-    }

+    if( NULL == this )

+        return 0;

 

-    if ( NULL == wtable_lookup( this->mTable, (char* )name ))

+    if ( NULL == (data = wtable_lookup(this->mTable, (char*)name)))

     {

         if( !propertiesImpl_AddKey( this, name ))

             return 0;

     }

 

-    if (-1==wtable_insert( this->mTable, (char* )name, (caddr_t)value ))

+    if(-1 == (ret = wtable_insert( this->mTable, (char* )name, (caddr_t)value)))

     {

         return 0;

     }

 

+    if(0 == ret) /* If 0 is returned then data has been replaced. */

+    {

+        /* If existing data in the table has now been replaced then the old data must be freed. */

+        if(NULL != data)

+        {

+            free(data);

+        }

+

+       if(gPropertyDebug)

+        {

+           fprintf(stderr, "\nAddProperty KEY: %s, VALUE: %s\n", name, value);

+       }

+    }

 

     return 1;

}

-

-

 

Signed-off-by: John Gray <jgray@...>


[PATCH 1.1] Windows Interlock: Function wInterlocked set to return 0

John Gray <jgray@...>
 

Function wInterlocked set to return 0 for windows.  Not an operation (no-op) in Unix.

 

Index: queue.c

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/queue.c,v

retrieving revision 1.35.4.5.2.1.4.11

diff -w -u -r1.35.4.5.2.1.4.11 queue.c

--- queue.c 27 Sep 2011 12:38:50 -0000  1.35.4.5.2.1.4.11

+++ queue.c 14 Jan 2012 09:41:43 -0000

@@ -198,6 +198,7 @@

     impl->mQueueMonitorClosure  =   NULL;

 

     /* Create the counter lock. */

+    wInterlocked_initialize(&impl->mNumberOpenObjects);

     wInterlocked_set(0, &impl->mNumberOpenObjects);

 

 

@@ -436,7 +437,7 @@

     int newCount = wInterlocked_decrement(&impl->mNumberOpenObjects);

 

     /* Write a log if something has gone wrong. */

-    if(impl->mNumberOpenObjects < 0)

+    if(newCount < 0)

     {

         mama_log(MAMA_LOG_LEVEL_ERROR, "Queue 0x%p has been dereferenced too many times.", queue);

     }

@@ -719,6 +720,9 @@

         impl->mMamaQueueBridgeImpl = NULL;

         impl->mMsg                 = NULL;

 

+        /* Destroy the counter lock */

+        wInterlocked_destroy(&impl->mNumberOpenObjects);

+

         free (impl);

 

         mama_log (MAMA_LOG_LEVEL_FINEST, "Leaving mamaQueue_destroy for queue 0x%X.", queue);

 

Signed-off-by: John Gray <jgray@...>

 


Recall: [PATCH 1.1] Windows Interlock: Function wInterlocked set to return 0

John Gray <jgray@...>
 

John Gray would like to recall the message, "[PATCH 1.1] Windows Interlock: Function wInterlocked set to return 0".


[PATCH 1.1] Windows Interlock: Function wInterlocked set to return 0

John Gray <jgray@...>
 

Function wInterlocked set to return 0 for windows.  Not an operation (no-op) in Unix.

 

Index: queue.c

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/queue.c,v

retrieving revision 1.35.4.5.2.1.4.11

diff -w -u -r1.35.4.5.2.1.4.11 queue.c

--- queue.c 27 Sep 2011 12:38:50 -0000  1.35.4.5.2.1.4.11

+++ queue.c 14 Jan 2012 09:41:43 -0000

@@ -198,6 +198,7 @@

     impl->mQueueMonitorClosure  =   NULL;

 

     /* Create the counter lock. */

+    wInterlocked_initialize(&impl->mNumberOpenObjects);

     wInterlocked_set(0, &impl->mNumberOpenObjects);

 

 

@@ -436,7 +437,7 @@

     int newCount = wInterlocked_decrement(&impl->mNumberOpenObjects);

 

     /* Write a log if something has gone wrong. */

-    if(impl->mNumberOpenObjects < 0)

+    if(newCount < 0)

     {

         mama_log(MAMA_LOG_LEVEL_ERROR, "Queue 0x%p has been dereferenced too many times.", queue);

     }

@@ -719,6 +720,9 @@

         impl->mMamaQueueBridgeImpl = NULL;

         impl->mMsg                 = NULL;

 

+        /* Destroy the counter lock */

+        wInterlocked_destroy(&impl->mNumberOpenObjects);

+

         free (impl);

 

         mama_log (MAMA_LOG_LEVEL_FINEST, "Leaving mamaQueue_destroy for queue 0x%X.", queue);

 

Signed-off-by: John Gray <jgray@...>

 


[PATCH 1.1] Hash rename: Renamed hash functions to whash

John Gray <jgray@...>
 

This avoid potential namespace conflicts as the hash functions are now used

outside of common.

 

Index: c_cpp/src/c/lookup2.c

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/lookup2.c,v

retrieving revision 1.2.34.3

diff -u -r1.2.34.3 lookup2.c

--- c_cpp/src/c/lookup2.c   10 Aug 2011 13:06:52 -0000  1.2.34.3

+++ c_cpp/src/c/lookup2.c   17 Jan 2012 22:58:16 -0000

@@ -96,7 +96,7 @@

--------------------------------------------------------------------

*/

 

-ub4 hash( k, length, initval)

+ub4 whash( k, length, initval)

register ub1 *k;        /* the key */

register ub4  length;   /* the length of the key */

register ub4  initval;    /* the previous hash, or an arbitrary value */

@@ -151,7 +151,7 @@

  -- that the length be the number of ub4's in the key

--------------------------------------------------------------------

*/

-ub4 hash2( k, length, initval)

+ub4 whash2( k, length, initval)

register ub4 *k;        /* the key */

register ub4  length;   /* the length of the key */

register ub4  initval;    /* the previous hash, or an arbitrary value */

@@ -196,7 +196,7 @@

--------------------------------------------------------------------

*/

 

-ub4 hash3( k, length, initval)

+ub4 whash3( k, length, initval)

register ub1 *k;        /* the key */

register ub4  length;   /* the length of the key */

register ub4  initval;    /* the previous hash, or an arbitrary value */

@@ -268,7 +268,7 @@

 

   for (i=0; i<256; ++i)

   {

-    h = hash(buf,i,h);

+    h = whash(buf,i,h);

   }

}

 

@@ -306,10 +306,10 @@

         /* have a and b be two keys differing in only one bit */

         a[i] ^= (k<<j);

         a[i] ^= (k>>(8-j));

-         c[0] = hash(a, hlen, m);

+         c[0] = whash(a, hlen, m);

         b[i] ^= ((k+1)<<j);

         b[i] ^= ((k+1)>>(8-j));

-         d[0] = hash(b, hlen, m);

+         d[0] = whash(b, hlen, m);

         /* check every bit is 1, 0, set, and not set at least once */

         for (l=0; l<HASHSTATE; ++l)

         {

@@ -357,10 +357,10 @@

   ub4 h,i,j,ref,x,y;

 

   printf("Endianness.  These should all be the same:\n");

-  printf("%.8lx\n", hash(q, sizeof(q)-1, (ub4)0));

-  printf("%.8lx\n", hash(qq+1, sizeof(q)-1, (ub4)0));

-  printf("%.8lx\n", hash(qqq+2, sizeof(q)-1, (ub4)0));

-  printf("%.8lx\n", hash(qqqq+3, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(q, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(qq+1, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(qqq+2, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(qqqq+3, sizeof(q)-1, (ub4)0));

   printf("\n");

   for (h=0, b=buf+1; h<8; ++h, ++b)

   {

@@ -370,11 +370,11 @@

       for (j=0; j<i; ++j) *(b+j)=0;

 

       /* these should all be equal */

-      ref = hash(b, len, (ub4)1);

+      ref = whash(b, len, (ub4)1);

       *(b+i)=(ub1)~0;

       *(b-1)=(ub1)~0;

-      x = hash(b, len, (ub4)1);

-      y = hash(b, len, (ub4)1);

+      x = whash(b, len, (ub4)1);

+      y = whash(b, len, (ub4)1);

       if ((ref != x) || (ref != y))

       {

     printf("alignment error: %.8lx %.8lx %.8lx %ld %ld\n",ref,x,y,h,i);

@@ -395,7 +395,7 @@

   printf("These should all be different\n");

   for (i=0, h=0; i<8; ++i)

   {

-    h = hash(buf, (ub4)0, h);

+    h = whash(buf, (ub4)0, h);

     printf("%2ld  0-byte strings, hash is  %.8lx\n", i, h);

   }

}

Index: c_cpp/src/c/lookup2.h

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/lookup2.h,v

retrieving revision 1.1.34.2

diff -u -r1.1.34.2 lookup2.h

--- c_cpp/src/c/lookup2.h   10 Aug 2011 13:06:53 -0000  1.1.34.2

+++ c_cpp/src/c/lookup2.h   17 Jan 2012 22:58:16 -0000

@@ -13,6 +13,6 @@

#define hashsize(n) ((ub4)1<<(n))

#define hashmask(n) (hashsize(n)-1)

 

-ub4 hash (ub1 *k, ub4 length, ub4 initval);

+ub4 whash (ub1 *k, ub4 length, ub4 initval);

 

#endif  /* _LOOKUP2_H_ */

Index: c_cpp/src/c/wtable.c

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/wtable.c,v

retrieving revision 1.12.10.2.12.4

diff -u -r1.12.10.2.12.4 wtable.c

--- c_cpp/src/c/wtable.c    7 Sep 2011 09:45:08 -0000   1.12.10.2.12.4

+++ c_cpp/src/c/wtable.c    17 Jan 2012 22:58:16 -0000

@@ -236,7 +236,7 @@

         }

 

         len = strlen(key);

-        h = hash((unsigned char *)key, len, HASH_INITVAL);

+        h = whash((unsigned char *)key, len, HASH_INITVAL);

         h = (h & hashmask(wtable->size));

         if (wtable_debug)

         {

@@ -310,7 +310,7 @@

         }

 

         len = strlen(key);

-        h = hash((unsigned char *)key, len, HASH_INITVAL);

+        h = whash((unsigned char *)key, len, HASH_INITVAL);

         h = (h & hashmask(wtable->size));

         if (wtable_debug)

         {

@@ -380,7 +380,7 @@

         }

 

         len = strlen(key);

-        h = hash((unsigned char *)key, len, HASH_INITVAL);

+        h = whash((unsigned char *)key, len, HASH_INITVAL);

         h = (h & hashmask(wtable->size));

         if (wtable_debug)

         {

 

Signed-off-by: John Gray <jgray@...>

 


Recall: [PATCH 1.1] Hash rename: Renamed hash functions to whash

John Gray <jgray@...>
 

John Gray would like to recall the message, "[PATCH 1.1] Hash rename: Renamed hash functions to whash".


[PATCH 1.1] Hash rename: Renamed hash functions to whash

John Gray <jgray@...>
 

This avoid potential namespace conflicts as the hash functions are now used

outside of common.

 

Index: c_cpp/src/c/lookup2.c

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/lookup2.c,v

retrieving revision 1.2.34.3

diff -u -r1.2.34.3 lookup2.c

--- c_cpp/src/c/lookup2.c   10 Aug 2011 13:06:52 -0000  1.2.34.3

+++ c_cpp/src/c/lookup2.c   17 Jan 2012 22:58:16 -0000

@@ -96,7 +96,7 @@

--------------------------------------------------------------------

*/

 

-ub4 hash( k, length, initval)

+ub4 whash( k, length, initval)

register ub1 *k;        /* the key */

register ub4  length;   /* the length of the key */

register ub4  initval;    /* the previous hash, or an arbitrary value */

@@ -151,7 +151,7 @@

  -- that the length be the number of ub4's in the key

--------------------------------------------------------------------

*/

-ub4 hash2( k, length, initval)

+ub4 whash2( k, length, initval)

register ub4 *k;        /* the key */

register ub4  length;   /* the length of the key */

register ub4  initval;    /* the previous hash, or an arbitrary value */

@@ -196,7 +196,7 @@

--------------------------------------------------------------------

*/

 

-ub4 hash3( k, length, initval)

+ub4 whash3( k, length, initval)

register ub1 *k;        /* the key */

register ub4  length;   /* the length of the key */

register ub4  initval;    /* the previous hash, or an arbitrary value */

@@ -268,7 +268,7 @@

 

   for (i=0; i<256; ++i)

   {

-    h = hash(buf,i,h);

+    h = whash(buf,i,h);

   }

}

 

@@ -306,10 +306,10 @@

         /* have a and b be two keys differing in only one bit */

         a[i] ^= (k<<j);

         a[i] ^= (k>>(8-j));

-         c[0] = hash(a, hlen, m);

+         c[0] = whash(a, hlen, m);

         b[i] ^= ((k+1)<<j);

         b[i] ^= ((k+1)>>(8-j));

-         d[0] = hash(b, hlen, m);

+         d[0] = whash(b, hlen, m);

         /* check every bit is 1, 0, set, and not set at least once */

         for (l=0; l<HASHSTATE; ++l)

         {

@@ -357,10 +357,10 @@

   ub4 h,i,j,ref,x,y;

 

   printf("Endianness.  These should all be the same:\n");

-  printf("%.8lx\n", hash(q, sizeof(q)-1, (ub4)0));

-  printf("%.8lx\n", hash(qq+1, sizeof(q)-1, (ub4)0));

-  printf("%.8lx\n", hash(qqq+2, sizeof(q)-1, (ub4)0));

-  printf("%.8lx\n", hash(qqqq+3, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(q, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(qq+1, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(qqq+2, sizeof(q)-1, (ub4)0));

+  printf("%.8lx\n", whash(qqqq+3, sizeof(q)-1, (ub4)0));

   printf("\n");

   for (h=0, b=buf+1; h<8; ++h, ++b)

   {

@@ -370,11 +370,11 @@

       for (j=0; j<i; ++j) *(b+j)=0;

 

       /* these should all be equal */

-      ref = hash(b, len, (ub4)1);

+      ref = whash(b, len, (ub4)1);

       *(b+i)=(ub1)~0;

       *(b-1)=(ub1)~0;

-      x = hash(b, len, (ub4)1);

-      y = hash(b, len, (ub4)1);

+      x = whash(b, len, (ub4)1);

+      y = whash(b, len, (ub4)1);

       if ((ref != x) || (ref != y))

       {

     printf("alignment error: %.8lx %.8lx %.8lx %ld %ld\n",ref,x,y,h,i);

@@ -395,7 +395,7 @@

   printf("These should all be different\n");

   for (i=0, h=0; i<8; ++i)

   {

-    h = hash(buf, (ub4)0, h);

+    h = whash(buf, (ub4)0, h);

     printf("%2ld  0-byte strings, hash is  %.8lx\n", i, h);

   }

}

Index: c_cpp/src/c/lookup2.h

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/lookup2.h,v

retrieving revision 1.1.34.2

diff -u -r1.1.34.2 lookup2.h

--- c_cpp/src/c/lookup2.h   10 Aug 2011 13:06:53 -0000  1.1.34.2

+++ c_cpp/src/c/lookup2.h   17 Jan 2012 22:58:16 -0000

@@ -13,6 +13,6 @@

#define hashsize(n) ((ub4)1<<(n))

#define hashmask(n) (hashsize(n)-1)

 

-ub4 hash (ub1 *k, ub4 length, ub4 initval);

+ub4 whash (ub1 *k, ub4 length, ub4 initval);

 

#endif  /* _LOOKUP2_H_ */

Index: c_cpp/src/c/wtable.c

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/wtable.c,v

retrieving revision 1.12.10.2.12.4

diff -u -r1.12.10.2.12.4 wtable.c

--- c_cpp/src/c/wtable.c    7 Sep 2011 09:45:08 -0000   1.12.10.2.12.4

+++ c_cpp/src/c/wtable.c    17 Jan 2012 22:58:16 -0000

@@ -236,7 +236,7 @@

         }

 

         len = strlen(key);

-        h = hash((unsigned char *)key, len, HASH_INITVAL);

+        h = whash((unsigned char *)key, len, HASH_INITVAL);

         h = (h & hashmask(wtable->size));

         if (wtable_debug)

         {

@@ -310,7 +310,7 @@

         }

 

         len = strlen(key);

-        h = hash((unsigned char *)key, len, HASH_INITVAL);

+        h = whash((unsigned char *)key, len, HASH_INITVAL);

         h = (h & hashmask(wtable->size));

         if (wtable_debug)

         {

@@ -380,7 +380,7 @@

         }

 

         len = strlen(key);

-        h = hash((unsigned char *)key, len, HASH_INITVAL);

+        h = whash((unsigned char *)key, len, HASH_INITVAL);

         h = (h & hashmask(wtable->size));

         if (wtable_debug)

         {

 

Signed-off-by: John Gray <jgray@...>

 


RabbitMQ bridge

Leslie Spiro <lspiro@...>
 

DOT are considering producing an OpenMama bridge using RabbitMQ, which we would then donate to OpenMama. This would provide a solid, well supported and fully open source option to the current product mix.

We are interested in whether any people here think they might be interested in this RabbitMQ bridge should we undertake the project ?

Leslie Spiro
DOT


[PATCH 1.1] Interlock declaration: Required for applying common_3 patch

John Gray <jgray@...>
 

This must be applied with the common_3 file as it contains the Interlocked_destroy function declaration.

 

 

Index: common/c_cpp/src/c/wombat/wInterlocked.h

===================================================================

RCS file: /cvsroot/products/common/c_cpp/src/c/wombat/Attic/wInterlocked.h,v

retrieving revision 1.1.2.6.8.5

diff -c -p -r1.1.2.6.8.5 wInterlocked.h

*** common/c_cpp/src/c/wombat/wInterlocked.h       17 Jan 2012 13:48:53 -0000            1.1.2.6.8.5

--- common/c_cpp/src/c/wombat/wInterlocked.h          26 Jan 2012 17:24:48 -0000

*************** adec32 (uint32_t* ptr)

*** 69,74 ****

--- 69,97 ----

  typedef uint32_t wInterlockedInt;

 

  /**

+  * This function will initialise a wInterlockedInt.

+  *

+  * @param[in] value Pointer to the item to be initialized.

+  * @return 0 on success.

+  */

+

+ WCOMMONINLINE int wInterlocked_initialize(wInterlockedInt *value)

+ {

+     return 0;

+ }

+

+ /**

+  * This function will destroy a wInterlockedInt.

+  *

+  * @param[in] value Pointer to the item to be destroyed.

+  * @return 0 on success.

+  */

+ WCOMMONINLINE int wInterlocked_destroy(wInterlockedInt *value)

+ {

+     return 0;

+ }

+

+ /**

   * This function will atomically decrement a 32-bit integer value.

   *

   * @param[in] value Pointer to the value to be decremented.

 

 

Signed-off-by: John Gray <jgray@...>


[PATCH 1.1] transport.c: Add mamaTransport_disableRefresh() Method

John Gray <jgray@...>
 

Add mamaTransport_disableRefresh() Method

 

Added method to disable refreshes for a transport. This method must be called

after mamaTransport_allocate() but before mamaTransport_create(). If invoked

with a non-zero argument the transport will not send refresh messages.

 

Index: c_cpp/src/c/transport.c

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/transport.c,v

retrieving revision 1.79.4.6.2.2.2.8

diff -u -r1.79.4.6.2.2.2.8 transport.c

--- c_cpp/src/c/transport.c          2 Oct 2011 19:02:17 -0000              1.79.4.6.2.2.2.8

+++ c_cpp/src/c/transport.c       27 Dec 2011 20:44:15 -0000

@@ -161,6 +161,7 @@

     int                     mGroupSizeHint;

     uint8_t                 mDisableDisconnectCb;

+    uint8_t                                                                           mDisableRefresh;

     preInitialScheme         mPreInitialScheme;

} transportImpl;

@@ -369,14 +370,18 @@

  *

  * Return non-zero to disable refresh messages.

  */

-static int mamaTransportInternal_disableRefreshes (const char* transportName)

+void mamaTransport_disableRefresh(mamaTransport transport, uint8_t disable)

+{

+    self->mDisableRefresh=disable;

+}

+

+static int mamaTransportInternal_disableRefreshes(const char* transportName)

{

   const char* propValue;

   char propString[MAX_PROP_STRING];

   int retVal;

-  retVal=snprintf (propString, MAX_PROP_STRING,

-    "mama.transport.%s.%s",

+  retVal=snprintf(propString, MAX_PROP_STRING, "mama.transport.%s.%s",

     transportName ? transportName : "", PROP_NAME_DISABLE_REFRESH);

   if ((retVal<0) || (retVal>=MAX_PROP_STRING))

@@ -759,8 +764,7 @@

                 name);

     }

-

-    if (!mamaTransportInternal_disableRefreshes (name))

+    if ((!self->mDisableRefresh) && (!mamaTransportInternal_disableRefreshes(name)))

     {

         return refreshTransport_create (&self->mRefreshTransport,

                                     (mamaTransport)self,

Index: c_cpp/src/c/mama/transport.h

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/mama/transport.h,v

retrieving revision 1.34.4.2.4.1.2.3

diff -u -r1.34.4.2.4.1.2.3 transport.h

--- c_cpp/src/c/mama/transport.h           10 Aug 2011 14:53:28 -0000          1.34.4.2.4.1.2.3

+++ c_cpp/src/c/mama/transport.h        27 Dec 2011 20:44:15 -0000

@@ -291,6 +291,17 @@

                                    double *result);

 /**

+ * Disable Refreshing.

+ *

+ * @param transport the transport instance

+ * @param disable t/f.

+ */

+MAMAExpDLL

+extern void

+mamaTransport_disableRefresh (mamaTransport transport,

+                                                                                                                             uint8_t disable);

+

+/**

  * Set the throttle rate.

  *

  * @param transport the transport.

 

Signed-off-by: John Gray <jgray@...>


[PATCH 1.1] status.c: Added MAMA_STATUS_SUBSCRIPTION_GAP

John Gray <jgray@...>
 

Added MAMA_STATUS_SUBSCRIPTION_GAP

 

Middleware bridges pass this status to the mamaSubscription onError callback

when the middleware detects a gap:

 

    mamaSubscription_getUserCallbacks(sub)->onError(...)

 

Middlewares that do not detect dropped messages will not use this status.

 

Note that this callback is independent of the sequence number gap detection

implemented by dqpublisher and dqstrategy.

 

Index: c_cpp/src/c/status.c

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/status.c,v

retrieving revision 1.18.4.3.2.1.4.5

diff -u -r1.18.4.3.2.1.4.5 status.c

--- c_cpp/src/c/status.c 29 Aug 2011 11:52:44 -0000          1.18.4.3.2.1.4.5

+++ c_cpp/src/c/status.c              28 Dec 2011 17:47:07 -0000

@@ -61,7 +61,8 @@

     case MAMA_STATUS_SUBSCRIPTION_INVALID_STATE: return "MAMA_STATUS_SUBSCRIPTION_INVALID_STATE";

     case MAMA_STATUS_QUEUE_OPEN_OBJECTS: return "MAMA_STATUS_QUEUE_OPEN_OBJECTS";

     case MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE: return "MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE"; 

-

+    case MAMA_STATUS_SUBSCRIPTION_GAP: return "MAMA_STATUS_SUBSCRIPTION_GAP";

+   

 #ifdef WITH_ENTITLEMENTS

     case MAMA_ENTITLE_STATUS_NOMEM : return "ENTITLE_STATUS_NOMEM";

     case MAMA_ENTITLE_STATUS_BAD_PARAM : return "ENTITLE_STATUS_BAD_PARAM";

Index: c_cpp/src/c/mama/status.h

===================================================================

RCS file: /cvsroot/products/mama/c_cpp/src/c/mama/status.h,v

retrieving revision 1.29.4.3.2.1.4.6

diff -u -r1.29.4.3.2.1.4.6 status.h

--- c_cpp/src/c/mama/status.h 29 Aug 2011 11:52:44 -0000          1.29.4.3.2.1.4.6

+++ c_cpp/src/c/mama/status.h              28 Dec 2011 17:47:07 -0000

@@ -1,4 +1,4 @@

-/* $Id$

+/* $Id: status.h,v 1.29.4.3.2.1.4.6 2011/08/29 11:52:44 ianbell Exp $

  *

  * OpenMAMA: The open middleware agnostic messaging API

  * Copyright (C) 2011 NYSE Inc.

@@ -99,7 +99,9 @@

     /* Queue has open objects. */

     MAMA_STATUS_QUEUE_OPEN_OBJECTS          = 5002,

     /* The function isn't supported for this type of subscription. */

-    MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE   = 5003

+    MAMA_STATUS_SUBSCRIPTION_INVALID_TYPE   = 5003,

+    /* The underlying transport saw a gap. */

+    MAMA_STATUS_SUBSCRIPTION_GAP            = 5004

 #ifdef WITH_ENTITLEMENTS

     /* Out of memory */

 

Signed-off-by: John Gray <jgray@...>