You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by michael <mi...@citi.com> on 2018/05/02 15:11:14 UTC
Re: Inconsistency reading cache from code and via REST?
Hi
revisiting this now I am actually connecting to a data source and filling
the cache with data:
For simplicity the attached code
cacheTableTest.java
<http://apache-ignite-users.70518.x6.nabble.com/file/t1696/cacheTableTest.java>
only gets an update of a single string key value pair when in reality there
will be 100s of updates. I'm aware that creating the table MyData multiple
times will fail again this is so the code is a bit neater.
My problem is I am still unclear how to get data from a REST call. In
particular, whether I need the data in a cache or in a table, so the example
shows populating both.
A simple "get" by key works:
http://127.0.0.1:8080/ignite?cmd=get&cacheName=MyCache&key="key123"
{"successStatus":0,"affinityNodeId":"05f313de-6f41-47bb-856a-03a32a0fe467","error":null,"response":"value123","sessionToken":null}
but my guess on the cache:
http://127.0.0.1:8080/ignite?cmd=qryexe&cacheName=MyCache&pageSize=1&Type=String&arg1=key123&qry=_key%20%3D%20%3F
fails:
{"successStatus":1,"error":"class org.apache.ignite.IgniteException:
null","response":null,"sessionToken":null}
and I dont understand how to query the table
thanks
Michael
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Inconsistency reading cache from code and via REST?
Posted by aealexsandrov <ae...@gmail.com>.
Hi,
qryexe doesn't work correct. At some reason it ignores _key and _value in
2.4. You can use qryfldexe as it was describe here:
http://apache-ignite-users.70518.x6.nabble.com/Example-of-SQL-query-td21427.html
BR,
Andrei
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/