[infinispan-dev] HotRod exec operation tight coupling with JBoss Marshaller

Vittorio Rigamonti vrigamon at redhat.com
Mon Feb 29 08:35:49 EST 2016


Hi All, Hi Galder

JBasicMarshaller.h is not an intent to go further along the way to implement a c++ JBossMarshaller, it has the only goal to provide a working 'exec' operation.
The c++ exec currently works only with integer and "small" string data types, user can easily extends the marshaller to other basic types.

My current model of the exec use case is this one (maybe it's too simplistic so correct me if I'm wrong): a "user defined consumer" consumes data produced by a "user defined producer", so maybe it could worth to evaluate a solution where the framework provides a common standard for communication (stringified json? or JSObject for in memory 100% Java) and let the user handle it's own data.
This is a proposal approach specific to the exec scope, I can't say if it can be extended as a general approach where marshalling is involved.

Cheers,
Vittorio




----- Original Message -----
From: "Galder Zamarreño" <galder at redhat.com>
To: "infinispan -Dev List" <infinispan-dev at lists.jboss.org>
Sent: Monday, February 29, 2016 11:28:55 AM
Subject: [infinispan-dev] HotRod exec operation tight coupling with JBoss	Marshaller

Hi all,

While implement `exec` operation for the JS client, I've encountered an issue with how the exec parameters and return types are marshalled. 

The essence of the problem is that the server marshalls these objects instead of having the client drive how these are marshalled. As a result of this, for a JS or C++ client to be able to use `exec` with default configuration, they need to understand JBoss Marshaller format, which is not good.

I'm not sure this would have been unavoidable due to the characteristics of `exec` but I wanted to see if we can find a good way to solve or get around this issue. Long term, we need better encoding handling both for incoming and returning types, but the question is whether we can find a way to better solve this until then. Here are some options:

- For the C++ client, Vittorio has part implemented the JBoss Marshaller format [1], but I'm kinda reluctant to go down this path since that creates a lot of work for us as the number of types that can be discovered in a JBoss Marshaller format byte array are quite considerable [2]. We're bound to miss one of those and since clients could execute any script, the chances are high IMO...

- An alternative would be for the JS/C++ clients to only support exec when the marshaller is one that enables compatibility mode. The idea here is that for compatibility mode to work, all clients involved are going to be set up with a marshaller that can work for all of them. Working on such marshaller is time better spent than on implementing the JBoss Marshaller format. We had a separate discussion on this topic in another dev thread...

Any other ideas someone might have?

Cheers,

[1] https://github.com/infinispan/cpp-client/blob/master/include/infinispan/hotrod/JBasicMarshaller.h
[2] https://github.com/jboss-remoting/jboss-marshalling/blob/master/river/src/main/java/org/jboss/marshalling/river/Protocol.java
--
Galder Zamarreño
Infinispan, Red Hat


_______________________________________________
infinispan-dev mailing list
infinispan-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev



More information about the infinispan-dev mailing list