[infinispan-dev] Remote Query improvements

Adrian Nistor anistor at redhat.com
Mon Feb 10 13:43:38 EST 2014


The idea of auto-generating protobuf schemas based on the marshaller 
code was briefly mentioned last time we met in Palma. I would not 
qualify it as impossible to implement, but it would certainly be hacky 
and leads to more trouble than it's worth.

A lot of info is missing from the marshaller code (API calls) precisely 
because it is not normally needed, being provided by the schema already. 
Now trying to go backwards means we'll have to 'invent' that metadata 
using some common sense (examples: which field is required vs optional, 
which field is indexable, indexing options, etc). Too many options. I 
bet the notion of 'common sense' would quickly need to be configured 
somehow, for uncommon use cases :). But that's why we have protobuf 
schemas for. Plus, to run a marshaller for inferring the schema you'll 
first need a prototypical instance of your entity. Where from? So no, 
-1, now I have serious concerns about this, even though I initially 
nodded in approval.

And that would work only for Java anyway, because the marshaller and the 
schema-infering-process needs to run on the server side.


On 02/10/2014 07:34 PM, Mircea Markus wrote:
> On Feb 10, 2014, at 4:54 PM, Tristan Tarrant <ttarrant at redhat.com> wrote:
>
>> - since remote query is already imbued with JPA in some form, an
>> interesting project would be to implement a JPA annotation processor
>> which can produce a set of ProtoBuf schemas from JPA-annotated classes.
>> - on top of the above, a ProtoBuf marshaller/unmarshaller which can use
>> the JPA entities directly.
> I think it would be even more useful to infer the protbuf schema from the protostream marshaller: the marshaller is required in order to serialize object into the proto format and has the advantage that it works even without Java.
>
> Cheers,



More information about the infinispan-dev mailing list