Re: how to automatically exit JVM when the node stops?

2016-08-30 Thread Kamal C
Implement the Ignite LifeCycleBean [1] and stop the JVM on receiving the
event [2]

[1]:
https://ignite.apache.org/releases/mobile/org/apache/ignite/lifecycle/LifecycleBean.html
[2]:
https://ignite.apache.org/releases/mobile/org/apache/ignite/lifecycle/LifecycleEventType.html#AFTER_NODE_STOP

-- Kamal

On Tue, Aug 30, 2016 at 3:31 AM, vkulichenko 
wrote:

> Hi,
>
> I don't think there is a generic solution for cases when an Ignite node is
> embedded into other application. You will always need to figure out what to
> do with other components of this application. You can listen to Ignite
> events (e.g., EVT_NODE_SEGMENTED) and act accordingly in the listener.
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/how-to-automatically-exit-JVM-when-
> the-node-stops-tp7372p7389.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: How do I know the cache rebalance is finished?

2016-08-30 Thread Kamal C
Bumping up this thread. I've a similar requirement. What is the outcome of
this thread ?

My cache re-balance mode is Synchronous. How to know the cache re-balance
is completed ?

-- Kamal

On Fri, Jun 24, 2016 at 2:25 PM, Vladislav Pyatkov 
wrote:

> Hello, Andrew.
>
> You are right.
>
> I have created issue https://issues.apache.org/jira/browse/IGNITE-3362.
> You can track issue in the JIRA ticket.
>
> On Fri, Jun 24, 2016 at 7:34 AM, Andrew  wrote:
>
>> Hello, Denis.
>>
>> Did you check my sample code?
>>
>> And I have another question.
>> On testing with my sample code above,
>> when a new node is joined, as I don't complete executing received event,
>> ignite does not finish rebalance.
>> For example,
>> If I put a line of code to sample test code which I attached before like
>> below, then ignite does not complete rebalancing(more exactly, getting
>> affinity returns old partition information) until the event listener
>> thread
>> wakes up.
>>
>> I expected the event listener thread is a separated behavior against
>> rebalance process.
>> So, I'm confused now.
>> Am I thinking in a wrong way?
>> I need some advice.
>>
>>
>> =
>> if (isClient != null && !isClient
>> && cacheEvt.cacheName().equals(CACHE_NAME)
>> && (cacheEvt.discoveryEventType() ==
>> EventType.EVT_NODE_JOINED
>> || cacheEvt.discoveryEventType() ==
>> EventType.EVT_NODE_LEFT
>> || cacheEvt.discoveryEventType() ==
>> EventType.EVT_NODE_FAILED)) {
>>
>> //Rebalance has been finished?
>> System.out.println("Rebalance stopped.");
>>
>>
>> /*  //Put thread sleep
>> Thread.sleep(1);*/
>>
>>
>> Affinity aff = ignite.affinity(CACHE_NAME);
>> int[] partitions = aff.primaryPartitions(ignite.
>> cluster().localNode());
>> System.out.println("Current partitions : " +
>> Arrays.toString(partitions));
>>
>> ===
>>
>> Sincerely,
>> Andrew
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.
>> 70518.x6.nabble.com/How-do-I-know-the-cache-rebalance-is-
>> finished-tp5219p5853.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Vladislav Pyatkov
>


Re: Cassandra - Ignite Exception

2016-08-16 Thread Kamal C
(ThreadPoolExecutor.java:1145)
[?:1.7.0_40]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[?:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [?:1.7.0_40]

Val,

I've posted the same issue in the Cassandra forums
http://www.mail-archive.com/user@cassandra.apache.org/msg48370.html

Regards,
Kamal C


On Sat, Aug 13, 2016 at 2:39 AM, Igor Rudyak <irud...@gmail.com> wrote:

> Hi Kamal,
>
> Do you have this problem on Ignite-Cassandra module side or on Cassandra
> nodes side? If you have it on Ignite-Cassandra module side that could be
> because of this:  https://issues.apache.org/jira/browse/CASSANDRA-8387.
> It sometimes happen when you start from clean Cassandra cluster without any
> keyspaces/tables to store your Ignite caches.
>
> In this situation Ignite-Cassandra module tries to create new
> keyspaces/tables in Cassandra and executes CQL statements like "create
> table  if not exists". According to the Cassandra ticket above, when
> statement like "create table" is executed simultaneously from multiple
> clients (Ignite nodes in our case) it could cause such an error in the log.
>
>
>
> Regards,
> Igor Rudyak
>
> On Fri, Aug 12, 2016 at 12:20 PM, vkulichenko <
> valentin.kuliche...@gmail.com> wrote:
>
>> Hi Kamal,
>>
>> I would ask on the Cassandra forum about this. Can you do this? The
>> exception looks very weird to me, because it complains about the mismatch,
>> but the IDs are actually equal:
>>
>> org.apache.cassandra.exceptions.ConfigurationException: Column family ID
>> mismatch (found b2b47bf0-5f94-11e6-867a-cb7bb92c; expected
>> b2b1bcd0-5f94-11e6-867a-cb7bb92c)
>>
>> -Val
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/Cassandra-Ignite-Exception-tp7013p7024.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>


Re: Ignite Compute - Rebalance Scenario

2016-08-16 Thread Kamal C
Vladislav,

Partitions are moved to another node while executing the job.

Val,

I've tried with the latest nighty build. Still, it has the same behavior.
To reproduce the issue, I've used `while(true)` inside the IgniteRunnable
task. You can reproduce it with the below gist[1].

[1]: https://gist.github.com/Kamal15/0a4066de152b8ebc856fc264f7b4037d

Regards,
Kamal C

On Sat, Aug 13, 2016 at 12:15 AM, vkulichenko <valentin.kuliche...@gmail.com
> wrote:

> Note that this was changed recently [1] and the change was not released in
> 1.7. Kamal, can you try the nightly build [2] and check if it works as you
> expect there?
>
> [1] https://issues.apache.org/jira/browse/IGNITE-2310
> [2]
> https://builds.apache.org/view/H-L/view/Ignite/job/Ignite-nightly/
> lastSuccessfulBuild/
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Ignite-Compute-Rebalance-Scenario-tp7004p7021.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Cassandra - Ignite Exception

2016-08-12 Thread Kamal C
]
at
org.apache.cassandra.service.MigrationManager.announce(MigrationManager.java:514)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.service.MigrationManager.announceNewColumnFamily(MigrationManager.java:343)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.service.MigrationManager.announceNewColumnFamily(MigrationManager.java:313)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.cql3.statements.CreateTableStatement.announceMigration(CreateTableStatement.java:89)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:93)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:208)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:239)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:224)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:115)
~[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:507)
[apache-cassandra-3.7.jar:3.7]
at
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:401)
[apache-cassandra-3.7.jar:3.7]
at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
[netty-all-4.0.36.Final.jar:4.0.36.Final]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292)
[netty-all-4.0.36.Final.jar:4.0.36.Final]
at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
[netty-all-4.0.36.Final.jar:4.0.36.Final]
at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:283)
[netty-all-4.0.36.Final.jar:4.0.36.Final]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[na:1.8.0_45]
at
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
[apache-cassandra-3.7.jar:3.7]
at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105)
[apache-cassandra-3.7.jar:3.7]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

Is anyone faced similar exceptions ? How to resolve it ?

Regards,
Kamal C


Ignite Compute - Rebalance Scenario

2016-08-12 Thread Kamal C
Hi all,

I'm using IgniteCompute#affinityRun(cacheName, key, runnable) to
execute the tasks where the data resides. If cache rebalance happens in the
middle of task execution, then the task is not aware of the rebalance. Is
there any provision available to interrupt the task ?

I would like to throw `ComputeJobFailOverException` if interrupted.

Regards,
Kamal C


Re: Ignite Semaphore Exception

2016-08-04 Thread Kamal C
After enabling the Atomic backups to "1". It worked. Thanks Ross!

Regards,
Kamal

On Thu, Aug 4, 2016 at 2:03 PM, ross.anderson 
wrote:

> Hi Kamal, I think I found something similar yesterday.
>
> In your Ignite configuration, try setting Atomic backups to 1 (it defaults
> to 0, so when the node where it resides goes down it is lost)
>
> See the bottom of this page:
> http://apacheignite.gridgain.org/docs/atomic-types
>
> Best,
> Ross
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Ignite-Semaphore-Exception-tp6736p6741.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Ignite Semaphore Exception

2016-08-04 Thread Kamal C
Hi all,

I'm facing the below exception while using the Ignite Semaphore.

Exception in thread "main" class org.apache.ignite.IgniteException: Failed
to find semaphore with given name: Hello
at
org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:906)
at
org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl$Sync.compareAndSetGlobalState(GridCacheSemaphoreImpl.java:347)
at
org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl$Sync.tryReleaseShared(GridCacheSemaphoreImpl.java:253)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1340)
at
org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl.release(GridCacheSemaphoreImpl.java:755)
at
org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl.release(GridCacheSemaphoreImpl.java:743)
at
my.apache.ignite.examples.datastructures.SemaphoreExample.main(SemaphoreExample.java:32)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to find
semaphore with given name: Hello
at
org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl$Sync$1.call(GridCacheSemaphoreImpl.java:296)
at
org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl$Sync$1.call(GridCacheSemaphoreImpl.java:287)
at
org.apache.ignite.internal.processors.cache.GridCacheUtils$23.call(GridCacheUtils.java:1648)
at
org.apache.ignite.internal.processors.cache.GridCacheUtils.outTx(GridCacheUtils.java:891)
at
org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreImpl$Sync.compareAndSetGlobalState(GridCacheSemaphoreImpl.java:286)
... 5 more

I've listed the steps to reproduce the exception and the code in a gist[1]

[1]: https://gist.github.com/Kamal15/f83e0d17c4a21caf15ec4486406b2c12

Regards,
Kamal C


Re: Ignite Services: How to preserve value of Local variables ?

2016-08-04 Thread Kamal C
Val,

To reproduce the exception, I've made a simple example. Actually, I'm
creating state objects
in the Service#init block.

I've updated my approach. It doesn't makes sense to make initialization as
asynchronous.

Regards,
Kamal C

On Thu, Aug 4, 2016 at 6:21 AM, vkulichenko <valentin.kuliche...@gmail.com>
wrote:

> Kamal,
>
> Did you have a chance to look at compute grid as an alternative?
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-Services-How-to-preserve-value-of-Local-variables-tp4094p6724.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: Ignite Services: How to preserve value of Local variables ?

2016-08-03 Thread Kamal C
Val.

In real use-case, all the initialization are done in the *init* block. Due
to the above
mentioned behavior, I want to deploy the services locally / manually after
initialization.

The suggested approach to deploy a service only in the local node is not
working.
Do you have any alternate solution ?

On Wed, Aug 3, 2016 at 3:48 AM, vkulichenko 
wrote:

> Hi Kamal,
>
> This issue is related to this one:
> https://issues.apache.org/jira/browse/IGNITE-3392. Current service
> deployment process is asynchronous, so if it takes a lot of time to deploy
> it, you can get these exceptions in the logs. Note that they actually do
> not
> break anything, everything becomes stable after the service is executed on
> the second node.
>
> Consider using Compute Grid [1] instead. It can a better option if you use
> only node singletons and if they don't have any specific lifecycle. I.e.,
> if
> they are used to execute a piece of code on a server node.
>
> [1] https://apacheignite.readme.io/docs/compute-grid
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-Services-How-to-preserve-value-of-Local-variables-tp4094p6686.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: How to auto generate spring configuration file ?

2016-07-20 Thread Kamal C
Apologies, for the spam! Found it.



 


On Thu, Jul 21, 2016 at 10:15 AM, Kamal C <kamaltar...@gmail.com> wrote:

> Could someone please explain how to configure *nodeFilter* in the spring
> cache configuration file ?
>
> Regards,
> Kamal C
>
> On Wed, Apr 20, 2016 at 12:27 PM, Alexey Kuznetsov <
> akuznet...@gridgain.com> wrote:
>
>> Kamal, I created an issue for this, you can track in JIRA.
>>
>> https://issues.apache.org/jira/browse/IGNITE-3030
>>
>> On Tue, Apr 19, 2016 at 1:00 PM, Alexey Kuznetsov <
>> akuznet...@gridgain.com> wrote:
>>
>>> Hi, Kamal!
>>>
>>> Thank you for feedback on web console.
>>>
>>> I will take a look and create issues in JIRA for this properties.
>>> I will let you know in this thread.
>>>
>>> On Tue, Apr 19, 2016 at 12:32 PM, Kamal C <kamaltar...@gmail.com> wrote:
>>>
>>>> Thanks Alexey!
>>>>
>>>> This is what I've been looking for. Still, some keys are not supported
>>>> in web-console:
>>>>
>>>> 1. userAttributes
>>>> 2. failoverSpi
>>>> 3. gridLogger
>>>> ...
>>>>
>>>> How to configure userAttributes in XML ?
>>>>
>>>> --Kamal
>>>>
>>>>
>>>> On Mon, Apr 18, 2016 at 7:22 PM, Alexey Kuznetsov <
>>>> akuznet...@gridgain.com> wrote:
>>>>
>>>>> Hi, Kamal!
>>>>>
>>>>> You could try web console
>>>>> https://ignite.apache.org/addons.html#web-console
>>>>> It will generate XML and Java code for you.
>>>>>
>>>>> On Mon, Apr 18, 2016 at 8:19 PM, Kamal C <kamaltar...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Ignite can be configured either through IgniteConfiguration or by
>>>>>> passing bean XML file.
>>>>>>
>>>>>> In XML file approach, typing the property keys seems to be
>>>>>> error-prone.
>>>>>>
>>>>>> e.g.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *>>>>> class="org.apache.ignite.configuration.IgniteConfiguration">...
>>>>>>   *
>>>>>> **
>>>>>>
>>>>>>
>>>>>> How to auto-generate the configuration file using the bean object ?
>>>>>> [or]
>>>>>> Is any sample file available which contains all the property keys ?
>>>>>> (Users can copy-paste and edit only the values)
>>>>>>
>>>>>> --Kamal
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Alexey Kuznetsov
>>>>> GridGain Systems
>>>>> www.gridgain.com
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Alexey Kuznetsov
>>> GridGain Systems
>>> www.gridgain.com
>>>
>>
>>
>>
>> --
>> Alexey Kuznetsov
>> GridGain Systems
>> www.gridgain.com
>>
>
>


Re: Cassandra Cache Store Example

2016-07-15 Thread Kamal C
It's clear now. Thanks for the information Igor.

Regards,
Kamal C

On Fri, Jul 15, 2016 at 9:32 PM, Igor Rudyak <irud...@gmail.com> wrote:

> Hi Kamal,
>
> Partitions in Cassandra are controlled by the partition key you selected.
> Using Ignite-Cassandra module you have two options to specify Cassandra
> partition key:
>
> - Use POJO persistence strategy along with @AffinityKeyMapped annotation
> for your key classes. In a such way all you partition key fields for
> Cassandra table will be detected automatically.
>
> - Use POJO persistence strategy and prepare Cassandra persistence
> descriptor (
> http://apacheignite.gridgain.org/docs/base-concepts#persistencesettingsbean)
> where you can manually specify all your mappings to Cassandra including
> partition key.
>
> For more details you can look at the "base concepts" page
> http://apacheignite.gridgain.org/docs/base-concepts and examples
> http://apacheignite.gridgain.org/docs/examples
>
> Just want to clarify once again - Cassandra partitions and Ignite
> partitions are two absolutely different concepts. It doesn't make sense to
> map Ignite partitions to the same set of Cassandra partitions - you'll just
> have significant Cassandra performance degradation on large data sets.
> Cassandra partitioning is all about evenly distributing data among the
> cluster nodes. It's absolutely normal to have billions partitions in
> Cassandra.
>
>
> Igor Rudyak
>
>
> On Fri, Jul 15, 2016 at 12:03 AM, Kamal C <kamaltar...@gmail.com> wrote:
>
>> Val,
>>
>> I too have some concerns to use cassandra partitioned table. For initial
>> version, I'm using PRIMITIVE / BLOB
>> persistent strategy to store the key-value pair. Thanks for the support :)
>>
>> Igor,
>>
>> Still, I'm not clear. Cassandra and Ignite uses different partition
>> strategy. Assume a Ignite Cache is configured
>> to have 64 partitions and POJO persistent strategy is used in cassandra,
>> Then,
>>
>> PersonKey key = new PersonKey(id, companyId); // companyId is mapped as
>> affinity key.
>>
>> If the range of companyId is [1-1]. I don't want to create that many
>> partitions in the
>> cassandra table.
>>
>>
>> Regards,
>> Kamal C
>>
>>
>>
>> On Fri, Jul 15, 2016 at 5:13 AM, Igor Rudyak <irud...@gmail.com> wrote:
>>
>>> Hi Kamal,
>>>
>>> Ignite Cassandra module takes into account AffinityFunction when
>>> persisting values into Cassandra(
>>> https://apacheignite.readme.io/docs/overview). Thus key/values having
>>> the same Affinity and collocated on one Ignite node will be also collocated
>>> on one node in Cassandra.
>>>
>>> Cassandra and Ignite partitions are two absolutely different animals, it
>>> doesn't make sense to compare them. Just check that you are using
>>> @AffinityKeyMapped annotation for your key classes. In a such way all
>>> the values having same affinity will be persisted on the same Cassandra
>>> node.
>>>
>>> Igor Rudyak
>>>
>>>
>>> On Thu, Jul 14, 2016 at 4:12 PM, vkulichenko <
>>> valentin.kuliche...@gmail.com> wrote:
>>>
>>>> Hi Kamal,
>>>>
>>>>
>>>> Kamal wrote
>>>> > 1. In Ignite partitioned cache, number of partitions can be configured
>>>> >using AffinityFunction. How to configure the same for the
>>>> >Cassandra table ?
>>>> >
>>>> > 2. Will the partitioner used by Cassandra (MurMur3) and the Ignite
>>>> > returns the same partition number for a cache key ?
>>>>
>>>> Ignite and Cassandra use completely different partitioning strategy and
>>>> I
>>>> don't think it will be an easy task to collocate them. But from my
>>>> experience, it's actually better not to do this, but have Cassandra and
>>>> Ignite on separate physical servers and scale them separately. Most
>>>> likely
>>>> you will need different number of nodes for Ignite and Cassandra to fit
>>>> your
>>>> performance requirements.
>>>>
>>>>
>>>> Kamal wrote
>>>> > 3. Say a cache is configured to hold 2 lakh elements in memory
>>>> > and rest of them in cassandra. If the cache contains more than
>>>> > 2 lakh elements, Then,
>>>> >
>>>> > a. Calling cache.size() method returns count as 2 lakh
>>>> > b. Using cache.iterator() able to iterate only the elements available
>>>> > in the memory
>>>> > c. With cache.removeAll() able to delete the entries in cassandra
>>>> > that are available in the memory.
>>>>
>>>> Answer on all the three questions is YES.
>>>>
>>>>
>>>> Kamal wrote
>>>> > How to get the total size of a cache ? (memory + cassandra)
>>>>
>>>> Data which is evicted from Ignite is not in cache anymore. You have to
>>>> use
>>>> Cassandra APIs to get the number entries in its storage.
>>>>
>>>> -Val
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://apache-ignite-users.70518.x6.nabble.com/Cassandra-Cache-Store-Example-tp6206p6315.html
>>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>>>
>>>
>>>
>>
>


Re: Cassandra Cache Store Example

2016-07-15 Thread Kamal C
Val,

I too have some concerns to use cassandra partitioned table. For initial
version, I'm using PRIMITIVE / BLOB
persistent strategy to store the key-value pair. Thanks for the support :)

Igor,

Still, I'm not clear. Cassandra and Ignite uses different partition
strategy. Assume a Ignite Cache is configured
to have 64 partitions and POJO persistent strategy is used in cassandra,
Then,

PersonKey key = new PersonKey(id, companyId); // companyId is mapped as
affinity key.

If the range of companyId is [1-1]. I don't want to create that many
partitions in the
cassandra table.


Regards,
Kamal C



On Fri, Jul 15, 2016 at 5:13 AM, Igor Rudyak <irud...@gmail.com> wrote:

> Hi Kamal,
>
> Ignite Cassandra module takes into account AffinityFunction when
> persisting values into Cassandra(
> https://apacheignite.readme.io/docs/overview). Thus key/values having the
> same Affinity and collocated on one Ignite node will be also collocated on
> one node in Cassandra.
>
> Cassandra and Ignite partitions are two absolutely different animals, it
> doesn't make sense to compare them. Just check that you are using
> @AffinityKeyMapped annotation for your key classes. In a such way all the
> values having same affinity will be persisted on the same Cassandra node.
>
> Igor Rudyak
>
>
> On Thu, Jul 14, 2016 at 4:12 PM, vkulichenko <
> valentin.kuliche...@gmail.com> wrote:
>
>> Hi Kamal,
>>
>>
>> Kamal wrote
>> > 1. In Ignite partitioned cache, number of partitions can be configured
>> >using AffinityFunction. How to configure the same for the
>> >Cassandra table ?
>> >
>> > 2. Will the partitioner used by Cassandra (MurMur3) and the Ignite
>> > returns the same partition number for a cache key ?
>>
>> Ignite and Cassandra use completely different partitioning strategy and I
>> don't think it will be an easy task to collocate them. But from my
>> experience, it's actually better not to do this, but have Cassandra and
>> Ignite on separate physical servers and scale them separately. Most likely
>> you will need different number of nodes for Ignite and Cassandra to fit
>> your
>> performance requirements.
>>
>>
>> Kamal wrote
>> > 3. Say a cache is configured to hold 2 lakh elements in memory
>> > and rest of them in cassandra. If the cache contains more than
>> > 2 lakh elements, Then,
>> >
>> > a. Calling cache.size() method returns count as 2 lakh
>> > b. Using cache.iterator() able to iterate only the elements available
>> > in the memory
>> > c. With cache.removeAll() able to delete the entries in cassandra
>> > that are available in the memory.
>>
>> Answer on all the three questions is YES.
>>
>>
>> Kamal wrote
>> > How to get the total size of a cache ? (memory + cassandra)
>>
>> Data which is evicted from Ignite is not in cache anymore. You have to use
>> Cassandra APIs to get the number entries in its storage.
>>
>> -Val
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-ignite-users.70518.x6.nabble.com/Cassandra-Cache-Store-Example-tp6206p6315.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>


Re: Cassandra Cache Store Example

2016-07-13 Thread Kamal C
Ok Denis!

I've some doubts in the Cassandra Persistent store.

1. In Ignite partitioned cache, number of partitions can be configured
   using AffinityFunction. How to configure the same for the
   Cassandra table ?

2. Will the partitioner used by Cassandra (MurMur3) and the Ignite
returns the same partition number for a cache key ?

3. Say a cache is configured to hold 2 lakh elements in memory
and rest of them in cassandra. If the cache contains more than
2 lakh elements, Then,

a. Calling cache.size() method returns count as 2 lakh
b. Using cache.iterator() able to iterate only the elements available
in the memory
c. With cache.removeAll() able to delete the entries in cassandra
that are available in the memory.

How to get the total size of a cache ? (memory + cassandra)

--Kamal


On Mon, Jul 11, 2016 at 6:01 PM, Denis Magda <dma...@gridgain.com> wrote:

> Hi Kamal,
>
> Please create a ticket in JIRA for that and share a link to it over there.
> Hope that someone from the community will pick it up and implement. If
> you’re interested in this kind of contribution then it would be perfect.
>
> —
> Denis
>
> On Jul 11, 2016, at 3:05 PM, Kamal C <kamaltar...@gmail.com> wrote:
>
> Hi,
>
> Can anyone add Cassandra CacheStore example in the examples[1] like
> JDBC CacheStore example?
>
> It will be useful to configure and test the feature quickly.
>
> [1]:
> https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store
>
> --Kamal
>
>
>
>


Re: Understanding data store and partitioning

2016-07-13 Thread Kamal C
Val,

When a new node joins the cluster, should I have to call loadCache() or
localLoadCache() method ?

>From docs,

1. loadCache() - executes localLoadCache() on all the nodes
2. localLoadCache() - will trigger data loading only in the local node.

--Kamal

On Thu, Jul 14, 2016 at 4:12 AM, vkulichenko 
wrote:

> Hi,
>
> You don't need to load all person IDs when loading the data. The
> loadCache()
> implementation can use Affinity API to get the array of local partition IDs
> and query the DB based on this IDs. With this approach each node will load
> only those rows that has to be stored locally. See the second code example
> in [1]. Also note the you can load different partitions in parallel.
>
> [1]
>
> https://apacheignite.readme.io/docs/data-loading#section-partition-aware-data-loading
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Understanding-data-store-and-partitioning-tp6264p6282.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Cassandra Cache Store Example

2016-07-11 Thread Kamal C
Hi,

Can anyone add Cassandra CacheStore example in the examples[1] like
JDBC CacheStore example?

It will be useful to configure and test the feature quickly.

[1]:
https://github.com/apache/ignite/tree/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store

--Kamal


Re: How to stop a IgniteService gracefully?

2016-07-11 Thread Kamal C
When a node which provides the service have high CPU and heap memory usage.
Can I switch the service from that node to the other eligible node ?

On Mon, Jul 11, 2016 at 4:40 PM, Vladislav Pyatkov <vldpyat...@gmail.com>
wrote:

> Hello Kamal,
>
> -  How to tell Ignite to move a clustered singleton service from one node
> to another with external scripts?
>
> What are you mean when say: "move a clustered singleton service from one
> node to another"? If singleton service was deployed on cluster group, it
> will stay until, last node leaves the cluster.
>
>  In case the cluster node on which the service was deployed crashes or
> stops, Ignite will automatically redeploy it on another node. [1]
>
> [1]: https://apacheignite.readme.io/docs/cluster-singletons
>
> On Mon, Jul 11, 2016 at 7:48 AM, Kamal C <kamaltar...@gmail.com> wrote:
>
>> Sorry for polluting the mailing list.
>>
>> Ignition.stop(false); // internally stops / cancels the local Ignite
>> service.
>>
>> Can anyone answer for the 2nd question?
>>
>> --Kamal
>>
>> On Mon, Jul 11, 2016 at 10:00 AM, Kamal C <kamaltar...@gmail.com> wrote:
>>
>>> Vladislav,
>>>
>>> I've applied your suggestion. Still, Ignite closes the service running
>>> in all the nodes,
>>>
>>> ClusterGroup grp =
>>> ignite.cluster().forNode(ignite.cluster().localNode());
>>> ignite.services(grp).cancel(calcService);
>>>
>>>
>>> *Exception*
>>> class org.apache.ignite.IgniteException: Failed to find deployed
>>> service: CalcService
>>> at
>>> org.apache.ignite.internal.processors.service.GridServiceProxy.invokeMethod(GridServiceProxy.java:155)
>>> at
>>> org.apache.ignite.internal.processors.service.GridServiceProxy$ProxyInvocationHandler.invoke(GridServiceProxy.java:331)
>>> at com.sun.proxy.$Proxy28.add(Unknown Source)
>>> at
>>> my.apache.ignite.examples.servicegrid.ServiceDeployer.useService(ServiceDeployer.java:63)
>>>
>>>
>>> Re-framing my question:
>>>
>>> -  Is Service.cancel() method is not a appropriate place for resource
>>> cleanups on shutdown?
>>> -  How to tell Ignite to move a clustered singleton service from one
>>> node to another with external scripts?
>>>
>>> -- Kamal
>>>
>>> On Sat, Jul 9, 2016 at 1:07 AM, Vladislav Pyatkov <vldpyat...@gmail.com>
>>> wrote:
>>>
>>>> Hello Kamal,
>>>>
>>>> Try to use Ignite.services(ClusterGroup
>>>> <http://ignite.apache.org/releases/1.0.0/javadoc/org/apache/ignite/cluster/ClusterGroup.html>
>>>>  grp)
>>>> for local node group.
>>>>
>>>>
>>>> *Ignition.ignite().services(Ignition.ignite().cluster().localNode()).cancel(serviceName);*
>>>>
>>>> On Fri, Jul 8, 2016 at 9:48 AM, Kamal C <kamaltar...@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have a 3 node Ignite cluster and deployed a service using Node
>>>>> Singleton approach. The service started to run in all the 3 nodes.
>>>>>
>>>>> Whenever a node stopped, the below line gets called as I'm doing
>>>>> resource cleanups inside *IgniteService.cancel(ServiceContext
>>>>> context)* method.
>>>>>
>>>>> *Ignition.ignite().services().cancel(serviceName);*
>>>>>
>>>>> But, it cancels the service from all the nodes. How to cancel a
>>>>> locally running Ignite service gracefully?
>>>>>
>>>>> --
>>>>> Kamal
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Vladislav Pyatkov
>>>>
>>>
>>>
>>
>
>
> --
> Vladislav Pyatkov
>


Re: How to stop a IgniteService gracefully?

2016-07-10 Thread Kamal C
Sorry for polluting the mailing list.

Ignition.stop(false); // internally stops / cancels the local Ignite
service.

Can anyone answer for the 2nd question?

--Kamal

On Mon, Jul 11, 2016 at 10:00 AM, Kamal C <kamaltar...@gmail.com> wrote:

> Vladislav,
>
> I've applied your suggestion. Still, Ignite closes the service running in
> all the nodes,
>
> ClusterGroup grp = ignite.cluster().forNode(ignite.cluster().localNode());
> ignite.services(grp).cancel(calcService);
>
>
> *Exception*
> class org.apache.ignite.IgniteException: Failed to find deployed service:
> CalcService
> at
> org.apache.ignite.internal.processors.service.GridServiceProxy.invokeMethod(GridServiceProxy.java:155)
> at
> org.apache.ignite.internal.processors.service.GridServiceProxy$ProxyInvocationHandler.invoke(GridServiceProxy.java:331)
> at com.sun.proxy.$Proxy28.add(Unknown Source)
> at
> my.apache.ignite.examples.servicegrid.ServiceDeployer.useService(ServiceDeployer.java:63)
>
>
> Re-framing my question:
>
> -  Is Service.cancel() method is not a appropriate place for resource
> cleanups on shutdown?
> -  How to tell Ignite to move a clustered singleton service from one node
> to another with external scripts?
>
> -- Kamal
>
> On Sat, Jul 9, 2016 at 1:07 AM, Vladislav Pyatkov <vldpyat...@gmail.com>
> wrote:
>
>> Hello Kamal,
>>
>> Try to use Ignite.services(ClusterGroup
>> <http://ignite.apache.org/releases/1.0.0/javadoc/org/apache/ignite/cluster/ClusterGroup.html>
>>  grp)
>> for local node group.
>>
>>
>> *Ignition.ignite().services(Ignition.ignite().cluster().localNode()).cancel(serviceName);*
>>
>> On Fri, Jul 8, 2016 at 9:48 AM, Kamal C <kamaltar...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I have a 3 node Ignite cluster and deployed a service using Node
>>> Singleton approach. The service started to run in all the 3 nodes.
>>>
>>> Whenever a node stopped, the below line gets called as I'm doing
>>> resource cleanups inside *IgniteService.cancel(ServiceContext context)*
>>> method.
>>>
>>> *Ignition.ignite().services().cancel(serviceName);*
>>>
>>> But, it cancels the service from all the nodes. How to cancel a locally
>>> running Ignite service gracefully?
>>>
>>> --
>>> Kamal
>>>
>>
>>
>>
>> --
>> Vladislav Pyatkov
>>
>
>


Re: How to stop a IgniteService gracefully?

2016-07-10 Thread Kamal C
Vladislav,

I've applied your suggestion. Still, Ignite closes the service running in
all the nodes,

ClusterGroup grp = ignite.cluster().forNode(ignite.cluster().localNode());
ignite.services(grp).cancel(calcService);


*Exception*
class org.apache.ignite.IgniteException: Failed to find deployed service:
CalcService
at
org.apache.ignite.internal.processors.service.GridServiceProxy.invokeMethod(GridServiceProxy.java:155)
at
org.apache.ignite.internal.processors.service.GridServiceProxy$ProxyInvocationHandler.invoke(GridServiceProxy.java:331)
at com.sun.proxy.$Proxy28.add(Unknown Source)
at
my.apache.ignite.examples.servicegrid.ServiceDeployer.useService(ServiceDeployer.java:63)


Re-framing my question:

-  Is Service.cancel() method is not a appropriate place for resource
cleanups on shutdown?
-  How to tell Ignite to move a clustered singleton service from one node
to another with external scripts?

-- Kamal

On Sat, Jul 9, 2016 at 1:07 AM, Vladislav Pyatkov <vldpyat...@gmail.com>
wrote:

> Hello Kamal,
>
> Try to use Ignite.services(ClusterGroup
> <http://ignite.apache.org/releases/1.0.0/javadoc/org/apache/ignite/cluster/ClusterGroup.html>
>  grp)
> for local node group.
>
>
> *Ignition.ignite().services(Ignition.ignite().cluster().localNode()).cancel(serviceName);*
>
> On Fri, Jul 8, 2016 at 9:48 AM, Kamal C <kamaltar...@gmail.com> wrote:
>
>> Hi,
>>
>> I have a 3 node Ignite cluster and deployed a service using Node
>> Singleton approach. The service started to run in all the 3 nodes.
>>
>> Whenever a node stopped, the below line gets called as I'm doing resource
>> cleanups inside *IgniteService.cancel(ServiceContext context)* method.
>>
>> *Ignition.ignite().services().cancel(serviceName);*
>>
>> But, it cancels the service from all the nodes. How to cancel a locally
>> running Ignite service gracefully?
>>
>> --
>> Kamal
>>
>
>
>
> --
> Vladislav Pyatkov
>


How to stop a IgniteService gracefully?

2016-07-08 Thread Kamal C
Hi,

I have a 3 node Ignite cluster and deployed a service using Node
Singleton approach. The service started to run in all the 3 nodes.

Whenever a node stopped, the below line gets called as I'm doing resource
cleanups inside *IgniteService.cancel(ServiceContext context)* method.

*Ignition.ignite().services().cancel(serviceName);*

But, it cancels the service from all the nodes. How to cancel a locally
running Ignite service gracefully?

--
Kamal


Re: How to overcome short-time network problems?

2016-07-08 Thread Kamal C
Thanks for your response Denis.

Sorry for the late reply. I'm starting the Ignite node in embedded mode.
RESTART_JVM segmentation policy is applicable for standalone Ignite
node. Is there any other way? (It's happening once in a while I'm not able
to find out it's root cause)

In our application, during peak times Full GC can take upto 40-70 seconds.
How to configure session / connection timeout ?

--
Kamal

On Thu, Jun 30, 2016 at 7:04 PM, Denis Magda <dma...@gridgain.com> wrote:

> Hi Kamal,
>
> There are several options how this kind of exception may be processed by
> the kernel. See org.apache.ignite.plugin.segmentation.SegmentationPolicy
> for more details.
>
> In your scenario you can set
> IgniteConfiguration.setSegmentationPolicy(SegmentationPolicy.RESTART_JVM).
>
> In any case are you sure that the reason of the issue is related to
> network problems? I would suggest to check the logs of the node that was
> segmented for more details. Also usually the node become segmented due to
> long garbage collection. Read this page [1] and make sure that you’re not
> facing with the stop-the-world pauses.
>
> [1] https://apacheignite.readme.io/docs/jvm-and-system-tuning
>
> —
> Denis
>
> On Jun 30, 2016, at 2:18 PM, Kamal C <kamaltar...@gmail.com> wrote:
>
> Hi,
>
> In my setup, sometimes due to network problems local node gets
> segmented and stopped.
> How to tell Ignite to retry continuously to connect with peers instead of
> stopping the node ?
>
> *Logs:*
>
> WARN [2016-06-30T16:26:15,370] TcpDiscoverySpi: warning(): Node is out of
> topology (probably, due to short-time network problems).
> WARN [2016-06-30T16:26:15,370] GridDiscoveryManager: warning(): Local node
> SEGMENTED: TcpDiscoveryNode [id=7d24ed24-a742-4d22-b52a-4ce33317e209,
> addrs=[192.168.11.127], sockAddrs=[
> tcltestvm3.nmsworks.co.in/192.168.11.127:47500, /192.168.11.127:47500],
> discPort=47500, order=2, intOrder=2, lastExchangeTime=1467284175362,
> loc=true, ver=1.6.0#19700101-sha1:, isClient=false]
> WARN [2016-06-30T16:26:15,417] GridDiscoveryManager: warning(): Stopping
> local node according to configured segmentation policy.
> WARN [2016-06-30T16:26:15,418] GridDiscoveryManager: warning(): Node
> FAILED: TcpDiscoveryNode [id=1a2bfcd9-d72f-4a1e-a69f-c6d0b8f8814f,
> addrs=[192.168.9.211], sockAddrs=[
> tcltest1.nmsworks.co.in/192.168.9.211:47500, /192.168.9.211:47500],
> discPort=47500, order=1, intOrder=1, lastExchangeTime=1467278442434,
> loc=false, ver=1.6.0#19700101-sha1:, isClient=false]
>
>
> Regards,
> Kamal C
>
>
>


How to overcome short-time network problems?

2016-06-30 Thread Kamal C
Hi,

In my setup, sometimes due to network problems local node gets
segmented and stopped.
How to tell Ignite to retry continuously to connect with peers instead of
stopping the node ?

*Logs:*

WARN [2016-06-30T16:26:15,370] TcpDiscoverySpi: warning(): Node is out of
topology (probably, due to short-time network problems).
WARN [2016-06-30T16:26:15,370] GridDiscoveryManager: warning(): Local node
SEGMENTED: TcpDiscoveryNode [id=7d24ed24-a742-4d22-b52a-4ce33317e209,
addrs=[192.168.11.127], sockAddrs=[
tcltestvm3.nmsworks.co.in/192.168.11.127:47500, /192.168.11.127:47500],
discPort=47500, order=2, intOrder=2, lastExchangeTime=1467284175362,
loc=true, ver=1.6.0#19700101-sha1:, isClient=false]
WARN [2016-06-30T16:26:15,417] GridDiscoveryManager: warning(): Stopping
local node according to configured segmentation policy.
WARN [2016-06-30T16:26:15,418] GridDiscoveryManager: warning(): Node
FAILED: TcpDiscoveryNode [id=1a2bfcd9-d72f-4a1e-a69f-c6d0b8f8814f,
addrs=[192.168.9.211], sockAddrs=[
tcltest1.nmsworks.co.in/192.168.9.211:47500, /192.168.9.211:47500],
discPort=47500, order=1, intOrder=1, lastExchangeTime=1467278442434,
loc=false, ver=1.6.0#19700101-sha1:, isClient=false]


Regards,
Kamal C


Re: How to retrieve data from Collocated Cache with Simple Key

2016-06-08 Thread Kamal C
In my app, I'm trying to replace the existing ehcache implementation to
Ignite caches.

Using Affinity Collocation, I've collocated the data in the caches which are
accessed together. In many places, I've only SIMPLE key to retrieve the
data from the caches. (e.g. Retrieval from Person cache with only name)

In `put` operation, we have full object to insert so construction of
PersonKey /
 AffinityKey is not a problem. But, during `get` operation, we may have
only
the simple key to retrieve data.

I understand that Ignite looks data only in the partition specified by the
AffinityFunction computed on AffinityKey. Can I force Ignite to look for
data
on all the local cache partitions in the node ?



On Tue, Jun 7, 2016 at 10:38 AM, Denis Magda <dma...@gridgain.com> wrote:

> Hi Kamal,
>
> There is no need to use any workaround like ScanQueries or iterators. You
> just need to use a valid key to retrieve the data.
> The valid key in your example is new *AffinityKey<>(key, affray). *It
> means that every time you need to put or get a Person from the cache you
> need to use this kind of key where “key” and “affray” will vary.
>
> Also it’s not required to use AffinityKey instance all the time. You are
> free to create your own implementation of a key
>
> class PersonKey {
>
> private int id;
>
> @AffinityKeyMaped
> private int orgId;
>
> //hash code and equals implementations are below
> }
>
> The ticket is created for NPE you got when were using a wrong key
> https://issues.apache.org/jira/browse/IGNITE-3263
>
> —
> Denis
>
> On Jun 7, 2016, at 7:40 AM, Kamal C <kamaltar...@gmail.com> wrote:
>
> Thanks for your response Vladislav.
>
> Both ScanQuery and Iterator traverses the whole cache to find the value.
> It may not be suitable in my environment as there can be huge number of
> hits.
>
> I understand that for fast retrieval `key-to-partition` mapping is done.
> But, In AffinityKey documentation, it's specified that hashcode and equals
> methods are implemented based on simple key.
>
> * 
>>  * Note that the {@link #equals(Object)} and {@link #hashCode()} methods
>>  * delegate directly to the wrapped cache key provided by {@link #key()}
>>  * method.
>>  * 
>>
>
> On Mon, Jun 6, 2016 at 10:44 PM, Vladislav Pyatkov <vpyat...@gridgain.com>
> wrote:
>
>> I am sorry for mistake Kamal...
>> On Jun 6, 2016 3:34 PM, "Kamal" <kamaltar...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I've gone through the affinity collocation[1] example to understand
>>> how
>>> data gets collocated across caches. In my example, I found that I'm not
>>> able
>>> to retrieve data from collocated cache with simple key.
>>>
>>> I mean.
>>>
>>> Cache<AffinityKeyString>, Person> personCache = ..;
>>> personCache.get(new AffinityKey<>(key, affKey)); // returns value
>>> personCache.get(new AffinityKey<>(key)); // throws NPE
>>>
>>> Exception in thread "main" java.lang.NullPointerException
>>> at
>>>
>>> org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction.partition(RendezvousAffinityFunction.java:428)
>>> at
>>>
>>> org.apache.ignite.internal.processors.cache.GridCacheAffinityManager.partition(GridCacheAffinityManager.java:206)
>>> at
>>>
>>> org.apache.ignite.internal.processors.cache.GridCacheContext.toCacheKeyObject(GridCacheContext.java:1801)
>>> at
>>>
>>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.get(GridDhtAtomicCache.java:339)
>>> at
>>>
>>> org.apache.ignite.internal.processors.cache.GridCacheAdapter.get(GridCacheAdapter.java:4650)
>>> at
>>>
>>> org.apache.ignite.internal.processors.cache.GridCacheAdapter.get(GridCacheAdapter.java:1391)
>>> at
>>>
>>> org.apache.ignite.internal.processors.cache.IgniteCacheProxy.get(IgniteCacheProxy.java:907)
>>> at
>>>
>>> my.apache.ignite.examples.collocation.CacheCollocationExample.main(CacheCollocationExample.java:69)
>>>
>>> In some scenarios, I have to fetch data from cache by simple key.
>>>
>>> [1]: https://apacheignite.readme.io/docs/affinity-collocation
>>> CacheCollocationExample.java
>>> <
>>> http://apache-ignite-users.70518.x6.nabble.com/file/n5452/CacheCollocationExample.java
>>> >
>>> Company.java
>>> <http://apache-ignite-users.70518.x6.nabble.com/file/n5452/Company.java>
>>> Person.java
>>> <http://apache-ignite-users.70518.x6.nabble.com/file/n5452/Person.java>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-ignite-users.70518.x6.nabble.com/How-to-retrieve-data-from-Collocated-Cache-with-Simple-Key-tp5452.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com
>>> <http://nabble.com>.
>>>
>>
>
>


Re: How to retrieve data from Collocated Cache with Simple Key

2016-06-06 Thread Kamal C
Thanks for your response Vladislav.

Both ScanQuery and Iterator traverses the whole cache to find the value.
It may not be suitable in my environment as there can be huge number of
hits.

I understand that for fast retrieval `key-to-partition` mapping is done.
But, In AffinityKey documentation, it's specified that hashcode and equals
methods are implemented based on simple key.

* 
>  * Note that the {@link #equals(Object)} and {@link #hashCode()} methods
>  * delegate directly to the wrapped cache key provided by {@link #key()}
>  * method.
>  * 
>

On Mon, Jun 6, 2016 at 10:44 PM, Vladislav Pyatkov 
wrote:

> I am sorry for mistake Kamal...
> On Jun 6, 2016 3:34 PM, "Kamal"  wrote:
>
>> Hi,
>>
>> I've gone through the affinity collocation[1] example to understand
>> how
>> data gets collocated across caches. In my example, I found that I'm not
>> able
>> to retrieve data from collocated cache with simple key.
>>
>> I mean.
>>
>> Cache, Person> personCache = ..;
>> personCache.get(new AffinityKey<>(key, affKey)); // returns value
>> personCache.get(new AffinityKey<>(key)); // throws NPE
>>
>> Exception in thread "main" java.lang.NullPointerException
>> at
>>
>> org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction.partition(RendezvousAffinityFunction.java:428)
>> at
>>
>> org.apache.ignite.internal.processors.cache.GridCacheAffinityManager.partition(GridCacheAffinityManager.java:206)
>> at
>>
>> org.apache.ignite.internal.processors.cache.GridCacheContext.toCacheKeyObject(GridCacheContext.java:1801)
>> at
>>
>> org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.get(GridDhtAtomicCache.java:339)
>> at
>>
>> org.apache.ignite.internal.processors.cache.GridCacheAdapter.get(GridCacheAdapter.java:4650)
>> at
>>
>> org.apache.ignite.internal.processors.cache.GridCacheAdapter.get(GridCacheAdapter.java:1391)
>> at
>>
>> org.apache.ignite.internal.processors.cache.IgniteCacheProxy.get(IgniteCacheProxy.java:907)
>> at
>>
>> my.apache.ignite.examples.collocation.CacheCollocationExample.main(CacheCollocationExample.java:69)
>>
>> In some scenarios, I have to fetch data from cache by simple key.
>>
>> [1]: https://apacheignite.readme.io/docs/affinity-collocation
>> CacheCollocationExample.java
>> <
>> http://apache-ignite-users.70518.x6.nabble.com/file/n5452/CacheCollocationExample.java
>> >
>> Company.java
>> 
>> Person.java
>> 
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-ignite-users.70518.x6.nabble.com/How-to-retrieve-data-from-Collocated-Cache-with-Simple-Key-tp5452.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>


Required Spring jars for Configuration

2016-05-26 Thread Kamal C
Hi all,

I'm using Ignite Spring configuration files to configure the Ignite and
cache instances.

The `Ignite-Spring` folder consists of many jars. In my application, I'm
not using spring framework. How to find only the required jars which loads
the configuration files?

a. commons-logging-1.1.1.jar
b. ignite-spring-1.6.0.jar
c. spring-aop-4.1.0.RELEASE.jar
d. spring-beans-4.1.0.RELEASE.jar
e. spring-context-4.1.0.RELEASE.jar
f. spring-core-4.1.0.RELEASE.jar
g. spring-expression-4.1.0.RELEASE.jar
h. spring-jdbc-4.1.0.RELEASE.jar
i. spring-tx-4.1.0.RELEASE.jar


Regards,
Kamal C


CacheJdbcPersonStore Example

2016-05-12 Thread Kamal C
Hi,

In the CacheJdbcPersonStore example[1], why *IgniteDataStreamer* is
never used while loading the bulk elements from the persistent store.

What is the purpose of using IgniteBiInClosure in the example ?

[1]
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java#L136

--Kamal


Re: Persistent Cache

2016-05-04 Thread Kamal C
Thanks Denis!

On Wed, May 4, 2016 at 5:55 PM, Denis Magda <dma...@gridgain.com> wrote:

> Yes, it does. But it’s available as a part of paid enterprise version
> delivered by GridGain. It’s not a part of Apache Ignite.
>
> —
> Denis
>
> On May 4, 2016, at 3:12 PM, Kamal C <kamaltar...@gmail.com> wrote:
>
> Denis,
>
> Is Local Recoverable CacheStore applicable for all the cache modes?
> (Local, Replicated and Partitioned)
>
> --Kamal
>
> On Wed, May 4, 2016 at 5:21 PM, Denis Magda <dma...@gridgain.com> wrote:
>
>> Hi Kamal,
>>
>> Ignite doesn’t have an implementation of the CacheStore that stores cache
>> data in files on disk.
>> You should implement it on your own or use the one that is provided by
>> other vendors (i.e. GridGain delivers Local Store [1] as a part of it
>> enterprise product built on top of Ignite).
>>
>> [1] https://gridgain.readme.io/docs/local-recoverable-store
>>
>> —
>> Denis
>>
>> On May 4, 2016, at 2:47 PM, Kamal C <kamaltar...@gmail.com> wrote:
>>
>> Hi,
>>
>>I have a requirement in which state of the caches should be preserved
>> during application restart.
>>
>> I've gone through the [1] link. But, I don't want to store my contents
>> in the database. How to store the contents of cache in the disk ?
>>
>> [1] https://apacheignite.readme.io/docs/persistent-store
>>
>> --Kamal
>>
>>
>>
>
>


Re: Persistent Cache

2016-05-04 Thread Kamal C
Denis,

Is Local Recoverable CacheStore applicable for all the cache modes? (Local,
Replicated and Partitioned)

--Kamal

On Wed, May 4, 2016 at 5:21 PM, Denis Magda <dma...@gridgain.com> wrote:

> Hi Kamal,
>
> Ignite doesn’t have an implementation of the CacheStore that stores cache
> data in files on disk.
> You should implement it on your own or use the one that is provided by
> other vendors (i.e. GridGain delivers Local Store [1] as a part of it
> enterprise product built on top of Ignite).
>
> [1] https://gridgain.readme.io/docs/local-recoverable-store
>
> —
> Denis
>
> On May 4, 2016, at 2:47 PM, Kamal C <kamaltar...@gmail.com> wrote:
>
> Hi,
>
>I have a requirement in which state of the caches should be preserved
> during application restart.
>
> I've gone through the [1] link. But, I don't want to store my contents
> in the database. How to store the contents of cache in the disk ?
>
> [1] https://apacheignite.readme.io/docs/persistent-store
>
> --Kamal
>
>
>


Persistent Cache

2016-05-04 Thread Kamal C
Hi,

   I have a requirement in which state of the caches should be preserved
during application restart.

I've gone through the [1] link. But, I don't want to store my contents
in the database. How to store the contents of cache in the disk ?

[1] https://apacheignite.readme.io/docs/persistent-store

--Kamal


Re: Affinity Collocation

2016-04-27 Thread Kamal C
Thanks Vladimir!

On Wed, Apr 27, 2016 at 2:31 PM, Vladimir Ozerov <voze...@gridgain.com>
wrote:

> Hi,
>
> There should not be any problems with config like this because all
> Organization entries will be located on all nodes in the cluster.
>
> Vladimir.
>
> On Wed, Apr 27, 2016 at 9:47 AM, Kamal C <kamaltar...@gmail.com> wrote:
>
>> What do you mean by cache configuration?
>>
>> If I go with the below configuration, will it create any problem ?
>>
>> Person cache  - Partitioned, Atomic Mode
>> Organization / Company cache - Replicated, Transactional Mode
>>
>> --Kamal
>>
>> On Wed, Apr 27, 2016 at 10:46 AM, Alexey Goncharuk <
>> alexey.goncha...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> As long as cache configuration is the same, affinity assignment for such
>>> caches will be identical, so you do not need to explicitly specify cache
>>> dependency. On the other hand, if cache configurations do differ, it is not
>>> always possible to collocate keys properly, so for this case such a
>>> dependency also does not seem legit.
>>>
>>> Makes sense?
>>> ​
>>>
>>
>>
>


Re: Can't load log handler "org.apache.ignite.logger.java.JavaLoggerFileHandler"

2016-04-27 Thread Kamal C
Ok val.

On Wed, Apr 27, 2016 at 3:19 AM, vkulichenko 
wrote:

> Hi Kamal,
>
> If ignite-log4j module is enabled, Log4JLogger is set into configuration
> automatically. This is actually done because we enable this module
> automatically in the binary build.
>
> ignite-slf4j is always optional, so you need to specify it in the
> configuration explicitly.
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Can-t-load-log-handler-org-apache-ignite-logger-java-JavaLoggerFileHandler-tp4490p4565.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Affinity Collocation

2016-04-26 Thread Kamal C
Hi all,

In the example provided for affinity collocation [1], how the keys
 of different caches gets collocate together ?

Say, there are two caches:
1. Person cache
2. Organization cache

While inserting the elements into Person cache, I've to use either the
annotation *AffinityKeyMapped *or* AffinityKey *to collocate the data
with the organization in the same node.

My question: We are not specifying any dependency such that person
cache depends on organization cache. There can be n number of caches
with same keys as organization cache. Then, How it works?

[1] https://apacheignite.readme.io/docs/affinity-collocation

--Kamal


Re: ignite logging not captured in log file (log4j)

2016-04-21 Thread Kamal C
Binti,

Have you enabled log4j logger in Ignite Configuration ?

IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setGridLogger(new Log4JLogger());

--Kamal

On Thu, Apr 21, 2016 at 12:38 AM, vkulichenko  wrote:

> Binti,
>
> This doesn't depend on whether it's a client or server. Do you have
> ignite-log4j module enabled?
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/ignite-logging-not-captured-in-log-file-log4j-tp4334p4388.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: How to re-direct Ignite logs to log4j2?

2016-04-17 Thread Kamal C
Alexei,

Thanks for your response!

I've used slf4j to re-direct the logs

IgniteConfiguration cfg = new IgniteConfiguration();
...
cfg.setGridLogger(new Slf4jLogger());
Ignition.start(cfg);

Added the ignite-slf4j-1.5.0.final.jar, slf4j-api-1.7.7.jar and
slf4j-log4j12-1.7.6.jar to the classpath

--Kamal


On Sun, Apr 17, 2016 at 6:03 PM, Alexei Scherbakov <
alexey.scherbak...@gmail.com> wrote:

> Hi,
>
>
> For embedded mode you can try something like this:
>
> IgniteConfiguration cfg = new IgniteConfiguration();
> ...
> cfg.setGridLogger(new Log4J2Logger(U.resolveIgniteUrl("log4j2.xml",
> false)));
> Ignition.start(cfg);
>
> The key point here is to tell Ignite to use Log4J2 implementation for
> logging.
> Make sure you have log4j2.xml on your classpath.
>
>
> 2016-04-16 15:40 GMT+03:00 Kamal C <kamaltar...@gmail.com>:
>
>> Hi
>>
>> I'm not able to re-direct the Ignite logs to log4j2. I tried it by
>> adding the optional `ignite-log4j2` directory to the class path and added
>> the log4j2.xml. Still, the logs thrown to the console.
>>
>> Can anyone tell how to re-direct the logs?
>>
>> --Kamal
>>
>
>
>
> --
>
> Best regards,
> Alexei Scherbakov
>


How to re-direct Ignite logs to log4j2?

2016-04-16 Thread Kamal C
Hi

I'm not able to re-direct the Ignite logs to log4j2. I tried it by
adding the optional `ignite-log4j2` directory to the class path and added
the log4j2.xml. Still, the logs thrown to the console.

Can anyone tell how to re-direct the logs?

--Kamal





	
   		



	

	


	





	
	
		
	





Re: Ignite Services and Data Collocation

2016-04-14 Thread Kamal C
Thanks for your quick response Val!

I'll test throughly and update here.

--Kamal

On Thu, Apr 14, 2016 at 11:57 PM, vkulichenko  wrote:

> Kamal,
>
> I'm not sure I understood what you're trying to achieve. When you use cache
> API, all affinity mappings are done automatically, so you don't need to
> worry about this.
> In your particular case, the client is not aware of affinity and
> essentially
> sends a request to a random node, so the cache update can require one more
> network hop. But I don't see any way to change this without starting a
> client Ignite node.
>
> Can you provide more details? What is the sequence of events happening when
> you do a request and what you would like to change?
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-Services-and-Data-Collocation-tp4178p4192.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Ignite Services and Data Collocation

2016-04-14 Thread Kamal C
Hi all,

I've a cluster of 2 ignite server nodes + 1 client node (non-ignite).
I've collocated the data resides in ignite cache based on affinity key.

e.g.
Server 1 - contains all the data related to the affinity key (A, C, E)
Server 2 - contains all the data related to the affinity key (B, D, F)

I've deployed a service using node singleton approach and the same also
provided in RMI for backward compatibility.

Client can add, update and remove the data using API services. I would like
to end up the call called by the client to the node / server where it's
data is located to minimize data serialization within the network.

With Ignite client, I can able to do it by passing a predicate while
getting the service. But, my client works only with RMI. Once I received a
call, what approaches should i take to re-direct the computation to the
node where data is located ?

--Kamal


Re: How to configure user data type for sql queries?

2016-04-14 Thread Kamal C
Val,

Can you explain with use-case when to use Binary, Optimized, GridOptimized
and JDK Marshallers ?

--Kamal

On Tue, Apr 5, 2016 at 3:41 AM, edwardkblk 
wrote:

> Yes, it works with OptimizedMarshaller.  Thank you.
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/How-to-configure-user-data-type-for-sql-queries-tp3867p3912.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-12 Thread Kamal C
Ravi,

Check whether you have multiple versions of hibernate in your class path.

--Kamal
On 13-Apr-2016 4:42 AM, "vkulichenko"  wrote:

> Ravi,
>
> You should double-check your classpath. This is the same or very similar
> issue, which is not about Ignite, but about your project structure.
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/hibernate-open-session-error-while-running-with-tomcat-server-tp4050p4102.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: Ignite Services: How to preserve value of Local variables ?

2016-04-12 Thread Kamal C
Yes. I took a similar approach except I had state variables in my services.
I'll update it.

In RMI mode, clients don't need to have the implementation classes as it
works on the stub. In Ignite, client node expects the implementation
classes to present on the class path.
On 13-Apr-2016 7:52 AM, "vkulichenko"  wrote:

> Kamal,
>
> You can deploy node singleton (i.e., the service that will run on each
> node)
> and use IgniteServices.serviceProxy() to do remote calls from a client.
> Will
> this work for you?
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-Services-How-to-preserve-value-of-Local-variables-tp4094p4107.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Required Jars - Usage of ignite-shmem jar

2016-04-12 Thread Kamal C
Hi all,

In the http://apacheignite.gridgain.org/v1.2/docs/maven-setup page,
it's stated that ignite-core-1.5.0.final.jar is the only mandatory. All the
other jars are optional.

By default, in build ignite-core-1.5.0.final.jar, cache-api-1.0.0.jar,
ignite-shmem-1.0.0.jar, ignite-spring/* and ignite-indexing/* are enabled.

>From README.txt, it's listed that

- ignite-spring (for Spring-based configuration support)
- ignite-indexing (for SQL querying and indexing)
- cache-api-1.0.0.jar (for iterating cache)

What is usage of ignite-shmem-1.0.0.jar? (I don't have compilation errors
in my project. Is it required at run-time?)

--
Kamal


Ignite Services: How to preserve value of Local variables ?

2016-04-12 Thread Kamal C
Hi all,

While I'm using the Ignite Service Grid, I found a weird behavior in
which values of local variables are getting overridden.

I have two ignite nodes and I deployed the service in node singleton
approach. When the second node comes up and joins the cluster, it's local
variable values are getting overridden by the values in the first node.



*Sample Code*







































*import org.apache.ignite.Ignite;import org.apache.ignite.Ignition;import
org.apache.ignite.services.Service;import
org.apache.ignite.services.ServiceContext;public class DummyService
implements Service {private static final long serialVersionUID = 1L;
private final String server_id = System.getProperty("SERVER_ID", "1");
// Local variable value differ from one node to anotherpublic
DummyService() {System.out.printf("S : %s, Dummy Service
instantiated%n", server_id);}@Overridepublic void
cancel(ServiceContext context) {System.out.printf("S : %s,
Distributed Service : %s cancelled%n", server_id, context.name
()); // server_id value overridden}
@Overridepublic void execute(ServiceContext context) throws Exception
{System.out.printf("S : %s, Distributed Service : %s executed%n",
server_id, context.name ()); // server_id value
overridden}@Overridepublic void init(ServiceContext context)
throws Exception {System.out.printf("S : %s, Distributed Service :
%s inited%n", server_id, context.name ()); //
server_id value overridden}public static void main(String[] args)
{String server_id = "200"; // Replace the server_id with
300 while starting the second nodeSystem.setProperty("SERVER_ID",
server_id);Ignite ignite =
Ignition.start("examples/config/example-ignite.xml");DummyService
service = new DummyService();
ignite.services().deployNodeSingleton("DummyService", service);
System.out.printf("S : %s, Dummy service deployed successfully%n",
server_id);}}*

In the above code, *server_id *values gets overridden while starting second
node. I've tried it by enabling and disabling peer-to-peer class loading.
But, the behavior is still same.

How to preserve the value of local variables?

--Kamal


Re: IgniteCache: How to receive Load Re-balance notifications?

2016-03-01 Thread Kamal C
Pavel,

I'd like to receive notifications when a node left / joined the cluster.

Gone through discovery notifications. But, In my application it would be
more appropriate to receive notification after re-balance / a backup
partition in a node becomes primary.

On Tue, Mar 1, 2016 at 9:36 PM, Pavel Tupitsyn <ptupit...@gridgain.com>
wrote:

> Kamal,
>
> In replicated mode all data is already on every node, so there is no need
> to rebalance.
> http://apacheignite.gridgain.org/docs/cache-modes
>
> On Tue, Mar 1, 2016 at 6:58 PM, Kamal C <kamaltar...@gmail.com> wrote:
>
>> Vladimir,
>>
>> I had included the re-balance event types in *example-default.xml. *I'm
>> able to receive REBALANCE notifications when cache mode is set to
>> partitioned.
>>
>> Does re-balancing won't trigger when cache mode is replicated ?
>>
>> --
>> Kamal
>> On 29-Feb-2016 7:07 PM, "Vladimir Ozerov" <voze...@gridgain.com> wrote:
>>
>>> Kamal,
>>>
>>> You should enable these event type in configuration. See 
>>> IgniteConfiguration.setIncludeEventTypes(int
>>> ...) method.
>>>
>>> Vladimir.
>>>
>>> On Mon, Feb 29, 2016 at 12:00 PM, Kamal C <kamaltar...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have a replicated ignite cache with 3 nodes. I want to listen for
>>>> data rebalance notifications in all the nodes whenever a new node joined /
>>>> left the cluster.
>>>>
>>>> Using Ignite Events, I'd tried to register for cache re-balance
>>>> notifications. But, I'm unable to receive any notifications.
>>>>
>>>> CacheConfiguration<String, Integer> cacheCfg = new
>>>> CacheConfiguration<>("cache_name");
>>>> cacheCfg.setCacheMode(CacheMode.REPLICATED);
>>>>
>>>>
>>>> IgniteCache<String, Boolean> cache = ignite.getOrCreateCache(cacheCfg);
>>>>
>>>> ignite.events(ignite.cluster().forCacheNodes("cache_name")).localListen(
>>>> new IgnitePredicate() {
>>>>
>>>> private static final long serialVersionUID = 1L;
>>>>
>>>> @Override
>>>> public boolean apply(CacheRebalanacingEvent e)
>>>> {
>>>> if(e.cacheName.equals("cache_name")) {
>>>> logger.info("Received rebalancing Event :
>>>> {}", e);
>>>> }
>>>> return true;
>>>> }
>>>> }, EventType.EVTS_CACHE_REBALANCE);
>>>>
>>>>
>>>>
>>>>
>>>> *In logs,* WARN [2016-02-29 13:01:31,661] [main]
>>>> (Log4JLogger.java:480) - Added listener for disabled event type:
>>>> CACHE_REBALANCE_STARTED
>>>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>>>> listener for disabled event type: CACHE_REBALANCE_STOPPED
>>>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>>>> listener for disabled event type: CACHE_REBALANCE_PART_LOADED
>>>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>>>> listener for disabled event type: CACHE_REBALANCE_PART_UNLOADED
>>>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>>>> listener for disabled event type: CACHE_REBALANCE_OBJECT_LOADED
>>>>  WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
>>>> listener for disabled event type: CACHE_REBALANCE_OBJECT_UNLOADED
>>>>  WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
>>>> listener for disabled event type: CACHE_REBALANCE_PART_DATA_LOST
>>>>
>>>>
>>>> How to receive REBALANCE_STOPPED notification ?
>>>>
>>>> --
>>>> Kamal
>>>>
>>>>
>>>
>


Re: What will happen when one ignite node down and cache mode is Partitioned

2016-03-01 Thread Kamal C
You can access the data as primary node is up.

When cache mode is set to partitioned, each node acts as primary node for
some partitions and as backup node for other partitions.

Refer https://apacheignite.readme.io/docs/cache-modes#partitioned-mode

On Tue, Mar 1, 2016 at 8:26 PM, 上帝已死 <527901...@qq.com> wrote:

> If I have 2 nodes and backup is 1,what will happen when the backup node is
> down?
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/What-will-happen-when-one-ignite-node-down-and-cache-mode-is-Partitioned-tp3295p3301.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: IgniteCache: How to receive Load Re-balance notifications?

2016-03-01 Thread Kamal C
Vladimir,

I had included the re-balance event types in *example-default.xml. *I'm
able to receive REBALANCE notifications when cache mode is set to
partitioned.

Does re-balancing won't trigger when cache mode is replicated ?

--
Kamal
On 29-Feb-2016 7:07 PM, "Vladimir Ozerov" <voze...@gridgain.com> wrote:

> Kamal,
>
> You should enable these event type in configuration. See 
> IgniteConfiguration.setIncludeEventTypes(int
> ...) method.
>
> Vladimir.
>
> On Mon, Feb 29, 2016 at 12:00 PM, Kamal C <kamaltar...@gmail.com> wrote:
>
>> Hi,
>>
>> I have a replicated ignite cache with 3 nodes. I want to listen for
>> data rebalance notifications in all the nodes whenever a new node joined /
>> left the cluster.
>>
>> Using Ignite Events, I'd tried to register for cache re-balance
>> notifications. But, I'm unable to receive any notifications.
>>
>> CacheConfiguration<String, Integer> cacheCfg = new
>> CacheConfiguration<>("cache_name");
>> cacheCfg.setCacheMode(CacheMode.REPLICATED);
>>
>>
>> IgniteCache<String, Boolean> cache = ignite.getOrCreateCache(cacheCfg);
>>
>> ignite.events(ignite.cluster().forCacheNodes("cache_name")).localListen(
>> new IgnitePredicate() {
>>
>> private static final long serialVersionUID = 1L;
>>
>> @Override
>> public boolean apply(CacheRebalanacingEvent e)
>> {
>> if(e.cacheName.equals("cache_name")) {
>> logger.info("Received rebalancing Event :
>> {}", e);
>> }
>> return true;
>> }
>> }, EventType.EVTS_CACHE_REBALANCE);
>>
>>
>>
>>
>> *In logs,* WARN [2016-02-29 13:01:31,661] [main] (Log4JLogger.java:480)
>> - Added listener for disabled event type: CACHE_REBALANCE_STARTED
>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>> listener for disabled event type: CACHE_REBALANCE_STOPPED
>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>> listener for disabled event type: CACHE_REBALANCE_PART_LOADED
>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>> listener for disabled event type: CACHE_REBALANCE_PART_UNLOADED
>>  WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
>> listener for disabled event type: CACHE_REBALANCE_OBJECT_LOADED
>>  WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
>> listener for disabled event type: CACHE_REBALANCE_OBJECT_UNLOADED
>>  WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
>> listener for disabled event type: CACHE_REBALANCE_PART_DATA_LOST
>>
>>
>> How to receive REBALANCE_STOPPED notification ?
>>
>> --
>> Kamal
>>
>>
>


IgniteCache: How to receive Load Re-balance notifications?

2016-02-29 Thread Kamal C
Hi,

I have a replicated ignite cache with 3 nodes. I want to listen for
data rebalance notifications in all the nodes whenever a new node joined /
left the cluster.

Using Ignite Events, I'd tried to register for cache re-balance
notifications. But, I'm unable to receive any notifications.

CacheConfiguration cacheCfg = new
CacheConfiguration<>("cache_name");
cacheCfg.setCacheMode(CacheMode.REPLICATED);


IgniteCache cache = ignite.getOrCreateCache(cacheCfg);

ignite.events(ignite.cluster().forCacheNodes("cache_name")).localListen(
new IgnitePredicate() {

private static final long serialVersionUID = 1L;

@Override
public boolean apply(CacheRebalanacingEvent e)
{
if(e.cacheName.equals("cache_name")) {
logger.info("Received rebalancing Event : {}",
e);
}
return true;
}
}, EventType.EVTS_CACHE_REBALANCE);




*In logs,* WARN [2016-02-29 13:01:31,661] [main] (Log4JLogger.java:480) -
Added listener for disabled event type: CACHE_REBALANCE_STARTED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_STOPPED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_PART_LOADED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_PART_UNLOADED
 WARN [2016-02-29 13:01:31,662] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_OBJECT_LOADED
 WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_OBJECT_UNLOADED
 WARN [2016-02-29 13:01:31,663] [main] (Log4JLogger.java:480) - Added
listener for disabled event type: CACHE_REBALANCE_PART_DATA_LOST


How to receive REBALANCE_STOPPED notification ?

--
Kamal