re: re: Ignite Sql Query performance problem

2016-04-11 Thread Zhengqingzheng
Dear Val, 
Thank you for your suggestion. 
May I ask you one more question disregards with this one.
The performance issue that I asked was test on my own machine (server ip is 
127.0.0.1).
Today, when I test my program on a remote server (let's say 10.xx.xx.xxx), I 
got an exception on server side:
===
[14:18:38] Ignite node started OK (id=f1ac6685)
[14:18:38] Topology snapshot [ver=1, servers=1, clients=0, CPUs=8, heap=1.0GB]
[14:18:53] Topology snapshot [ver=2, servers=1, clients=1, CPUs=12, heap=1.5GB]
[14:18:57,058][SEVERE][tcp-disco-msg-worker-#2%null%][TcpDiscoverySpi] Failed 
to unmarshal discovery custom message.
class org.apache.ignite.IgniteCheckedException: Failed to find class with given 
class loader for unmarshalling (make sure same versions of all classes are 
available on all nodes or enable peer-class-loading): 
sun.misc.Launcher$AppClassLoader@784be29
at 
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal(JdkMarshaller.java:108)
at 
org.apache.ignite.marshaller.AbstractMarshaller.unmarshal(AbstractMarshaller.java:78)
at 
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryCustomEventMessage.message(TcpDiscoveryCustomEventMessage.java:78)
at 
org.apache.ignite.spi.discovery.tcp.ServerImpl$RingMessageWorker.notifyDiscoveryListener(ServerImpl.java:4731)
at 
org.apache.ignite.spi.discovery.tcp.ServerImpl$RingMessageWorker.processCustomMessage(ServerImpl.java:4592)
at 
org.apache.ignite.spi.discovery.tcp.ServerImpl$RingMessageWorker.processMessage(ServerImpl.java:2276)
at 
org.apache.ignite.spi.discovery.tcp.ServerImpl$MessageWorkerAdapter.body(ServerImpl.java:5784)
at 
org.apache.ignite.spi.discovery.tcp.ServerImpl$RingMessageWorker.body(ServerImpl.java:2161)
at org.apache.ignite.spi.IgniteSpiThread.run(IgniteSpiThread.java:62)
Caused by: java.lang.ClassNotFoundException: 
org.apache.ignite.examples.datagrid.store.auto.CacheAutoStoreExample_new$CacheJdbcPojoStoreExampleFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at 
org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:8172)
at 
org.apache.ignite.marshaller.jdk.JdkMarshallerObjectInputStream.resolveClass(JdkMarshallerObjectInputStream.java:54)
at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1997)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1921)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1997)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1921)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at java.util.ArrayList.readObject(ArrayList.java:771)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at 
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1897)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1997)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1921)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
  

SQL gives incorrect results

2016-04-11 Thread arthi
Hi Igniters,

I have a cluster of 6 nodes, with one  partitioned cache and a replicated
cache.
I run a join query on these two caches, but the results are incorrect.

I have not implemented any affinity rules, as the mappers in all the nodes
should see the entire replicated cache and should work.

What should be the issue here?

Thanks,
Arthi




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/SQL-gives-incorrect-results-tp4049.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


hibernate open session error while running with tomcat server

2016-04-11 Thread Ravi Puri
this is the error throws while executing with 

 long start = System.currentTimeMillis();
System.out.println("Entering into loadCache
ApacheIgniteCacheConfiguration");
// Start loading cache from persistent store on all caching nodes.
  cache.loadCache(null,100_000);// here throws the error

  System.out.println("after cache loadcache");
long end = System.currentTimeMillis();

System.out.println(">>> Loaded " + cache.size() + " keys with
backups in " + (end - start) + "ms.");
System.out.println("Exiting from loadCache
ApacheIgniteCacheConfiguration");



error:


java.lang.NoSuchMethodError:
org.hibernate.SessionFactory.openSession()Lorg/hibernate/Session;

org.apache.ignite.cache.store.hibernate.CacheHibernateStoreSessionListener.onSessionStart(CacheHibernateStoreSessionListener.java:178)

org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.sessionInit0(GridCacheStoreManagerAdapter.java:818)

org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadCache(GridCacheStoreManagerAdapter.java:479)

org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter.localLoadCache(GridDhtCacheAdapter.java:515)

org.apache.ignite.internal.processors.cache.IgniteCacheProxy.localLoadCache(IgniteCacheProxy.java:387)

org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5716)

org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure.call(GridCacheAdapter.java:5663)

org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1789)

org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:509)

org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6397)

org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:503)

org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:456)

org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/hibernate-open-session-error-while-running-with-tomcat-server-tp4050.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: .NET SQLQuery Error

2016-04-11 Thread Pavel Tupitsyn
Satya, I can run your solution without errors with fixed config.
This means that you don't actually use the config above for your nodes.
Something else gets loaded for some reason.

Please do the following:
* Make sure that SpringConfigUrl points to the updated file everywhere you
use it.
* Replace GetOrCreateCache with GetCache. This will ensure that cache is
retrieved from config, not started dynamically.

Pavel.


On Sun, Apr 10, 2016 at 4:48 PM, Murthy Kakarlamudi 
wrote:

> Hi Pavel...Thanks for the update. I seem to be doing something wrong. I am
> still getting the same error even after applying the update you suggested.
> Not sure if the way I specified the types for the columns in java matched
> against definitions in SQL Server. I am attaching below the column types
> from SQL Server.
>
> [image: Inline image 1]
>
> Below is the updated config xml
> 
>   
> 
>   
>   
>   
>   
>   
>   
>  class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
> 
>   
>   
> 
>   
> 
> **
> 
> 
>   
> 
> 
> 
> 
> 
> 
>   
> 
> 
> 
>   
> 
>   
> 
>   
> 
>   
> 
>   
> 
>
> Is there a different way to specify the indexed type? In java, I can
> specify at the CacheConfiguration object leve, but .NET API had no such
> method and spring config seems to be the only way unless I am missing
> anything.
>
> Your help is much appreciated,
> Satya.
>
> On Sun, Apr 10, 2016 at 9:23 AM, Pavel Tupitsyn 
> wrote:
>
>> Looks like the problem is here:
>> 
>>
>> Ignite uses type name without namespace in queries and binary objects, so
>> correct line would be
>>
>> 
>>
>> Let me know if this helps.
>>
>> Pavel.
>>
>>
>> On Sun, Apr 10, 2016 at 1:16 PM, Murthy Kakarlamudi 
>> wrote:
>>
>>> Hi Pavel,
>>> Below is the link to download the solution. The attached solution
>>> has 4 projects. TestIgniteServer is used to start Ignite node in server
>>> mode. TestIgniteSQLClient is used to start Ignite in client mode and
>>> execute the sql query against the cache.
>>>
>>> https://drive.google.com/open?id=0B8lM91-_3MwRYUxqX2ZHU0thRmc
>>>
>>> Thanks again for your help,
>>> Satya.
>>>
>>> On Sun, Apr 10, 2016 at 2:33 AM, Pavel Tupitsyn 
>>> wrote:
>>>
 Satya, there is some issue with configuration in your code. Looks like
 you use different XML than provided above. Make sure the path is correct.
 Or, you can attach your entire solution, and I'll take a look.

 Pavel.

 On Sat, Apr 9, 2016 at 7:29 PM, Murthy Kakarlamudi 
 wrote:

> Hi Pavel,
>Is that the only change needed? I added that property and I am
> still getting the same error.
>
> 
>   
>  class="org.apache.ignite.configuration.CacheConfiguration">
>   **
>   
>   
>   
>   
>   
>  class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>    value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
> 
>   
>   
> 
>   
> 
>  value="TestIgniteDAL.BusinessUnit"/>
> 
> 
>   
> 
> 
> 
> 
> 
> 
>   
> 
> 
> 
>   
> 
>   
> 
>   
> 
>   
> 
>   
> 
>
> Apache.Ignite.Core.Common.IgniteException was unhandled
>   HResult=-2146233088
>   Message=Indexing is disabled for cache: BU. Use setIndexedTypes or
> setTypeMetadata methods on CacheConfiguration to enable.
>   Source=Apache.Ignite.Core
>   StackTrace:
>at
> Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.Error(Void* target,
> Int32 errType, SByte* errClsChars, Int32 errClsCharsLen, SByte*
> errMsgChars, Int32 errMsgCharsLen, Void* errData, Int32 errDataLen)
>at
> Apache.Ignite.Core.Impl.Unmanaged.IgniteJniNativeMethods.CacheOutOpQueryCursor(Void*
> ctx, Void* obj, Int32 type, Int64 memPtr)
>at
> Apach

How Does Ignite Create Lucene Index?

2016-04-11 Thread Level D
Hi,


I Would Like To Know How Ignite Creates Lucene Index When I Try Text Quary With 
Partitioned Mode In Detail.


I don't think that the progress is just the same as solr cause ignite doesn't 
have something like a leader node.


Is there anything similar? If every node in ignite cluster has two indexes? One 
is for the data in a node, the other is for the whole cluster used like a 
router?


These confuse me a lot. Hope to be anwered.


Thanks,
ZhouYankai

答复: re: Ignite Sql Query performance problem

2016-04-11 Thread Zhengqingzheng
Dear Val, 
I found another post that you have answered : 
http://apache-ignite-users.70518.x6.nabble.com/problem-run-jar-file-td1973.html
And solved my problem by adding several extra jar files on server side libs 
folder.

Best regards,
Kevin

-邮件原件-
发件人: vkulichenko [mailto:valentin.kuliche...@gmail.com] 
发送时间: 2016年4月11日 13:12
收件人: user@ignite.apache.org
主题: Re: re: Ignite Sql Query performance problem

Kevin,

Each index add memory overhead. It's hard to estimate without knowing the 
details of the application, but in general indexes do not add more than 20-30% 
to the overall data size.

BTW, if you can replace query with a simple get(), you should do this. It will 
be more effective from both performance and memory consumption standpoint. Use 
SQL for more complicated requests.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Sql-Query-performance-problem-tp4031p4045.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: .NET SQLQuery Error

2016-04-11 Thread Murthy Kakarlamudi
Hi Pavel,
You are absolutely right. I had 2 config files and I indeed am
referring to wrong version. I copied and pasted and VS and instead of
creating a new file, it created a link. Thanks for helping me out.

Based on your suggestion that the valueType needs to be unqualified without
the namespace, the documentation needs an update. I was basically following
that as an example.  But without namespace qualification, doesn't that
force an user to create unique classnames?







On Mon, Apr 11, 2016 at 4:36 AM, Pavel Tupitsyn 
wrote:

> Satya, I can run your solution without errors with fixed config.
> This means that you don't actually use the config above for your nodes.
> Something else gets loaded for some reason.
>
> Please do the following:
> * Make sure that SpringConfigUrl points to the updated file everywhere you
> use it.
> * Replace GetOrCreateCache with GetCache. This will ensure that cache is
> retrieved from config, not started dynamically.
>
> Pavel.
>
>
> On Sun, Apr 10, 2016 at 4:48 PM, Murthy Kakarlamudi 
> wrote:
>
>> Hi Pavel...Thanks for the update. I seem to be doing something wrong. I
>> am still getting the same error even after applying the update you
>> suggested. Not sure if the way I specified the types for the columns in
>> java matched against definitions in SQL Server. I am attaching below the
>> column types from SQL Server.
>>
>> [image: Inline image 1]
>>
>> Below is the updated config xml
>> 
>>   
>> 
>>   
>>   
>>   
>>   
>>   
>>   
>> > class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>>   > value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
>> 
>>   
>>   
>> 
>>   
>> 
>> **
>> 
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> 
>>   
>> 
>> 
>> 
>>   
>> 
>>   
>> 
>>   
>> 
>>   
>> 
>>   
>> 
>>
>> Is there a different way to specify the indexed type? In java, I can
>> specify at the CacheConfiguration object leve, but .NET API had no such
>> method and spring config seems to be the only way unless I am missing
>> anything.
>>
>> Your help is much appreciated,
>> Satya.
>>
>> On Sun, Apr 10, 2016 at 9:23 AM, Pavel Tupitsyn 
>> wrote:
>>
>>> Looks like the problem is here:
>>> 
>>>
>>> Ignite uses type name without namespace in queries and binary objects,
>>> so correct line would be
>>>
>>> 
>>>
>>> Let me know if this helps.
>>>
>>> Pavel.
>>>
>>>
>>> On Sun, Apr 10, 2016 at 1:16 PM, Murthy Kakarlamudi 
>>> wrote:
>>>
 Hi Pavel,
 Below is the link to download the solution. The attached solution
 has 4 projects. TestIgniteServer is used to start Ignite node in server
 mode. TestIgniteSQLClient is used to start Ignite in client mode and
 execute the sql query against the cache.

 https://drive.google.com/open?id=0B8lM91-_3MwRYUxqX2ZHU0thRmc

 Thanks again for your help,
 Satya.

 On Sun, Apr 10, 2016 at 2:33 AM, Pavel Tupitsyn >>> > wrote:

> Satya, there is some issue with configuration in your code. Looks like
> you use different XML than provided above. Make sure the path is correct.
> Or, you can attach your entire solution, and I'll take a look.
>
> Pavel.
>
> On Sat, Apr 9, 2016 at 7:29 PM, Murthy Kakarlamudi 
> wrote:
>
>> Hi Pavel,
>>Is that the only change needed? I added that property and I am
>> still getting the same error.
>>
>> 
>>   
>> > class="org.apache.ignite.configuration.CacheConfiguration">
>>   **
>>   
>>   
>>   
>>   
>>   
>> > class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>>   > value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
>> 
>>   
>>   
>> 
>>   
>> 
>> > value="TestIgniteDAL.BusinessUnit"/>
>> 
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> 
>>   
>> 
>> 
>> 
>>   
>> 
>>   
>> 
>>   
>> 
>>   
>>>

Why does ignite not use an index ?

2016-04-11 Thread arthi
Hi Igniters,

I have a 6 node cluster with one partitioned cache and one replicated cache.

I run a join query on the two caches with a few indexes defined, but ignite
is not using an index for the query -








   



  

 








  
  
  

  






 

 


















   

   


 

  



















   



   


  






  

  
 

Re: .NET SQLQuery Error

2016-04-11 Thread Pavel Tupitsyn
In fact, keyType and valType can be arbitrary strings.
They are used to create SQL tables internally.
Look at SqlQuery constructors: some of them accept "string queryType". This
string must be equal to valType string in configuration.

Using type name without namespace is just a convention. SqlQuery
constructor with "Type queryType" argument just passes along type name
string.

This does not force the user to create unique classnames, because there is
a separate SQL schema for each cache in Ignite.
Only if you use multiple entry types in a single cache (which is not
recommended by itself), and these types have the same name, there will be a
collision.

Sounds complicated, I know. Can't wait for 1.6 release where all of this is
hidden from the user :)

Let me know if you need more details.

Pavel.

On Mon, Apr 11, 2016 at 1:32 PM, Murthy Kakarlamudi 
wrote:

> Hi Pavel,
> You are absolutely right. I had 2 config files and I indeed am
> referring to wrong version. I copied and pasted and VS and instead of
> creating a new file, it created a link. Thanks for helping me out.
>
> Based on your suggestion that the valueType needs to be unqualified
> without the namespace, the documentation needs an update. I was basically
> following that as an example.  But without namespace qualification, doesn't
> that force an user to create unique classnames?
>
> 
> 
>  value="org.apache.ignite.examples.datagrid.store.Person"/>
> 
>
>
> On Mon, Apr 11, 2016 at 4:36 AM, Pavel Tupitsyn 
> wrote:
>
>> Satya, I can run your solution without errors with fixed config.
>> This means that you don't actually use the config above for your nodes.
>> Something else gets loaded for some reason.
>>
>> Please do the following:
>> * Make sure that SpringConfigUrl points to the updated file everywhere
>> you use it.
>> * Replace GetOrCreateCache with GetCache. This will ensure that cache is
>> retrieved from config, not started dynamically.
>>
>> Pavel.
>>
>>
>> On Sun, Apr 10, 2016 at 4:48 PM, Murthy Kakarlamudi 
>> wrote:
>>
>>> Hi Pavel...Thanks for the update. I seem to be doing something wrong. I
>>> am still getting the same error even after applying the update you
>>> suggested. Not sure if the way I specified the types for the columns in
>>> java matched against definitions in SQL Server. I am attaching below the
>>> column types from SQL Server.
>>>
>>> [image: Inline image 1]
>>>
>>> Below is the updated config xml
>>> 
>>>   
>>> 
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>> >> class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>>>   >> value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
>>> 
>>>   
>>>   
>>> 
>>>   
>>> 
>>> **
>>> 
>>> 
>>>   
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>   
>>> 
>>> 
>>> 
>>>   
>>> 
>>>   
>>> 
>>>   
>>> 
>>>   
>>> 
>>>   
>>> 
>>>
>>> Is there a different way to specify the indexed type? In java, I can
>>> specify at the CacheConfiguration object leve, but .NET API had no such
>>> method and spring config seems to be the only way unless I am missing
>>> anything.
>>>
>>> Your help is much appreciated,
>>> Satya.
>>>
>>> On Sun, Apr 10, 2016 at 9:23 AM, Pavel Tupitsyn 
>>> wrote:
>>>
 Looks like the problem is here:
 

 Ignite uses type name without namespace in queries and binary objects,
 so correct line would be

 

 Let me know if this helps.

 Pavel.


 On Sun, Apr 10, 2016 at 1:16 PM, Murthy Kakarlamudi 
 wrote:

> Hi Pavel,
> Below is the link to download the solution. The attached solution
> has 4 projects. TestIgniteServer is used to start Ignite node in server
> mode. TestIgniteSQLClient is used to start Ignite in client mode and
> execute the sql query against the cache.
>
> https://drive.google.com/open?id=0B8lM91-_3MwRYUxqX2ZHU0thRmc
>
> Thanks again for your help,
> Satya.
>
> On Sun, Apr 10, 2016 at 2:33 AM, Pavel Tupitsyn <
> ptupit...@gridgain.com> wrote:
>
>> Satya, there is some issue with configuration in your code. Looks
>> like you use different XML than provided above. Make sure the path is
>> correct.
>> Or, you can attach your entire solution, and I'll take a look.
>>
>> Pavel.
>>
>> On Sat, Apr 9, 2016 at 7:29 PM, Murthy Kakarlamudi 
>> wrote:
>>
>>> Hi Pavel,
>>>Is that the only change needed? I added that property and I am
>>> still gett

Re: Behavior of init() for clustered singleton

2016-04-11 Thread Yakov Zhdanov
Please provide app logs after the issue gets reproduced.

--Yakov

2016-04-08 19:20 GMT+03:00 dstieglitz :

> Ok I added the debug statements:
>
>
> https://github.com/dstieglitz/grails-ignite/blob/v0.4.x/src/java/org/grails/ignite/DistributedSchedulerServiceImpl.java
>
> Let me know if you want me to report anything from our application.
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Behavior-of-init-for-clustered-singleton-tp3819p4025.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: .NET SQLQuery Error

2016-04-11 Thread Murthy Kakarlamudi
That makes sense. Thanks for the explanation. Any idea what is the wait
time for 1.6? Do you recommend building from source for 1.6 and use that
till 1.6 is GA?
On Apr 11, 2016 7:28 AM, "Pavel Tupitsyn"  wrote:

> In fact, keyType and valType can be arbitrary strings.
> They are used to create SQL tables internally.
> Look at SqlQuery constructors: some of them accept "string queryType".
> This string must be equal to valType string in configuration.
>
> Using type name without namespace is just a convention. SqlQuery
> constructor with "Type queryType" argument just passes along type name
> string.
>
> This does not force the user to create unique classnames, because there is
> a separate SQL schema for each cache in Ignite.
> Only if you use multiple entry types in a single cache (which is not
> recommended by itself), and these types have the same name, there will be a
> collision.
>
> Sounds complicated, I know. Can't wait for 1.6 release where all of this
> is hidden from the user :)
>
> Let me know if you need more details.
>
> Pavel.
>
> On Mon, Apr 11, 2016 at 1:32 PM, Murthy Kakarlamudi 
> wrote:
>
>> Hi Pavel,
>> You are absolutely right. I had 2 config files and I indeed am
>> referring to wrong version. I copied and pasted and VS and instead of
>> creating a new file, it created a link. Thanks for helping me out.
>>
>> Based on your suggestion that the valueType needs to be unqualified
>> without the namespace, the documentation needs an update. I was basically
>> following that as an example.  But without namespace qualification, doesn't
>> that force an user to create unique classnames?
>>
>> 
>> 
>> > value="org.apache.ignite.examples.datagrid.store.Person"/>
>> 
>>
>>
>> On Mon, Apr 11, 2016 at 4:36 AM, Pavel Tupitsyn 
>> wrote:
>>
>>> Satya, I can run your solution without errors with fixed config.
>>> This means that you don't actually use the config above for your nodes.
>>> Something else gets loaded for some reason.
>>>
>>> Please do the following:
>>> * Make sure that SpringConfigUrl points to the updated file everywhere
>>> you use it.
>>> * Replace GetOrCreateCache with GetCache. This will ensure that cache is
>>> retrieved from config, not started dynamically.
>>>
>>> Pavel.
>>>
>>>
>>> On Sun, Apr 10, 2016 at 4:48 PM, Murthy Kakarlamudi 
>>> wrote:
>>>
 Hi Pavel...Thanks for the update. I seem to be doing something wrong. I
 am still getting the same error even after applying the update you
 suggested. Not sure if the way I specified the types for the columns in
 java matched against definitions in SQL Server. I am attaching below the
 column types from SQL Server.

 [image: Inline image 1]

 Below is the updated config xml
 
   
 >>> class="org.apache.ignite.configuration.CacheConfiguration">
   
   
   
   
   
   
 >>> class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
   >>> value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
 
   
   
 
   
 
 **
 
 
   
 
 
 
 
 
 
   
 
 
 
   
 
   
 
   
 
   
 
   
 

 Is there a different way to specify the indexed type? In java, I can
 specify at the CacheConfiguration object leve, but .NET API had no such
 method and spring config seems to be the only way unless I am missing
 anything.

 Your help is much appreciated,
 Satya.

 On Sun, Apr 10, 2016 at 9:23 AM, Pavel Tupitsyn >>> > wrote:

> Looks like the problem is here:
> 
>
> Ignite uses type name without namespace in queries and binary objects,
> so correct line would be
>
> 
>
> Let me know if this helps.
>
> Pavel.
>
>
> On Sun, Apr 10, 2016 at 1:16 PM, Murthy Kakarlamudi 
> wrote:
>
>> Hi Pavel,
>> Below is the link to download the solution. The attached solution
>> has 4 projects. TestIgniteServer is used to start Ignite node in server
>> mode. TestIgniteSQLClient is used to start Ignite in client mode and
>> execute the sql query against the cache.
>>
>> https://drive.google.com/open?id=0B8lM91-_3MwRYUxqX2ZHU0thRmc
>>
>> Thanks again for your help,
>> Satya.
>>
>> On Sun, Apr 10, 2016 at 2:33 AM, Pavel Tupitsyn <
>> ptupit...@gridgain.com> wrote:
>>
>>

Re: .NET SQLQuery Error

2016-04-11 Thread Pavel Tupitsyn
Some say that 1.6 is expected by the end of the month, can't say for sure.

Obviously, I can't recommend to use unreleased code in production, but
other than that, our master branch is usually stable, so you are welcome to
try out latest features!
If you decide to do so, have a look at updated QueryExample and new
LinqExample.
It is also possible to configure everything in .NET, without Spring XML.

By the way, to avoid building from sources manually, you can use NuGet
package built from latest master on our CI server (use guest login):
http://ci.ignite.apache.org/viewLog.html?buildId=224958&buildTypeId=IgniteTests_IgnitePlatformNetNuGetNe&tab=artifacts

Pavel.


On Mon, Apr 11, 2016 at 3:59 PM, Murthy Kakarlamudi 
wrote:

> That makes sense. Thanks for the explanation. Any idea what is the wait
> time for 1.6? Do you recommend building from source for 1.6 and use that
> till 1.6 is GA?
> On Apr 11, 2016 7:28 AM, "Pavel Tupitsyn"  wrote:
>
>> In fact, keyType and valType can be arbitrary strings.
>> They are used to create SQL tables internally.
>> Look at SqlQuery constructors: some of them accept "string queryType".
>> This string must be equal to valType string in configuration.
>>
>> Using type name without namespace is just a convention. SqlQuery
>> constructor with "Type queryType" argument just passes along type name
>> string.
>>
>> This does not force the user to create unique classnames, because there
>> is a separate SQL schema for each cache in Ignite.
>> Only if you use multiple entry types in a single cache (which is not
>> recommended by itself), and these types have the same name, there will be a
>> collision.
>>
>> Sounds complicated, I know. Can't wait for 1.6 release where all of this
>> is hidden from the user :)
>>
>> Let me know if you need more details.
>>
>> Pavel.
>>
>> On Mon, Apr 11, 2016 at 1:32 PM, Murthy Kakarlamudi 
>> wrote:
>>
>>> Hi Pavel,
>>> You are absolutely right. I had 2 config files and I indeed am
>>> referring to wrong version. I copied and pasted and VS and instead of
>>> creating a new file, it created a link. Thanks for helping me out.
>>>
>>> Based on your suggestion that the valueType needs to be unqualified
>>> without the namespace, the documentation needs an update. I was basically
>>> following that as an example.  But without namespace qualification, doesn't
>>> that force an user to create unique classnames?
>>>
>>> 
>>> 
>>> >> value="org.apache.ignite.examples.datagrid.store.Person"/>
>>> 
>>>
>>>
>>> On Mon, Apr 11, 2016 at 4:36 AM, Pavel Tupitsyn 
>>> wrote:
>>>
 Satya, I can run your solution without errors with fixed config.
 This means that you don't actually use the config above for your nodes.
 Something else gets loaded for some reason.

 Please do the following:
 * Make sure that SpringConfigUrl points to the updated file everywhere
 you use it.
 * Replace GetOrCreateCache with GetCache. This will ensure that cache
 is retrieved from config, not started dynamically.

 Pavel.


 On Sun, Apr 10, 2016 at 4:48 PM, Murthy Kakarlamudi 
 wrote:

> Hi Pavel...Thanks for the update. I seem to be doing something wrong.
> I am still getting the same error even after applying the update you
> suggested. Not sure if the way I specified the types for the columns in
> java matched against definitions in SQL Server. I am attaching below the
> column types from SQL Server.
>
> [image: Inline image 1]
>
> Below is the updated config xml
> 
>   
>  class="org.apache.ignite.configuration.CacheConfiguration">
>   
>   
>   
>   
>   
>   
>  class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>    value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
> 
>   
>   
> 
>   
> 
> **
> 
> 
>   
> 
> 
> 
> 
> 
> 
>   
> 
> 
> 
>   
> 
>   
> 
>   
> 
>   
> 
>   
> 
>
> Is there a different way to specify the indexed type? In java, I can
> specify at the CacheConfiguration object leve, but .NET API had no such
> method and spring config seems to be the only way unless I am missing
> anything.
>
> Your help is much appreciated,
> Satya.
>
> On Sun, Apr 10, 2016 at 9:23 AM, Pavel Tupitsyn <
> ptupit..

Re: .NET SQLQuery Error

2016-04-11 Thread Murthy Kakarlamudi
Great..thanks for the info. We are not on production yet. We have a couple
more months. Will try the approach you suggested.

Thanks.
On Apr 11, 2016 9:22 AM, "Pavel Tupitsyn"  wrote:

> Some say that 1.6 is expected by the end of the month, can't say for sure.
>
> Obviously, I can't recommend to use unreleased code in production, but
> other than that, our master branch is usually stable, so you are welcome to
> try out latest features!
> If you decide to do so, have a look at updated QueryExample and new
> LinqExample.
> It is also possible to configure everything in .NET, without Spring XML.
>
> By the way, to avoid building from sources manually, you can use NuGet
> package built from latest master on our CI server (use guest login):
>
> http://ci.ignite.apache.org/viewLog.html?buildId=224958&buildTypeId=IgniteTests_IgnitePlatformNetNuGetNe&tab=artifacts
>
> Pavel.
>
>
> On Mon, Apr 11, 2016 at 3:59 PM, Murthy Kakarlamudi 
> wrote:
>
>> That makes sense. Thanks for the explanation. Any idea what is the wait
>> time for 1.6? Do you recommend building from source for 1.6 and use that
>> till 1.6 is GA?
>> On Apr 11, 2016 7:28 AM, "Pavel Tupitsyn"  wrote:
>>
>>> In fact, keyType and valType can be arbitrary strings.
>>> They are used to create SQL tables internally.
>>> Look at SqlQuery constructors: some of them accept "string queryType".
>>> This string must be equal to valType string in configuration.
>>>
>>> Using type name without namespace is just a convention. SqlQuery
>>> constructor with "Type queryType" argument just passes along type name
>>> string.
>>>
>>> This does not force the user to create unique classnames, because there
>>> is a separate SQL schema for each cache in Ignite.
>>> Only if you use multiple entry types in a single cache (which is not
>>> recommended by itself), and these types have the same name, there will be a
>>> collision.
>>>
>>> Sounds complicated, I know. Can't wait for 1.6 release where all of this
>>> is hidden from the user :)
>>>
>>> Let me know if you need more details.
>>>
>>> Pavel.
>>>
>>> On Mon, Apr 11, 2016 at 1:32 PM, Murthy Kakarlamudi 
>>> wrote:
>>>
 Hi Pavel,
 You are absolutely right. I had 2 config files and I indeed am
 referring to wrong version. I copied and pasted and VS and instead of
 creating a new file, it created a link. Thanks for helping me out.

 Based on your suggestion that the valueType needs to be unqualified
 without the namespace, the documentation needs an update. I was basically
 following that as an example.  But without namespace qualification, doesn't
 that force an user to create unique classnames?

 
 
 >>> value="org.apache.ignite.examples.datagrid.store.Person"/>
 


 On Mon, Apr 11, 2016 at 4:36 AM, Pavel Tupitsyn >>> > wrote:

> Satya, I can run your solution without errors with fixed config.
> This means that you don't actually use the config above for your
> nodes. Something else gets loaded for some reason.
>
> Please do the following:
> * Make sure that SpringConfigUrl points to the updated file everywhere
> you use it.
> * Replace GetOrCreateCache with GetCache. This will ensure that cache
> is retrieved from config, not started dynamically.
>
> Pavel.
>
>
> On Sun, Apr 10, 2016 at 4:48 PM, Murthy Kakarlamudi 
> wrote:
>
>> Hi Pavel...Thanks for the update. I seem to be doing something wrong.
>> I am still getting the same error even after applying the update you
>> suggested. Not sure if the way I specified the types for the columns in
>> java matched against definitions in SQL Server. I am attaching below the
>> column types from SQL Server.
>>
>> [image: Inline image 1]
>>
>> Below is the updated config xml
>> 
>>   
>> > class="org.apache.ignite.configuration.CacheConfiguration">
>>   
>>   
>>   
>>   
>>   
>>   
>> > class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
>>   > value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
>> 
>>   
>>   
>> 
>>   
>> 
>> **
>> 
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> 
>>   
>> 
>> 
>> 
>>   
>> 
>>   
>> 
>>   
>> 
>>   
>> 
>>   
>> 
>>
>> Is there a different way to spe

Re: How to load 2 tables in a cache

2016-04-11 Thread tusharnakra
I don't understand what you mean by data types? I'm talking about 2 database
tables present in the same MySql database/



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-load-2-tables-in-a-cache-tp4026p4065.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Host Arrays in C++ API

2016-04-11 Thread arthi
Hi Igor,

the SQL query for getNext() takes a whole lot of time when the results
returned is more than 900,000 both using Java and C++ API. I have tried a
number of configurations with indexes, but just dont get to speed these up.

thanks,
Arthi



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Host-Arrays-in-C-API-tp3707p4064.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to perform lazy write to database

2016-04-11 Thread tusharnakra
Thanks, I was able to test it now!

Just confirming for the final time, so if before tx.commit(), I do:
 
cache.put(k1,v1);
cache.put(k1,v2);

and then if I get k1's value: cache.get(k1), in a new thread before doing
tx.commit(), then I'll get value v2 for key k1, right? Coz in the cache
value for key k1 has been updated from v1 to v2? Am I understanding
correctly?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-perform-lazy-write-to-database-tp4002p4063.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to load 2 tables in a cache

2016-04-11 Thread Alexey Kuznetsov
@tusharnakra

You have 2 tables in MySql - the prefered way in Ignite is to load each
table in separate cache.
When you load data from MySql rows from database automatically transformed
for Java types (POJO)  and stored in caches.

Actually I described the same as Vasiliy, but with different words.

Make sense?


On Mon, Apr 11, 2016 at 9:19 PM, tusharnakra 
wrote:

> I don't understand what you mean by data types? I'm talking about 2
> database
> tables present in the same MySql database/
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/How-to-load-2-tables-in-a-cache-tp4026p4065.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com


TcpCommunicationSpi warning messages

2016-04-11 Thread kevin
Hi,

I have a 2 node cluster and I noticed the following warning messages. I
can't see any problems on a superficial level though. The cluster still
looks seemingly stable after these messages. What do the messages mean? Are
they indicative of any problems?

org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;Communication
SPI Session write timed out (consider increasing 'socketWriteTimeout'
configuration property) [remoteAddr=/xxx, writeTimeout=2000]
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;Failed to
process selector key (will close): GridSelectorNioSessionImpl
[selectorIdx=1, queueSize=1, writeBuf=java.nio.DirectByteBuffer[pos=0
lim=32768 cap=32768], readBuf=java.nio.DirectByteBuffer[pos=0 lim=32768
cap=32768], recovery=GridNioRecoveryDescriptor [acked=8768, resendCnt=0,
rcvCnt=180725, reserved=true, lastAck=180720, nodeLeft=false,
node=TcpDiscoveryNode [id=3b6bbee2-1170-4ce7-ab6c-a48da1735172,
addrs=[0:0:0:0:0:0:0:1%lo, 127.0.0.1, xxx], sockAddrs=[xxx/xxx,
/0:0:0:0:0:0:0:1%lo:47200, /127.0.0.1:47200, /xxx], discPort=47200, order=1,
intOrder=1, lastExchangeTime=1460390135500, loc=false,
ver=1.5.0#20151229-sha1:f1f8cda2, isClient=false], connected=true,
connectCnt=2, queueLimit=5120], super=GridNioSessionImpl [locAddr=/xxx,
rmtAddr=/xxx, createTime=1460390399220, closeTime=0, bytesSent=92232602,
bytesRcvd=492747831, sndSchedTime=1460390469517, lastSndTime=1460390475504,
lastRcvTime=1460390475504, readsPaused=false,
filterChain=FilterChain[filters=[GridNioCodecFilter
[parser=o.a.i.i.util.nio.GridDirectParser@15573012, directMode=true],
GridConnectionBytesVerifyFilter], accepted=true]]
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;Closing NIO
session because of unhandled exception [cls=class
o.a.i.i.util.nio.GridNioException, msg=Connection reset by peer]



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/TcpCommunicationSpi-warning-messages-tp4068.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to load 2 tables in a cache

2016-04-11 Thread tusharnakra
Yes, it makes sense! So, is there any way that the SQL JOIN relations can
work in gridgain for the 2 tables loaded in different cache?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-load-2-tables-in-a-cache-tp4026p4069.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to load 2 tables in a cache

2016-04-11 Thread Dmitriy Setrakyan
On Mon, Apr 11, 2016 at 10:29 AM, tusharnakra 
wrote:

> Yes, it makes sense! So, is there any way that the SQL JOIN relations can
> work in gridgain for the 2 tables loaded in different cache?
>

Yes, you can find the example for cross-cache join here:
https://apacheignite.readme.io/docs/sql-queries


>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/How-to-load-2-tables-in-a-cache-tp4026p4069.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: How to load 2 tables in a cache

2016-04-11 Thread tusharnakra
Hi @dsetrakyan,

Can you look into my above comment, the error that I'm getting?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-load-2-tables-in-a-cache-tp4026p4071.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: SQL gives incorrect results

2016-04-11 Thread vkulichenko
Hi Arthi,

Please make sure that you call query() method on a partitioned cache,
otherwise it can be executed locally. If this doesn't help, provide the
example to reproduce the issue. Generally your expectations are valid - if
one of the caches is replicated, you don't need to bother about affinity
collocation.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/SQL-gives-incorrect-results-tp4049p4072.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: hibernate open session error while running with tomcat server

2016-04-11 Thread vkulichenko
Hi Ravi,

This looks like exactly the same issue you were reporting earlier. You were
able to fix the classpath, right? Is it possible that the fix was not
applied somewhere?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/hibernate-open-session-error-while-running-with-tomcat-server-tp4050p4073.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How Does Ignite Create Lucene Index?

2016-04-11 Thread vkulichenko
Hi,

All indexes (both SQL and Lucene) are created on each node independently for
the data that resides locally. Ignite then uses its own mechanisms to
execute distributed queries across the cluster. There is no leader node or
router, all nodes in Ignite cluster are equal.

Did I answer your question?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-Does-Ignite-Create-Lucene-Index-tp4052p4074.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to perform lazy write to database

2016-04-11 Thread vkulichenko
In PESSIMISTIC/REPEATABLE_READ transaction (which is the default one) any
operation with a particular key will lock this key until the transaction is
committed or rolled back. So in your case the second thread will block on
get() and wait for the first transaction to finish. It will then get v2 only
if the transaction was successfully committed. For more details about
transactions refer to this page:
https://apacheignite.readme.io/docs/transactions

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-perform-lazy-write-to-database-tp4002p4076.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: ignite v 1.5.9 binary

2016-04-11 Thread vkulichenko
Hi,

Can you please properly subscribe to the mailing list so the community can
receive email notifications? Here is the instruction:
http://apache-ignite-users.70518.x6.nabble.com/mailing_list/MailingListOptions.jtp?forum=1


tony.mak wrote
> I get this when I start up ignite  1.5.6 :
> New version is available at http://www.gridgain.com/download/editions:
> 1.5.9
> 
> When I go to that link all I see is version 1.5.0-final which is older.
> Can/should I download 1.5.9 from somewhere else.

Both 1.5.6 and 1.5.9 are builds provided by GridGain as their Professional
Edition [1]. It is based on the latest Ignite which is 1.5.0.final and
provides bug fixes.

[1] http://www.gridgain.com/products/in-memory-data-fabric/editions/

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/ignite-v-1-5-9-binary-tp4067p4075.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: TcpCommunicationSpi warning messages

2016-04-11 Thread vkulichenko
Hi Kevin,

This message means that one of the messages was not successfully sent within
the timeout. Message is resent in this case and Ignite makes sure that it's
delivered. But if the warnings are frequent, it usually means that the
network is unstable or slow, which can cause performance degradation. In
this case you might consider increasing
TcpCommunicationSpi.socketWriteTimeout.

Makes sense?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/TcpCommunicationSpi-warning-messages-tp4068p4077.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to perform lazy write to database

2016-04-11 Thread tusharnakra
But, in my transaction method:

PersonKey key = new PersonKey(5);

System.out.println();
System.out.println(">>> Update salary and write-through to database
for person with ID: " + key.getId());

try (Transaction tx = ignite.transactions().txStart()) {
// Read-through from database.
Person p = cache.get(key);

System.out.println(">>> Loaded person from database: " + p);

double salary = p.getSalary();

// Raise salary by 20%.
p.setSalary(salary * 1.2);

// Write-through to database
// and store in cache.
cache.put(key, p);
System.out.println("Key: " + key + " Value: " + p + " put in
cache");

p.setSalary(salary * 2);
cache.put(key,  p);
   
System.out.println("Key: " + key + " Value: " + p + " put in
cache");




new Thread(new Runnable() {
public void run()
{
 {
System.out.println("Starting new thread...");
PersonKey k1 = new PersonKey(5);
try (Transaction tx = ignite.transactions().txStart())
{

Person v1 = cache.get(k1);
System.out.println("The value for key = 5 is: " 
+
v1);
}
 }
}
}).start();
tx.commit();
}

System.out.println(">>> Updated person: " + cache.get(key));
}

when I start the new thread and get the value of key 5, I get the new value
only, even before committing it? Why is this so?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-perform-lazy-write-to-database-tp4002p4078.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: What does mean caching database exactly ?

2016-04-11 Thread vkulichenko
Hi,

Can you please properly subscribe to the mailing list so that the community
can receive email notifications? Here is the instruction:
http://apache-ignite-users.70518.x6.nabble.com/mailing_list/MailingListOptions.jtp?forum=1


tomk wrote
> I consider caching database (postgresSQL). 
> However, I don't understand way of working ignite, although I looked for
> docs.
> Tell me please,
> Is it possible to cache into RAM table from postgres SQL and fastly answer
> to SQL queries ? The aim is make it faster to query postgres.
> I managed to establish connection with postgres (JDBC). (I separately
> created jdbc connection and create data source from that).  Now, I would
> like to cache into RAM memory entire table (using this JDBC connection) .
> Consequently, thanks to caching to memory RAM I am going to query postgres
> by SQL with low latencies.
> I am not sure if my way is good
> I am looking at  example: 
> https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc

If you run SQL in Ignite, it touches only data that is already in memory. So
you have to load the whole data set that you're going to work with into
Ignite cache prior to running the queries. But this should give you good
performance improvement.

The data can be loaded from the Postgres as well as any other storage. For
details refer to this page: https://apacheignite.readme.io/docs/data-loading

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/What-does-mean-caching-database-exactly-tp4043p4079.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to check what is loaded into cache ?

2016-04-11 Thread vkulichenko
Hi,

Can you please properly subscribe to the mailing list so that the community
can receive email notifications? Here is the instruction:
http://apache-ignite-users.70518.x6.nabble.com/mailing_list/MailingListOptions.jtp?forum=1


tomk wrote
> Is there exist any way to controlling contains of cache ? I would like to
> be able see what is loaded into cache.
> Maybe something like WebUI ?

Visor CLI utility [1] has the 'cache' command that supports this. Type 'help
"cache"' and look for '-scan' parameter.

[1] https://apacheignite.readme.io/docs/command-line-interface

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-check-what-is-loaded-into-cache-tp4054p4080.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Why does ignite not use an index ?

2016-04-11 Thread vkulichenko
Hi Arthi,

How do you know that the index is not used? Can you run EXPLAIN [1] for your
query and show the result?

[1] https://apacheignite.readme.io/docs/sql-queries#using-explain

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Why-does-ignite-not-use-an-index-tp4057p4081.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to load 2 tables in a cache

2016-04-11 Thread tusharnakra
Actually, this is what's happening:

This is the code:

package org.apache.ignite.organization;

import java.util.List;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.KeyStore.Entry;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.cache.Cache;

import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteException;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore;
import org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.transactions.Transaction;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;


public class Demo {


   static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";  
   static final String DB_URL = "jdbc:mysql://localhost/ORG";
   static final String USER = "root";
   static final String PASS = "mysql";
   
   private static class MySQLDemoStoreFactory extends
CacheJdbcPojoStoreFactory {
 //{@inheritDoc} 
 @Override public CacheJdbcPojoStore create() {


MysqlDataSource dataSource = new MysqlDataSource(); 
dataSource.setURL("jdbc:mysql://localhost/ORG"); 
dataSource.setUser("root"); 
dataSource.setPassword("mysql"); 
setDataSource(dataSource);
return super.create();

}

}

/**
 * Executes demo.
 */
public static void main(String[] args) throws IgniteException {
System.out.println(">>> Start demo...");


// Start Ignite node.
try (Ignite ignite =
Ignition.start("examples/config/example-ignite.xml")) {

CacheConfiguration cfg =
CacheConfig.cache("PCache", new
MySQLDemoStoreFactory());

try (IgniteCache pCache =
ignite.getOrCreateCache(cfg)) {
// Preload cache from database.
preload1(pCache);
}

CacheConfiguration cfg1 =
CacheConfig.cache("OrgCache", new
MySQLDemoStoreFactory());

try (IgniteCache orgCache =
ignite.getOrCreateCache(cfg1)) {
// Preload cache from database.
preload(orgCache);
}

try (IgniteCache pCache =
ignite.cache("PCache")) {


SqlFieldsQuery sql = new SqlFieldsQuery(
"select Person.first_name  "
+ "from Person, \"OrgCache\".Organization where 
"
+ "Person.orgId = Organization.orgId "
+ "and Organization.orgname = ?");
System.out.println(sql);

// Execute the query and obtain the query result cursor.
try (QueryCursor> cursor = 
pCache.query(sql.setArgs("Ignite"))) {
for (List row : cursor)
System.out.println("Person name= " + row);
}
}
}
}
private static void preload(IgniteCache
cache) {
System.out.println();
System.out.println(">>> Loading entries from Organization table.");

// Preload all person keys that are less than or equal to 3.
cache.loadCache(null, OrganizationKey.class.getName(), "select *
from organization");



for (Cache.Entry org : cache)
System.out.println(">>> Loaded Organization: " + org);
}

private static void preload1(IgniteCache cache) {
System.out.println();
System.out.println(">>> Loading entries from Person table.");

// Preload all person keys that are less than or equal to 3.
cache.loadCache(null, PersonKey.class.getName(), "select * from
person");



for (Cache.Entry person : cache)
System.out.println(">>> Loaded Person: " + person);
}

   
}

And this is the error I'm getting:

Exception in thread "main" javax.cache.CacheException: class
org.apache.ignite.IgniteException: Failed to parse query: select
Person.first_name  from Person, "OrgCache".Organization where Person.orgId =
Organization.orgId and Organization.orgname = ?
at
org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:657)
at org.apache.ignite.organization.Demo.main(D

Re: How to perform lazy write to database

2016-04-11 Thread vkulichenko
You get it after the commit. When you start a new thread, the original one
goes on and commits the transaction. The new one blocks on get(), waits for
that commit and then prints out the value.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-perform-lazy-write-to-database-tp4002p4083.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to load 2 tables in a cache

2016-04-11 Thread vkulichenko
Database first_name name should be mapped to firstName in Java object, and
you should use the Java name when executing SQL queries against the data in
memory. Can you try this?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-load-2-tables-in-a-cache-tp4026p4084.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Cross cache query on spark: schema not found

2016-04-11 Thread vkulichenko
Hi,

By default schema name is the cache name, but I don't that you set names in
CacheConfiguration. Actually, this also means that you create one cache
instead of two. Can you check this and make sure that
CacheConfiguration.setName() provides unique name for each cache?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Cross-cache-query-on-spark-schema-not-found-tp3991p4085.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: SQL gives incorrect results

2016-04-11 Thread arthi
Thanks Val.

I do use query on the partitioned cache.

Here is my config -
cip-ignite-client.xml

  

here is my query -
String sql = "SELECT distinct sid_mah_id, sid_itm_id, sid_prm_id,
sid_cha_code, sid_service, sid_itm_dist "
+ " FROM \"SHOP_ITEM_BITMAP_CACHE\".ShopItemBitmap as bitmap
JOIN \"MARKET_POD_ACV_CACHE\".MarketPodAcv as mkt "
+ "  ON mkt.MRKT_KEY = "+market+" AND  mkt.prd_id
="+period+" and bitmap.category ='"+category+"' "
+ "  and bitmap.SID_MAH_ID = mkt.CHLD_MRKT_KEY WHERE
bitmap.sid_per_id = "+period;


If I do an affinity collocation of  bitmap.SID_MAH_ID, the results look
good. But, if I dont, they are incomplete.

Thanks,
Arthi



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/SQL-gives-incorrect-results-tp4049p4086.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Apache Arrow with Ignite ?

2016-04-11 Thread vkulichenko
Hi,

Can you please properly subscribe to the mailing list so that the community
can receive email notifications? Here is the instruction:
http://apache-ignite-users.70518.x6.nabble.com/mailing_list/MailingListOptions.jtp?forum=1


limabean wrote
> One of the things I like about Apache Ignite is the way it strives to
> integrate and be a "good citizen" in the "Hadoop" / Big Data ecosystem. 
> Because of the integrations like Spark, HDFS and Kafka, Ignite becomes a
> great complimentary technology in a big data cluster.
> 
> I was wondering if there has been any discussion around Ignite Caches, the
> in memory data grid capabilities and Apache Arrow ?
> 
> The Apache Arrow site says the following:  Arrow isn’t a standalone piece
> of software but rather a component used to accelerate analytics within a
> particular system and to allow Arrow-enabled systems to exchange data with
> low overhead.
> 
> I am new enough to Apache Ignite to not understand the implications of
> leverage Apache Arrow ideas in Ignite.
> 
> Are there any thoughts on Ignite + Arrow ?

As far as I understand, Arrow works with columnar data which Ignite doesn't
support, so I don't think there is any way to integrate these two products?

Does anyone else in the community have other thoughts on this?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Apache-Arrow-with-Ignite-tp4034p4087.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: What does mean caching database exactly ?

2016-04-11 Thread vkulichenko
1. You can have a cluster consisting of several server nodes with one or more
caches storing some data. Then you can have multiple applications, each will
start a client node to connect to the same cluster and use this data. JDBC
and REST can also be used. So the answer is definitely YES, this is
possible.

2. You can do simple gets by key as well as SQL queries for more complicated
requests.

3. This link is not about read/write-through, but rather about bulk loading
of large amounts of data from DB into the cache. You should use one of two
approaches described there prior to executing SQL queries, because SQL does
not support read-through and queries only data that is already in memory.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/What-does-mean-caching-database-exactly-tp4043p4089.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How Does Ignite Create Lucene Index?

2016-04-11 Thread Level D
Thanks a lot for the answer.


But here's a new question coming from it.


What's ignite's mechanisms for executing distributed queries?


Mechanisms for distributed queries used in local mode is clear to know, how 
about mechanisms used in partitioned mode and replicate mode?


By the way, I use luke to browse the contents of a lucene index stored in disk. 
But ignite's index are always stored in cache. How can I browse it?







-- Original --
From:  "vkulichenko";;
Date:  Tue, Apr 12, 2016 03:39 AM
To:  "user"; 

Subject:  Re: How Does Ignite Create Lucene Index?



Hi,

All indexes (both SQL and Lucene) are created on each node independently for
the data that resides locally. Ignite then uses its own mechanisms to
execute distributed queries across the cluster. There is no leader node or
router, all nodes in Ignite cluster are equal.

Did I answer your question?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-Does-Ignite-Create-Lucene-Index-tp4052p4074.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How Does Ignite Create Lucene Index?

2016-04-11 Thread vkulichenko
Cache stores data, not indexes. In addition, each node has its own Lucene
engine that stores indexes that reference in-cache data that belongs to the
local node. When distributed query is executed, the request is broadcasted,
each nodes applies indexes and executes the query locally and sends results
to the client where results are reduced.

If you want to know more details, I would recommend to look through the
source code and dive deeper.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-Does-Ignite-Create-Lucene-Index-tp4052p4091.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: SQL gives incorrect results

2016-04-11 Thread vkulichenko
Arthi,

This makes me think that the second cache is not replicated due to some
misconfiguration, or something else is wrong in your code. If you want us to
take a look, please provide the whole test (ideally as a small GitHub
project). Currently it's not clear what's going on. As I said, if one the
caches is replicated, affinity should not influence the query result.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/SQL-gives-incorrect-results-tp4049p4092.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: hibernate open session error while running with tomcat server

2016-04-11 Thread Ravi Puri
yea it was fixed when i used to run the project as an individual but when i
try to integrate with other project it throws an error . as i use all the
jars to refr the othr project but stil it throws an error.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/hibernate-open-session-error-while-running-with-tomcat-server-tp4050p4093.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.