Can serialize Entry on distributed query

classic Classic list List threaded Threaded
7 messages Options
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Can serialize Entry on distributed query

asked by John Smith

Until Unions are fixed I am trying to broadcast my query in parallel on all nodes. But I get serialization exception...

class org.apache.ignite.IgniteCheckedException: Failed to serialize object: [Entry [key=10000018, val=MyTrx [field1=10000018, field2=100080, fullName=John Smith]]] at org.apache.ignite.marshaller.optimized.OptimizedMarshaller.marshal(OptimizedMarshaller.java:186)

Exeption only happens on remote nodes.

I set up my cache as follows...

IgniteConfiguration igniteCfg = new IgniteConfiguration();
igniteCfg.setMarshaller(new OptimizedMarshaller(true));
CacheConfiguration<Long, com.xxx.model.Transaction> cfg = new CacheConfiguration<>("myCache");
cfg.setCacheMode(CacheMode.PARTITIONED);
cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
cfg.setBackups(0);
cfg.setIndexedTypes(Long.class, com.xxx.model.MyTrx.class);
ignite = Ignition.start(igniteCfg);


I run my queries as follows...

IgniteCompute compute = ignite.compute().withAsync();

compute.broadcast(
     (MyTrx myReq) -> {
             System.out.println("Full Name!");
             String sqlStr = "FROM Transaction WHERE fullName = ?";
             SqlQuery sql = new SqlQuery(Transaction.class, sqlStr);
             sql.setArgs(trxRequest.getFullName());
             sql.setLocal(true);

             HashSet<MyTrx> list = new HashSet<MyTrx>(myCache.query(sql.setSql(sqlStr)).getAll());
                        return list;
       }, trxRequest);

     futs.add(compute.future());


-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Can serialize Entry on distributed query

commented by dmitriy setrakyan

Does the remote node have MyTrx class in the classpath? How are you starting your remote nodes?

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Can serialize Entry on distributed query

commented by John Smith

It's a fat jar of the same application on all nodes...

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss

pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Can serialize Entry on distributed query

commented by dmitriy setrakyan

In this case, can you please provide the stacktrace?

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Can serialize Entry on distributed query

commented by dmitriy setrakyan

John,

Also, I am seeing that you setup your cache with one type and then querying another:

CacheConfiguration<Long, com.xxx.model.Transaction> cfg = new CacheConfiguration<>("myCache");
...
cfg.setIndexedTypes(Long.class, com.xxx.model.MyTrx.class);


Please provide the full stacktrace, we need to see the cause of the exception.

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Can serialize Entry on distributed query

commented by valentin kulichenko

John,

I can't tell the reason for sure until I see the full stack trace, but I'm guessing that MyTrx class doesn't implement Serializable. If this is the case you can either fix it or configure marshaller not to require Serializable:

igniteCfg.setMarshaller(new OptimizedMarshaller(false));

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Can serialize Entry on distributed query

commented by John Smith

Sorry it's only one type I usually rename my classes when posting online. I will try to create a reproducer app for you guys...

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss