Apache Ignite

GridGain Developer Hub - Apache Ignitetm

Welcome to the Apache Ignite developer hub run by GridGain. Here you'll find comprehensive guides and documentation to help you start working with Apache Ignite as quickly as possible, as well as support if you get stuck.

 

GridGain also provides Community Edition which is a distribution of Apache Ignite made available by GridGain. It is the fastest and easiest way to get started with Apache Ignite. The Community Edition is generally more stable than the Apache Ignite release available from the Apache Ignite website and may contain extra bug fixes and features that have not made it yet into the release on the Apache website.

 

Let's jump right in!

 

Documentation     Ask a Question     Download

 

Javadoc     Scaladoc     Examples
Ask A Question

Questions

5
ANSWERED

UNION still not working with 1.0.2

Here is the exception... javax.cache.CacheException: Failed to parse query: SELECT "mycache".MyTrx._key, "mycache".MyTrx._val FROM MyTrx WHERE field1 = ? UNION SELECT * FROM MyTrx WHERE field2 = ? at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:782) at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:742) at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:553) at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:465) at com.xxx.service.MyService.lambda$start$4(MyService.java:116) at com.xxx.service.MyService$$Lambda$41/1174190307.handle(Unknown Source) at io.vertx.core.eventbus.impl.EventBusImpl$HandlerRegistration.handle(EventBusImpl.java:1097) at io.vertx.core.eventbus.impl.EventBusImpl.lambda$doReceive$175(EventBusImpl.java:737) at io.vertx.core.eventbus.impl.EventBusImpl$$Lambda$67/468639332.handle(Unknown Source) at io.vertx.core.impl.ContextImpl.lambda$wrapTask$15(ContextImpl.java:263) at io.vertx.core.impl.ContextImpl$$Lambda$4/451111351.run(Unknown Source) at io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor.lambda$new$147(OrderedExecutorFactory.java:91) at io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor$$Lambda$2/1870252780.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.h2.jdbc.JdbcSQLException: Column count does not match; SQL statement: SELECT "mycache".MyTrx._key, "mycache".MyTrx._val FROM MyTrx WHERE field1 = ? UNION SELECT * FROM MyTrx WHERE field2 = ? [21002-175] at org.h2.message.DbException.getJdbcSQLException(DbException.java:332) at org.h2.message.DbException.get(DbException.java:172) at org.h2.message.DbException.get(DbException.java:149) at org.h2.message.DbException.get(DbException.java:138) at org.h2.command.dml.SelectUnion.init(SelectUnion.java:264) at org.h2.command.Parser.parseSelect(Parser.java:1625) at org.h2.command.Parser.parsePrepared(Parser.java:426) at org.h2.command.Parser.parse(Parser.java:298) at org.h2.command.Parser.parse(Parser.java:270) at org.h2.command.Parser.prepareCommand(Parser.java:235) at org.h2.engine.Session.prepareLocal(Session.java:436) at org.h2.engine.Session.prepareCommand(Session.java:379) at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1138) at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:70) at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:267) at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:779) ... 15 more The query... String sqlStr = "SELECT * FROM MyTrx WHERE field1 = ? " + "UNION SELECT * FROM MyTrx WHERE field2 = ?"; SqlQuery sql = new SqlQuery(MyTrx.class, sqlStr); sql.setArgs(trxRequest.getField1(), trxRequest.getField2()); List<Entry<Long, MyTrx>> list = myCache.query(sql.setSql(sqlStr)).getAll(); The model... import org.apache.ignite.cache.query.annotations.QuerySqlField; public class MyTrx implements Serializable { private static final long serialVersionUID = -2604193489375322501L; @QuerySqlField(index = true) Long id; @QuerySqlField(index = true) String field1; @QuerySqlField(index = true) String field2; ... } How's it configured... IgniteConfiguration igniteCfg = new IgniteConfiguration(); igniteCfg.setMarshaller(new OptimizedMarshaller(true)); CacheConfiguration<Long, com.xxx.model.MyTrx> myCfg = new CacheConfiguration<>("mycache"); myCfg.setCacheMode(CacheMode.PARTITIONED); myCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); myCfg.setBackups(0); myCfg.setIndexedTypes(Long.class, com.xxx.model.MyTrx.class);

Posted by John Smith about a year ago

5
ANSWERED

Serialization Exception when trying to query cache on remote node.

I though I would start a fresh question and make sure I didn't fudge up renaming my types before posting in public location. Using 1.0. When I run a query on a remote node, I get a serialization exception... Apr 14, 2015 4:18:27 PM org.apache.ignite.logger.java.JavaLogger error SEVERE: Error sending reply for job [nodeId=e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, jobId=769f499bc41-7adb4843-c99d-4896-8aea-284f53366934, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=com.xxx.service.MyService2$$Lambda$69/1280666626, dep=LocalDeployment [super=GridDeployment [ts=1429042694671, depMode=SHARED, clsLdr=sun.misc.Launcher$AppClassLoader@55f96302, clsLdrId=f0a0599bc41-7adb4843-c99d-4896-8aea-284f53366934, userVer=0, loc=true, sampleClsName=java.lang.String, pendingUndeploy=false, undeployed=false, usage=0]], taskClsName=com.xxx.service.MyService2$$Lambda$69/1280666626, sesId=669f499bc41-e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, startTime=1429042707780, endTime=9223372036854775807, taskNodeId=e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, clsLdr=sun.misc.Launcher$AppClassLoader@55f96302, closed=false, cpSpi=null, failSpi=null, loadSpi=null, usage=1, fullSup=false, subjId=e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, mapFut=IgniteFuture [orig=GridFutureAdapter [resFlag=0, res=null, startTime=1429042707735, endTime=0, lsnr=null, state=INIT]]], jobId=769f499bc41-7adb4843-c99d-4896-8aea-284f53366934], job=C1 [arg=com.xxx.model.MyTrx2@4a62b3dd]] class org.apache.ignite.IgniteCheckedException: Failed to serialize object: [Entry [key=3, val=com.xxx.model.MyTrx2@552381d5]] at org.apache.ignite.marshaller.optimized.OptimizedMarshaller.marshal(OptimizedMarshaller.java:186) at org.apache.ignite.internal.processors.job.GridJobWorker.finishJob(GridJobWorker.java:706) at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:527) at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:423) at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:107) at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1118) at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1714) at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:664) at org.apache.ignite.internal.managers.communication.GridIoManager.access$1500(GridIoManager.java:57) at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:627) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.NotSerializableException: Must implement java.io.Serializable or set OptimizedMarshaller.setRequireSerializable() to false (note that performance may degrade if object is not Serializable): org.apache.ignite.internal.processors.cache.CacheEntryImpl at org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:703) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:217) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeHashMap(OptimizedObjectOutputStream.java:357) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeHashSet(OptimizedObjectOutputStream.java:373) at org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:655) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:217) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeObjectOverride(OptimizedObjectOutputStream.java:131) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at org.apache.ignite.marshaller.optimized.OptimizedMarshaller.marshal(OptimizedMarshaller.java:181) ... 12 more This is how I query: http://pastebin.com/9ipi3q2u The model: http://pastebin.com/MbH2cL3H

Posted by John Smith about a year ago

2
ANSWERED

Problem in starting the server node via java program

My code is :- import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCompute; import org.apache.ignite.IgniteException; import org.apache.ignite.Ignition; public class ExampleNodeStartup { public static void main(String[] args) throws IgniteException{ Ignite ignite= Ignition.start(); IgniteCompute compute = ignite.compute(); // Execute a job and wait for the result. String res = compute.call(() -> { // Print hello world on some cluster node. System.out.println("Hello World"); return "Hello World"; }); } } The error which i get is :- Exception in thread "main" class org.apache.ignite.IgniteException: Failed to create Ignite component (consider adding ignite-spring module to classpath) [component=SPRING, cls=org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl] at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:618) at org.apache.ignite.Ignition.start(Ignition.java:273) at ExampleNodeStartup.main(ExampleNodeStartup.java:11) Caused by: class org.apache.ignite.IgniteCheckedException: Failed to create Ignite component (consider adding ignite-spring module to classpath) [component=SPRING, cls=org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl] at org.apache.ignite.internal.IgniteComponentType.componentException(IgniteComponentType.java:273) at org.apache.ignite.internal.IgniteComponentType.create0(IgniteComponentType.java:264) at org.apache.ignite.internal.IgniteComponentType.create(IgniteComponentType.java:175) at org.apache.ignite.internal.IgnitionEx.loadConfigurations(IgnitionEx.java:546) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:737) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:697) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:651) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:426) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:406) at org.apache.ignite.Ignition.start(Ignition.java:270) ... 1 more Caused by: java.lang.ClassNotFoundException: org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:260) at org.apache.ignite.internal.IgniteComponentType.create0(IgniteComponentType.java:250) ... 9 more Whats the exact problem and what are the steps to run?..Do we have to run the command bin/ignite.sh..???

Posted by Piyali about a year ago