You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Naveen <na...@gmail.com> on 2018/01/02 10:06:46 UTC

Re: SQL and backing cache question

Hi Slava

Approach suggested by you still requires us to build the key and value
classes right, I was under impression that we dont need to build key and
value classes at all. 

This is the snippet I got it from the docs. Does it mean we do not need to
develop these classes OR just dont need to deployed on server node's
classpath.

/It enables you to read an arbitrary field from an object's serialized form
without full object deserialization. This ability completely removes the
requirement to have the cache key and value classes deployed on the server
node's classpath./

Another question, I was trying to test REST API for one of the cache I have
created thru Ignite DDL

This is the DDL

CREATE TABLE city_details_binary (
  city_id LONG PRIMARY KEY, city_name VARCHAR, state_name VARCHAR )
  WITH "backups=1, cache_name=city_details_binary,
key_type=com.ril.edif.cityKey.binary, value_type=com.ril.edif.city.binary,
wrap_key=true, wrap_value=true" ;


!tables output

                 | PUBLIC                         | CITY_DETAILS_BINARY           
| TABLE


Data

0: jdbc:ignite:thin://127.0.0.1> select * from city_details_binary;
+--------------------------------+--------------------------------+--------------------------------+
|            CITY_ID             |           CITY_NAME            |          
STATE_NAME           |
+--------------------------------+--------------------------------+--------------------------------+
| 1                              | mumbai                         | MH                            
|
| 2                              | hyd                            | TS                            
|


This is the error I could get

[15:31:28,449][SEVERE][rest-#52978%IgnitePOC%][GridCacheCommandHandler]
Failed to execute cache command: GridRestCacheRequest
[cacheName=CITY_DETAILS_BINARY, cacheFlags=0, ttl=null,
super=GridRestRequest [destId=null, clientId=null, addr=/10.77.241.8:59038,
cmd=CACHE_GET]]
class org.apache.ignite.IgniteCheckedException: Failed to find cache for
given cache name: CITY_DETAILS_BINARY
        at
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.localCache(GridCacheCommandHandler.java:815)
        at
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.executeCommand(GridCacheCommandHandler.java:738)
        at
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.handleAsync(GridCacheCommandHandler.java:440)
        at
org.apache.ignite.internal.processors.rest.GridRestProcessor.handleRequest(GridRestProcessor.java:266)
        at
org.apache.ignite.internal.processors.rest.GridRestProcessor.access$100(GridRestProcessor.java:89)
        at
org.apache.ignite.internal.processors.rest.GridRestProcessor$2.body(GridRestProcessor.java:155)
        at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
[15:31:28,450][SEVERE][rest-#52978%IgnitePOC%][GridRestProcessor] Failed to
handle request: CACHE_GET
class org.apache.ignite.IgniteCheckedException: Failed to find cache for
given cache name: CITY_DETAILS_BINARY
        at
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.localCache(GridCacheCommandHandler.java:815)
        at
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.executeCommand(GridCacheCommandHandler.java:738)
        at
org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler.handleAsync(GridCacheCommandHandler.java:440)
        at
org.apache.ignite.internal.processors.rest.GridRestProcessor.handleRequest(GridRestProcessor.java:266)
        at
org.apache.ignite.internal.processors.rest.GridRestProcessor.access$100(GridRestProcessor.java:89)
        at
org.apache.ignite.internal.processors.rest.GridRestProcessor$2.body(GridRestProcessor.java:155)
        at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

How do I resolve this issue??

Objective is not to write kep and value classed, just use Ignite DDL and
execute the scripts to create tables and start populating the data thru JDBC
OR Java API and retrieve thru aql JDBC, Java API & Rest API..

Thanks
Naveen




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: SQL and backing cache question

Posted by "slava.koptilin" <sl...@gmail.com>.
Hi Naveen,

> Does it mean we do not need to develop these classes OR
> just dont need to deployed on server node's classpath. 
In case of using BinaryObject you do not need to create the key and value
types.

> How do I resolve this issue?? 
It seems that "CITY_DETAILS_BINARY" cache is not created.
I've just tried a simple example and it works...
Anyway, I would suggest retrieving data through JDBC or Java API.

Thanks!



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/