Hi Austin,

There is no way to query binary data as Ignite does not know its structure.
You should deserialize data before store it with Ignite or store it as
BinaryObjects.

The first approach required all Ignite nodes should have data structure
classes in their classpathes.
The second one required data structure classes to be in classpath on node
that will deserialize query results. Usually it is a client node.

See [1] and [2].

[1] https://apacheignite.readme.io/docs/binary-marshaller
[2]
http://apache-ignite-users.70518.x6.nabble.com/Working-Directly-with-Binary-objects-td5131.html

On Mon, Apr 3, 2017 at 4:17 PM, austin solomon <[email protected]>
wrote:

> Hi,
>
> My Ignite version is 1.9.0
>
> I am pushing JSON object into Ignite's cache using Apache Nifi's : GetKafka
> => PutIgniteCache processors.
> I could able to save the data in cache but the data it is in byte array
> format how can I query this.
>
> My Json object looks like this : {"id":1, "name":"USA", "population":
> 150000} .
> When  print the cache data  got the following result:
>
>               byte[] bytes = (byte[]) cache.get("1");
>               String str = new String(bytes, StandardCharsets.UTF_8);
>               System.out.println("Cache get id = "+str);
>               Iterator it=cache.iterator();
>               while(it.hasNext()){
>                   System.out.println("Cache next=="+it.next());
>               }
>
> Result:
>
>    Cache get id = {"id":1, "name":"USA", "population": 150000}
>    Cache next==Entry [key=1, val=[B@5ab14cb9]
>    Cache next==Entry [key=2, val=[B@5fb97279]
>    Cache next==Entry [key=3, val=[B@439a8f59]
>
> How can I query this data or map this as key, value.
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Storing-JSON-data-on-Ignite-cache-tp11660.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Best regards,
Andrey V. Mashenkov

Reply via email to