Re: Cache loading errors out

2016-03-29 Thread arthi
Thanks Denis. I could use cache.size(CachePeekMode.OFFHEAP) to the off heap
entries count.
The visor tool does not show the offheap entries though (I used cache -a to
print the detailed stats).

Just a quick check on the SQL performance. will there be noticeable
difference in SQL join query runtimes when using on heap and off heap mode
caches? I did read other posts and documentation that say off heap could be
20% slower or so - is it due to additional de-serializations that may be
required, as I understand that entries off heap are serialized.

Thanks for all your help.
Arthi



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Cache-loading-errors-out-tp3636p3759.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Failed to find mapping description [cache=PersonCache, typeId=class apache.ignite.schemas.PersonKey]. Please configure JdbcType to associate cache 'PersonCache' with JdbcPojoStore ERROR

2016-03-29 Thread Vasiliy Sisko
I found the next problems in you code:

1. In CacheConfiguration.jdbcTypePerson and
CacheConfiguration.queryEntityPerson incorrectly configured key type and
value type. Package in configuration should be equal to real package of
classes:

  jdbcType.setKeyType("apache.ignite.schemas.PersonKey"); 
  jdbcType.setValueType("apache.ignite.schemas.Person"); 

and 

  qryEntity.setKeyType("apache.ignite.schemas.PersonKey"); 
  qryEntity.setValueType("apache.ignite.schemas.Person"); 

2. You should use MySql database instead of H2 datasource. Try next example
to configure MySql datasource in MySQLDemoStoreFactory class:

  MysqlDataSource dataSource = new MysqlDataSource();
  dataSource.setURL("jdbc:mysql://localhost/PERSON");
  dataSource.setUser("root");
  dataSource.setPassword("mysql");
  setDataSource(dataSource);

3. I found that MySql database is case sensitive that means that schema
names and table names should be configured in the same register as in
database (I use upper case, but you should check your database script):

  jdbcType.setDatabaseTable("PERSON");

Possibly for query execution database field should be checked for case
sensitivity too.




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Failed-to-find-mapping-description-cache-PersonCache-typeId-class-apache-ignite-schemas-PersonKey-PlR-tp3725p3758.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Cache loading errors out

2016-03-29 Thread Denis Magda

Hi Arthi,

/I re-ran the tests with offheap tiered settings, and it looked very 
neat. The heap usage was around 300MB./


//This is because all your cache data presently located out of Java heap 
in the offheap space [1]
Offheap is very useful for cases when Java heap tends to grow to tens 
and hundreds of gigabytes due to big amount of data stored in caches. 
Big Java heaps are quite difficult and not always possible to tune which 
leads to long GC pauses.


You can check the overall memory consumption using "top" or similar 
command on Linux. Also you have IgniteCache.size(OFFHEAP!PRIMARY) at you 
service.
Finally you can connect to the cluster with ignitevisorcmd.sh/bat and 
look at the cache total size, offheap portion, etc.


[1] https://apacheignite.readme.io/docs/off-heap-memory

--
Denis

On 3/29/2016 9:13 PM, arthi wrote:

hi Denis,

I re-ran the tests with offheap tiered settings, and it looked very neat.
The heap usage was around 300MB. Please find the hist attached. I could not
take a profiler snapshot as it is a remote application and uses Java 7.

Thanks again,
Arthi

hist3328.1




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Cache-loading-errors-out-tp3636p3745.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.




Re: ignite not support expression: EXISTS?

2016-03-29 Thread minisoft_rm
dear experts, still no response for this question. So I guess ignite
currently doesn't support the "EXISTS".
do we have any plan or jira# to track it so that we could implement it in a
later version?

thanks ~~



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/ignite-not-support-expression-EXISTS-tp3711p3755.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Ignite terminology

2016-03-29 Thread vkulichenko
Alexander,

It's weird that you get NULL instead of the set of nodes. Regardless of the
grid name it should return all nodes in the topology. Are you sure that
nodes discover each other? Maybe you have the simple test that reproduces
it?

Answering your questions:
1. Correct.
2. Ignite instance has the name. Essentially, this is the key of the static
map used inside of Ignition class. So if there is only one node per JVM, the
name should not change anything.
3. Correct.

-Val



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


Re: Ignite Cache and Compute Performance

2016-03-29 Thread abarbaro
A couple of things to clarify the request/question about an API to iterate
over cache entries on given partitions:
   a) I'm only talking about iterating locally (i.e. it will only iterate on
the localEntries).
   b) In terms of semantics, I was thinking about overload for the existing
localEntries method
 for (Entry entry :
Ignition.localIgnite().cache(cacheName).localEntries(partitions,
CachePeekMode.PRIMARY))
   
   where partitions is an int[] that contains the partitions to iterate
over. 


I'm not suggesting an implementation, but simply trying to clarify my
previous comment.

Andres
 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Cache-and-Compute-Performance-tp3722p3752.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to load cache when reading data from txt files

2016-03-29 Thread vkulichenko
Hi,

Can you please try a different email to subscribe?

For information on how to load the cache from a persistence store please
refer to this page: https://apacheignite.readme.io/docs/data-loading

You have two options:
1. Start a client node, create IgniteDataStreamer and use it to load the
data. Simply call addData() for each line in the file.
2. Implement CacheStore.loadCache() method, provide the implementation in
the cache configuration and call IgniteCache.loadCache().

Second approach will require to have the file on all server nodes, by there
will be no communication between nodes, so most likely it will be faster.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-load-cache-when-reading-data-from-txt-files-tp3747p3751.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


How to load cache when reading data from txt files

2016-03-29 Thread tusharnakra
Hi,

I created a file helloworld.txt. Now I'm reading from the file and then I
want to load the contents of the file into the cache, and whenever the cache
is updated, it should write to the file as well.

This is my code so far:

Please tell me what to do to load the cache and then write from the cache to
the file, as the instructions are not clear from your documentation.

(Also, I have clicked on the subscribe button so many times but I haven't
got any confirmation email in the past 24 hours)

package apache.ignite.schemas;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;

public class File {

public static void main(String[] args) {
   
FileRead();
FileWrite();
}
   
public static void FileRead()
{
try {
 BufferedReader in = new BufferedReader
 (new FileReader("/Desktop/helloworld.txt"));
 String str;
 while ((str = in.readLine()) != null) {
System.out.println(str);
 }
 System.out.println(str);
 }
 catch (IOException e) {
 }
  }
   
public static void FileWrite() {
try {
   
Files.write(Paths.get("/Desktop/helloworld.txt"), "Hello World".getBytes(),
StandardOpenOption.APPEND);
}catch (IOException e) {
//exception handling left as an exercise for the
reader
}
}
}



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-load-cache-when-reading-data-from-txt-files-tp3750.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Failed to find mapping description [cache=PersonCache, typeId=class apache.ignite.schemas.PersonKey]. Please configure JdbcType to associate cache 'PersonCache' with JdbcPojoStore ERROR

2016-03-29 Thread tusharnakra
Hi,

I have that in my generated CacheConfig file, but still the error shows. I
have also tried this with H2 database and it works fine, but I wanna use
Mysql, and it is giving me this mapping error.

Here's my CacheConfig.java :

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package apache.ignite.schemas;

import java.sql.*;
import java.util.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.store.jdbc.*;
import org.apache.ignite.configuration.*;

/**
 * CacheConfig definition.
 *
 * Code generated by Apache Ignite Schema Import utility: 03/28/2016.
 */
public class CacheConfig {
/**
 * Create JDBC type for Person.
 *
 * @param cacheName Cache name.
 * @return Configured JDBC type.
 */
private static JdbcType jdbcTypePerson(String cacheName) {
JdbcType jdbcType = new JdbcType();

jdbcType.setCacheName(cacheName);
jdbcType.setDatabaseSchema("PERSON");
jdbcType.setDatabaseTable("Person");
jdbcType.setKeyType("org.apache.ignite.schema.PersonKey");
jdbcType.setValueType("org.apache.ignite.schema.Person");

// Key fields for Person.
Collection keys = new ArrayList<>();
keys.add(new JdbcTypeField(Types.INTEGER, "id", int.class, "id"));
jdbcType.setKeyFields(keys.toArray(new JdbcTypeField[keys.size()]));

// Value fields for Person.
Collection vals = new ArrayList<>();
vals.add(new JdbcTypeField(Types.INTEGER, "id", int.class, "id"));
vals.add(new JdbcTypeField(Types.VARCHAR, "first_name",
String.class, "firstName"));
vals.add(new JdbcTypeField(Types.VARCHAR, "last_name", String.class,
"lastName"));
vals.add(new JdbcTypeField(Types.DOUBLE, "salary", double.class,
"salary"));
jdbcType.setValueFields(vals.toArray(new
JdbcTypeField[vals.size()]));

return jdbcType;
}

/**
 * Create SQL Query descriptor for Person.
 *
 * @return Configured query entity.
 */
private static QueryEntity queryEntityPerson() {
QueryEntity qryEntity = new QueryEntity();

qryEntity.setKeyType("org.apache.ignite.schema.PersonKey");
qryEntity.setValueType("org.apache.ignite.schema.Person");

// Query fields for Person.
LinkedHashMap fields = new LinkedHashMap<>();

fields.put("id", "int");
fields.put("firstName", "String");
fields.put("lastName", "String");
fields.put("salary", "double");

qryEntity.setFields(fields);

// Indexes for Person.
Collection idxs = new ArrayList<>();

idxs.add(new QueryIndex("id", true, "PRIMARY"));

qryEntity.setIndexes(idxs);

return qryEntity;
}

/**
 * Configure cache.
 *
 * @param cacheName Cache name.
 * @param storeFactory Cache store factory.
 * @return Cache configuration.
 */
public static  CacheConfiguration cache(String cacheName,
CacheJdbcPojoStoreFactory storeFactory) {
if (storeFactory == null)
 throw new IllegalArgumentException("Cache store factory cannot
be null.");

CacheConfiguration ccfg = new CacheConfiguration<>(cacheName);

ccfg.setCacheStoreFactory(storeFactory);
ccfg.setReadThrough(true);
ccfg.setWriteThrough(true);

// Configure JDBC types.
Collection jdbcTypes = new ArrayList<>();

jdbcTypes.add(jdbcTypePerson(cacheName));

storeFactory.setTypes(jdbcTypes.toArray(new
JdbcType[jdbcTypes.size()]));

// Configure query entities.
Collection qryEntities = new ArrayList<>();

qryEntities.add(queryEntityPerson());

ccfg.setQueryEntities(qryEntities);

return ccfg;
}
}

Here's the Person.java :

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *  

Re: Ignite Cache and Compute Performance

2016-03-29 Thread abarbaro
Vladimir

First, thank you for your reply - it was very quick and insightful!

I agree with you that comparing to in-JVM is not a fair comparison.  I'm
only using that as the absolute upper-bound for performance; in other words,
the closer we are to that the better.

I have tried your (very good) suggestions, with mixed results.

*1)* Setting *CacheConfiguration.copyOnRead* flag to "false".  This helped
quite a bit - almost 2X performance improvement.

*2)* I have the recommended Ignite JVM optimizations and they seem to be
working well, no major GC pauses.

*3)* *Using Compute Tasks as opposed to broadcast()*.   Great suggestion,
and I must say Ignite's API is super intuitive and powerful for map-reduce. 
I implemented this as follows:  each server node now gets a number of jobs
(I made the degree of parallelism is configurable through a jvm property to
make it easy to test).  Each job will compute the value based on the local
cache partitions it gets assigned (I use the affinity API to get the cache
partitions on each node).  I can see this as being very powerful for
big-data caches.  The optimal number of jobs per node is between 2 and 4 for
my tests (If I increase it to say 8-16 there's a lot of resource contention
and performance degrades).  The only minor disadvantage over broadcast() is
that I notice the messages take more to get back to the client node (in the
order of 100 millis as opposed to 10 millis with broadcast).

*4) *Unfortunately, *the ScanQuery API is much slower than the Entry
iteration* for me.  I can't understand why.  I did some profiling and it
looks like the ScanQuery does go through a lot more layers of code and it
does a lot more work than the iterator.   Can you tell me what can cause
this?
Also, when I tried the iterator with multiple tasks on the same node, there
was a lot of blocking, so actually broadcast() (i.e. 1 task per node) was
much faster.

It would be super nice if there were a way to iterate through the entries on
a given partition, just like there is a way to assign a partition to the
ScanQuery.  How can I accomplish this?

I'm attaching the updated source code and classes jar so you can try this on
your end.

Again, thanks so much for your help, and I hope you can provide me some
further insight regarding the ScanQuery / Iteration over partitions.


Andres

ignite_test_src.jar
 
 

inventory_cache_compute.jar

  



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Cache-and-Compute-Performance-tp3722p3748.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Ignite terminology

2016-03-29 Thread alexGalushka
Val, 

Thank you for your response. Here is my simple use-case for POC to evaluate
Apache Ignire I'm currently working on, which have generated the Apache
Ignite terminology question.

My setup: VM {Ubuntu 15.04; 4 cores}, 2 docker containers (each has its own
JVM, each deploys its own Vert.x clustered instance with Apache Ignite as a
cluster manager, I use multicast for node discovery). Whenever you start the
Vert.x instance, Ignite.start() is called, so I the Ignite instance is
created. The idea is to have each node to get the list of nodes in the
cluster, I've tried 3 different ways:

First, Ignition.localIgnite().cluster().nodes() returns NULL
In javadoc to localignite it says: "According to contract this method has to
be called only under IgniteThread. An IllegalArgumentException will be
thrown otherwise."

Second, Ignition.ignite(UUID.fromString(nodeID)).cluster().nodes() - same
result
But, I have an interesting finding from the javadoc: "Note that grid
instance and local node have one-to-one relationship *where node has ID and
instance has name of the grid to which both grid instance and its node
belong*."
So per this javadoc there is a grid (cluster) name, it's not a node name,
it's a name of the cluster which node belongs to!

Third, I've added this: to ignite xml config file 

To get all the nodes which belong (assuming that the javadoc is correct) to
the grid with name "APPLIANCE":

System.out.println("Here are the nodes in the APPLIANCE : "
+ Ignition.localIgnite().cluster().nodes()
.stream().map(node ->
node.id()).collect(Collectors.toList()).toString());

It returns the expected result!



Val, now back to your reply, I need a few clarifications:

1. When you say topology you mean the net of nodes, which is the cluster as
I see it correct?
2. Node doesn't have a name, it has a unique ID, the grid (cluster) does
have name, correct?
3. The discovered nodes define the cluster, so if nodes see each other they
form the cluster (and it's defined by discovery SPI), correct?

Thank you all your help, guys!!!

--Alexander
   



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


Re: Cache loading errors out

2016-03-29 Thread arthi
hi Denis,

I re-ran the tests with offheap tiered settings, and it looked very neat.
The heap usage was around 300MB. Please find the hist attached. I could not
take a profiler snapshot as it is a remote application and uses Java 7.

Thanks again,
Arthi

hist3328.1
  



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Cache-loading-errors-out-tp3636p3745.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


RE: get a Affinity interface

2016-03-29 Thread Shaomin Zhang
Thank you Vladimir.

From: Vladimir Ozerov [mailto:voze...@gridgain.com]
Sent: 29 March 2016 12:51
To: user@ignite.apache.org
Subject: Re: get a Affinity interface

Hi Shaomin,

This method is located on Ignite interface.

Vladimir.

On Tue, Mar 29, 2016 at 1:26 PM, Shaomin Zhang 
> wrote:
Hi

I am trying to get an Affinity interface to get node/partition/key information. 
The Java doc page says you can get such interface by calling Cache.affinity(). 
I try to use IgniteCache interface, but it has no such method.

Can you please let me know how to get this interface?

Thanks

Shaomin Zhang

_

This email, its contents, and any attachments transmitted with it are intended 
only for the addressee(s) and may be confidential and legally privileged. We do 
not waive any confidentiality by misdelivery. If you have received this email 
in error, please notify the sender immediately and delete it. You should not 
copy it, forward it or otherwise use the contents, attachments or information 
in any way. Any liability for viruses is excluded to the fullest extent 
permitted by law.

Tudor Capital Europe LLP (TCE) is authorised and regulated by The Financial 
Conduct Authority (the FCA). TCE is registered as a limited liability 
partnership in England and Wales No: OC340673 with its registered office at 10 
New Burlington Street, London, W1S 3BE, United Kingdom


_

This email, its contents, and any attachments transmitted with it are intended 
only for the addressee(s) and may be confidential and legally privileged. We do 
not waive any confidentiality by misdelivery. If you have received this email 
in error, please notify the sender immediately and delete it. You should not 
copy it, forward it or otherwise use the contents, attachments or information 
in any way. Any liability for viruses is excluded to the fullest extent 
permitted by law.

Tudor Capital Europe LLP (TCE) is authorised and regulated by The Financial 
Conduct Authority (the FCA). TCE is registered as a limited liability 
partnership in England and Wales No: OC340673 with its registered office at 10 
New Burlington Street, London, W1S 3BE, United Kingdom


Re: Cache loading errors out

2016-03-29 Thread Denis Magda

Arthi,

Please create a memory snapshot using visual VM profiler [1] and share 
it with us. I need to see roots that holds the rest of the memory.


[1] https://visualvm.java.net/snapshots.html

Regards,
Denis

On 3/29/2016 4:17 PM, arthi wrote:

Thanks Denis.

I changed the long into int for keys and also the object fields.
The memory for each bitmap object is about 160-200 bytes.
I can see that the memory footprint for all objects and keys comes to around
6.1 GB.

The rest of the memory is still around 5GB. Can this be reduced?
There is no backup for the cache.

thanks,
Arthi



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Cache-loading-errors-out-tp3636p3741.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.




Re: Cache loading errors out

2016-03-29 Thread arthi
Thanks Denis.

I changed the long into int for keys and also the object fields.
The memory for each bitmap object is about 160-200 bytes.
I can see that the memory footprint for all objects and keys comes to around
6.1 GB.

The rest of the memory is still around 5GB. Can this be reduced?
There is no backup for the cache.

thanks,
Arthi



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Cache-loading-errors-out-tp3636p3741.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Host Arrays in C++ API

2016-03-29 Thread arthi
thanks Igor. I will wait for your response.. Thanks for the help, Arthi



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


Re: get a Affinity interface

2016-03-29 Thread Vladimir Ozerov
Hi Shaomin,

This method is located on *Ignite* interface.

Vladimir.

On Tue, Mar 29, 2016 at 1:26 PM, Shaomin Zhang 
wrote:

> Hi
>
>
>
> I am trying to get an Affinity interface to get node/partition/key
> information. The Java doc page says you can get such interface by calling
> Cache.affinity(). I try to use IgniteCache interface, but it has no such
> method.
>
>
>
> Can you please let me know how to get this interface?
>
>
>
> Thanks
>
>
>
> Shaomin Zhang
>
> _
>
> This email, its contents, and any attachments transmitted with it are
> intended only for the addressee(s) and may be confidential and legally
> privileged. We do not waive any confidentiality by misdelivery. If you have
> received this email in error, please notify the sender immediately and
> delete it. You should not copy it, forward it or otherwise use the
> contents, attachments or information in any way. Any liability for viruses
> is excluded to the fullest extent permitted by law.
>
> Tudor Capital Europe LLP (TCE) is authorised and regulated by The
> Financial Conduct Authority (the FCA). TCE is registered as a limited
> liability partnership in England and Wales No: OC340673 with its registered
> office at 10 New Burlington Street, London, W1S 3BE, United Kingdom
>


Re: Ignite Cache and Compute Performance

2016-03-29 Thread Vladimir Ozerov
Hi,

I hardly can find this comparison fair. HashMap is plain non-thread safe
hashed map. Ignite is tread-safe, distributed cache with optional
transactions, evictions, expiration and so on. I would suggest you do the
following to improve numbers:
1) Set *CacheConfiguration.copyOnRead* flag to "false". This way you will
get rid of additional serializations which are not needed in your case.
2) Ensure you have enough heap so that GC doesn't stall your application
for a long time.
3) You use *IgniteCompute.broadcast()* which will execute the closure only
once, meaning that only one thread will perform calculation. This is not
common scenario for Ignite. Instead, it is better to use fully-fledged
map-reduce which will produce multiple jobs and utilize as much system
resources as possible. See *ComputeTaskMapExample*.
4) Instead of using iterator, it is better to use *ScanQuery* and it's
ability to scan particular cache partitions (method
*ScanQuery.setPartition()*). See *CacheQueryExample*.

Please let me know if you need any further assistance.

Vladimir.

On Tue, Mar 29, 2016 at 12:33 AM, abarbaro  wrote:

> Hello Ignite Community
>
> I'm trying to evaluate the performance of Ignite Cache and Distributed
> Computing.  To do so, I have set up a very simple example that is a
> simplification of the real-life examples for which we plan to use Ignite.
> To my surprise, the results show that Ignite is a significantly slower than
> I expected, and I would like to get some help with configuration and/or
> tuning to improve performance.
>
> Here's the example:  We have a warehouse that has 10,000,000 Inventory
> Items.  Each Item has a product Id, a quantity, and a price.  The sample
> computation is to calculate the Total Value of the inventory, which is
> SUM(i, Item[i].quantity * Item[i].price) (i.e. the sum of the value of each
> item).  The real-life is large-scale would have billions of entries per
> cache and more complex calculations.
>
> For the test, I have a single cache, with 10,000,000 entries, using pretty
> much Ignite's standard configuration with a few tweaks.  For only
> 10,000,000
> items, I would have expected this calculation to perform in a matter of few
> hundreds of milliseconds; however, the results for Ignite are almost 2
> order
> of magnitude slower are much slower (5,000 - 12,000 millis).  I have also a
> test that shows that when running this on the same JVM and using HashMap as
> the cache, the computation takes 92 millis.
>
> Also, the amount of memory overhead is very significant: the 10,000,000
> require almost 4 GB of heap on the Ignite node (single-node cluster),
> versus
> 1GB of heap when running within a JVM and using HashMap.
>
> Can you provide any guidance as to how to improve the performance of Ignite
> Cache + Compute for this simple case?  I'm attaching the code, and the
> corresponding configuration and settings.  I understand that there will be
> some overhead when using a distributed data grid as opposed to a HashMap on
> the same JVM, so I don't expect to get the same performance, but I would
> like to get as close as possible.
>
> Thanks so much in advance!
>
>
> *JVM Settings*
> JVM_OPTS=-Xms2048m -Xmx2048m -server -XX:+AggressiveOpts
> -XX:MaxPermSize=256m
> set JVM_OPTS=%JVM_OPTS% -DIGNITE_ATOMIC_CACHE_DELETE_HISTORY_SIZE=1000
> set JVM_OPTS=%JVM_OPTS% -XX:+UseParNewGC -XX:+UseConcMarkSweepGC
> -XX:+UseTLAB -XX:NewSize=128m -XX:MaxNewSize=128m
> set JVM_OPTS=%JVM_OPTS% -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=1024
> -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60
>
>
> *Attachements*
>
> default-config.xml
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n3722/default-config.xml
> >
>
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n3722/Ignite_Performance_Analysis_1-Server_Node.png
> >
>
> Ignite_Performance_Analysis_Results.txt
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n3722/Ignite_Performance_Analysis_Results.txt
> >
>
> inventory_cache_compute.jar
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n3722/inventory_cache_compute.jar
> >
>
> CacheComputeTest.java
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n3722/CacheComputeTest.java
> >
> InventoryItem.java
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n3722/InventoryItem.java
> >
> InventoryValueCompute.java
> <
> http://apache-ignite-users.70518.x6.nabble.com/file/n3722/InventoryValueCompute.java
> >
>
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-Cache-and-Compute-Performance-tp3722.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: SqlQuery Error

2016-03-29 Thread Vladimir Ozerov
Hi Tony,

It looks like you should use "Test*t*able1", not "Test*T*able1".

Vladimir.

On Mon, Mar 28, 2016 at 4:46 PM, 16616...@qq.com <16616...@qq.com> wrote:

> hi yakov,
>
> Thank you very much for you reply.
> Now I can execute sql query and fields query correctly.
>
> But I still can not execute sql query by rest api. For example:
>
>
> http://localhost:8080/ignite?cmd=qryfldexe=TestTable1Cache=select+id+from++testtable1
>
> no data response.
>
>
> http://localhost:8080/ignite?cmd=qryexe=TestTable1=10=TestTable1Cache=2=id%3d%3f
>
> {"error":"class org.apache.ignite.IgniteException: Failed to find SQL table
> for type: TestTable1","response":null,"sessionToken":"","successStatus":1}
>
> Any advice?  Thanks.
>
> Tony
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/SqlQuery-Error-tp3658p3708.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


get a Affinity interface

2016-03-29 Thread Shaomin Zhang
Hi

I am trying to get an Affinity interface to get node/partition/key information. 
The Java doc page says you can get such interface by calling Cache.affinity(). 
I try to use IgniteCache interface, but it has no such method.

Can you please let me know how to get this interface?

Thanks

Shaomin Zhang

_

This email, its contents, and any attachments transmitted with it are intended 
only for the addressee(s) and may be confidential and legally privileged. We do 
not waive any confidentiality by misdelivery. If you have received this email 
in error, please notify the sender immediately and delete it. You should not 
copy it, forward it or otherwise use the contents, attachments or information 
in any way. Any liability for viruses is excluded to the fullest extent 
permitted by law.

Tudor Capital Europe LLP (TCE) is authorised and regulated by The Financial 
Conduct Authority (the FCA). TCE is registered as a limited liability 
partnership in England and Wales No: OC340673 with its registered office at 10 
New Burlington Street, London, W1S 3BE, United Kingdom


How to script with visor cli?

2016-03-29 Thread tracel
Hi,

I am trying to write some script with the visor cli,
my first attempt is to connect visor to a cluster with a custom config, then
do a "cache" command

Visor seems don't allow both -cfg and -e:

# bin/ignitevisorcmd.sh -cfg=config/test-one.xml -e=cache
OpenJDK Server VM warning: ignoring option MaxPermSize=128M; support was
removed in 8.0
(wrn) : Options can't contains both -cfg and one of -b or -e
options.

Then I try put both "open" and "cache" into -e:

# bin/ignitevisorcmd.sh -e="open -cpath=config/test-one.xml";"cache"
OpenJDK Server VM warning: ignoring option MaxPermSize=128M; support was
removed in 8.0
____ 
__ |  / /  _/__  ___/__  __ \___  __ \
__ | / /  __  /  _ \ _  / / /__  /_/ /
__ |/ /  __/ /   / / / /_/ / _  _, _/
_/   /___/   //  \/  /_/ |_|

ADMIN CONSOLE
2015 Copyright(C) Apache Software Foundation

++
| Status  | Disconnected |
| Grid name   | |
| Config path | |
| Uptime  | |
++

Type 'help' for more information.
Type 'open' to join the grid.
Type 'quit' to quit form Visor console.

visor> open
Local configuration files:
   
++
| #  |Configuration File

|
   
++
| 0  | config/default-config.xml

|
| 1  | (?) config/router/default-router.xml 

|
| 2  | config/test-one.xml  

|
| 3  | examples/config/example-cache.xml

|
| 4  | examples/config/example-default.xml  

|
| 5  | (?) examples/config/example-ignite.xml   

|
| 6  | examples/config/filesystem/example-igfs.xml  

|
| 7  |
examples/src/main/java/org/apache/ignite/examples/misc/springbean/spring-bean.xml
|
| 8  | platforms/cpp/examples/config/example-cache.xml  

|
| 9  | platforms/dotnet/examples/Config/example-cache-query.xml 

|
| 10 | platforms/dotnet/examples/Config/example-cache-store.xml 

|
| 11 | platforms/dotnet/examples/Config/example-cache.xml   

|
| 12 | platforms/dotnet/examples/Config/example-compute.xml 

|
   
++

Choose configuration file number ('c' to cancel) [0]: quit

(wrn) : Invalid selection: quit
visor> -bash: cache: command not found

It seems the visor was running the 'open' without the -cpath option, what's
wrong with the command?

Thanks in advance!





--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-script-with-visor-cli-tp3733.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


How to setup alert recipients in visor cli?

2016-03-29 Thread tracel
Hi,

I found in visor command line interface one can register alerts, but how can
I set the alert recipients?

thanks in advance!



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-setup-alert-recipients-in-visor-cli-tp3732.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: ignite not support expression: EXISTS?

2016-03-29 Thread minisoft_rm
I would like to append more details now  

I realised there are two ways to query cache data:
1. by SqlFieldsQuery related approach
2. by "org.apache.ignite.IgniteJdbcDriver", which could give us standard
ResultSet, it is really cool. so that we could treat ignite as a real
in-memory DB, please correct me...


BUT, why not support "EXISTS" clause... ;-(..??



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/ignite-not-support-expression-EXISTS-tp3711p3730.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Hibernate loadcache error?

2016-03-29 Thread Ravi Puri
thanks I rectified the error. 

antlr.jar was missing. :)

 



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


Re: Hibernate loadcache error?

2016-03-29 Thread vkulichenko
Ravi,

I have no idea about specifics of your project. The example that is included
in Ignite is a part of working project and it does work properly. I will not
be able to provide anything above that without knowing how your application
works. Do you have a project that you can show and that we can use to
reproduce the issue?

Are you using Spring in your Web application? It has modules that depend on
Hibernate (e.g. 'spring-orm'), and having them together with Ignite can
cause version conflict (see SO link I provided earlier). Did you check this?

-Val



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