Manish
Manish

Reputation: 939

Json like support in hazelcast

Is there a way to achieve JSON like support in Hazelcast? In short the requirement is to be able to store an Object with arbitrary attributes and be able to query the map based on them.

         public class DynamicBean implements Portable {

        private Map<String,String> attributes;
}

So far I have tried Portable and custom attributes and unfortunately both of them come to a point where you need to know the attributes before hand.

I have a few other ways also in mind:

  1. Use portable and initialise Object with some sort of invalid value for attributes which are not to be set
  2. Utilise IMap.executeOnEntries() to and return the matching entries after passing the command to search in EntryProcessor object. But in this approach I am not sure how scalable it will be as the EntryProcessor will need to deserialise each object.

Upvotes: 1

Views: 538

Answers (1)

noctarius
noctarius

Reputation: 6094

I'm currently working on CBOR support which is something like binary JSON and will provide most of the features you would expect (queryable, indexable, ...).

For the moment you can try to use Portable which kind of a hashmap like thing. You'll find the docs here: http://docs.hazelcast.org/docs/3.7/manual/html-single/index.html#implementing-portable-serialization

Upvotes: 1

Related Questions