Re: Create cache in apache ignite

2017-02-06 Thread Debasis Pradhan
Hi Andrey,

But which parameters i need to use to configure column name and datatype .

On Mon, Feb 6, 2017 at 3:26 PM, Andrey Gura  wrote:

> [image: Boxbe]  This message is eligible
> for Automatic Cleanup! (ag...@apache.org) Add cleanup rule
> 
> | More info
> 
>
> Hi,
>
> yes, you can configure cache using Spring XML. For start please see
> this article and related ones:
> https://apacheignite.readme.io/docs/cache-modes
>
> On Mon, Feb 6, 2017 at 11:36 AM, Debasis Pradhan 
> wrote:
> > Hi,
> >
> > For testing purpose i want to create some cache with 3/4 columns.Can i
> > create cache using spring xml, please provide the links or docs if any.
> >
> > --
> > Thanks
> > D
> > b
> >
>
>


-- 
*Thanks *
*Debasis*
*9972429889*


Re: EntryProcessor for cache

2017-02-06 Thread Anil
Hi Val,

Thanks. Could you please point me to mapreduce example that runs on cache ?

thanks.

On 7 February 2017 at 05:47, vkulichenko 
wrote:

> Yes, you can create a map reduce task, execute local query within each job
> (use Query.setLocal(true)), and update queried entries accordingly.
>
> Also note that each SQL table in Ignite has predefined _key field that
> returns key object, so you can return set of keys from the query.
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/EntryProcessor-for-cache-tp10432p10462.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: NOT IN in ignite

2017-02-06 Thread Anil
Hi,

May I know what do you mean by "When used incorrectly" ?

group by queries with collocate = true is not incorrect usage or i
misunderstood this ?

Thanks.

On 7 February 2017 at 01:26, vkulichenko 
wrote:

> Well, I would agree that the flag is confusing, but your understanding is
> not
> correct. When used incorrectly, this flag does breaks query result because
> it forces Ignite to change execution plan to more optimal. This
> optimization
> doesn't always work though (that's actually the reason why it's
> configurable).
>
> -Val
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/NOT-IN-in-ignite-tp9861p10458.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Re: persist only on delete

2017-02-06 Thread shawn.du





Hi Val,just curious about why onAfterRemove(Cache.Entry(K,V) entry)entry.getValue() sometimes return null.  but I never put a null value into the cache.I have to check it to avoid NullPointerException.






ThanksShawn





On 02/7/2017 09:07,shawn.du wrote: 





Hi Val,Thanks very much. CacheInterceptor is the best way.Shawn





On 02/7/2017 08:09,vkulichenko wrote: 


Hi Shawn,

Your approach sounds a bit dangerous. Store is called within an entry lock,
which means that if you do a distributed get there, you will likely get
thread starvation. This should not happen on stable topology, but if another
node fails or joins, you can get stuck.

I think you should use interceptor instead:
https://ignite.apache.org/releases/mobile/org/apache/ignite/cache/CacheInterceptor.html

-Val



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







Locking Threads

2017-02-06 Thread styriver
Hello

In  your locking implementation when a thread is locked what reference is
used? Are they locked by thread name or some other identifier.



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


Re: spring boot clustered session with ignite

2017-02-06 Thread ignite_user2016
Any reply will help me here ? we are running into issues where spring  filter
s cant recognize Ignite as session data store result in weird errors.

I see an issue out there but no progress since it got created.

Better response would help me sticking to Ignite here.



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


Re: persist only on delete

2017-02-06 Thread shawn.du





Hi Val,Thanks very much. CacheInterceptor is the best way.Shawn





On 02/7/2017 08:09,vkulichenko wrote: 


Hi Shawn,

Your approach sounds a bit dangerous. Store is called within an entry lock,
which means that if you do a distributed get there, you will likely get
thread starvation. This should not happen on stable topology, but if another
node fails or joins, you can get stuck.

I think you should use interceptor instead:
https://ignite.apache.org/releases/mobile/org/apache/ignite/cache/CacheInterceptor.html

-Val



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






Re: EntryProcessor for cache

2017-02-06 Thread vkulichenko
Yes, you can create a map reduce task, execute local query within each job
(use Query.setLocal(true)), and update queried entries accordingly.

Also note that each SQL table in Ignite has predefined _key field that
returns key object, so you can return set of keys from the query.

-Val



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


RE: persist only on delete

2017-02-06 Thread vkulichenko
Hi Shawn,

Your approach sounds a bit dangerous. Store is called within an entry lock,
which means that if you do a distributed get there, you will likely get
thread starvation. This should not happen on stable topology, but if another
node fails or joins, you can get stuck.

I think you should use interceptor instead:
https://ignite.apache.org/releases/mobile/org/apache/ignite/cache/CacheInterceptor.html

-Val



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


Re: insert and update dml issues

2017-02-06 Thread vkulichenko
Hi,

Yes, feel free to create a ticket if there is a bug. Please create a unit
test that reproduces the issue and attach it there.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456p10460.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Local node seems to be disconnected from topology (failure detection timeout is reached)

2017-02-06 Thread vkulichenko
Yuci,

RESTART_JVM policy restarts the whole JVM (surprisingly :) ), so it works
only for standalone nodes started with ignite.sh script.

In your case you can use NOOP policy, listen to EVT_NODE_SEGMENTED event and
restart the node in a listener.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Local-node-seems-to-be-disconnected-from-topology-failure-detection-timeout-is-reached-tp6797p10459.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: NOT IN in ignite

2017-02-06 Thread vkulichenko
Well, I would agree that the flag is confusing, but your understanding is not
correct. When used incorrectly, this flag does breaks query result because
it forces Ignite to change execution plan to more optimal. This optimization
doesn't always work though (that's actually the reason why it's
configurable).

-Val



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


Re: insert and update dml issues

2017-02-06 Thread lawrencefinn
Actually, I see the bug.  Apparently DML statements don't work with fields
that have "names" different than the java pojo name?  Should I file a
ticket?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456p10457.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


insert and update dml issues

2017-02-06 Thread lawrencefinn
I can't seem to get insert or update DML queries to work.  I have a simple
cache that I put one object in.  I try to update it, the result says 1 row
was updated, but nothing was actually updated in the object.  

Pojo:
public class ACLStatus {
@QuerySqlField(index = true, name = "user_id")
private Long userId;
@QuerySqlField(index = true, name = "last_modified")
private Date lastModified;

public ACLStatus(Long userId, Date lastModified) {
this.userId = userId;
this.lastModified = lastModified;
}

public Long getUserId() {
return userId;
}

public Date getLastModified() {
return lastModified;
}

public void setLastModified(Date lastModified) {
this.lastModified = lastModified;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

ACLStatus aclStatus = (ACLStatus) o;

if (userId != null ? !userId.equals(aclStatus.userId) :
aclStatus.userId != null) return false;
return lastModified != null ?
lastModified.equals(aclStatus.lastModified) : aclStatus.lastModified ==
null;
}

@Override
public int hashCode() {
int result = userId != null ? userId.hashCode() : 0;
result = 31 * result + (lastModified != null ?
lastModified.hashCode() : 0);
return result;
}
}


Code:
cache.put(1L, new ACLStatus(123L, new Date()));
Execute query: update "aclsource".ACLStatus set last_modified = date
'2016-12-12' where _key = 1
Do a getAll on that query: list(list(1)) 
Get object from cache and date has not changed 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


spring boot clustered session with ignite

2017-02-06 Thread ignite_user2016
Has any body had any success on running spring boot session with ignite ? we
want to use ignite as our session cache so that we can clustered out SB app.

https://issues.apache.org/jira/browse/IGNITE-2741

Do we have to use spring session here ? wondering why not simple web session
? 

Thanks,
Rishi



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


Re: How to deploy cache to selected cluster group

2017-02-06 Thread davida
Thanks Guys, 

I was able to implement NodeFilter (using IgnitePredicate) in
Java and supply it using SpringConfig.xml in ApacheIgnite.NET. 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-deploy-cache-to-selected-cluster-group-tp10437p10454.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Integrate DB transactions with ApacheIgnite transactions ?

2017-02-06 Thread ptupitsyn
Hi David,

Please properly subscribe to the mailing list so that the community can
receive email notifications for your messages. To subscribe, send empty
email to user-subscr...@ignite.apache.org and follow simple instructions in
the reply.

> anything similar to functionality of TransactionScope

TransactionScope integration is implemented and will be released in upcoming
1.9.

For now you can try this in nightly builds:
https://cwiki.apache.org/confluence/display/IGNITE/Nightly+Builds

Pavel



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


Re: Local node seems to be disconnected from topology (failure detection timeout is reached)

2017-02-06 Thread yucigou
Hi Val,

Thanks for the explanation for not allowing re-connection of server nodes. 

Regarding the RESTART_JVM policy, this policy does not work for our web
application. The reason is that in our web application Ignite is started by
the servlet context listener
org.apache.ignite.startup.servlet.ServletContextListenerStartup.

And according to the Ignite documentation, the RESTART_JVM policy will work
only if Ignite is started with CommandLineStartup via standard
ignite.{sh|bat} shell script.

https://ignite.apache.org/releases/mobile/org/apache/ignite/plugin/segmentation/SegmentationPolicy.html#RESTART_JVM

Wonder if it is possible to make the RESTART_JVM policy also work for Ignite
being started by the servlet context listener?

Thanks,
Yuci



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Local-node-seems-to-be-disconnected-from-topology-failure-detection-timeout-is-reached-tp6797p10452.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: EntryProcessor for cache

2017-02-06 Thread Anil
Anyone got a chance to look into this ? thanks.

On 4 February 2017 at 14:31, Anil  wrote:

> HI,
>
> I have two caches Person and PersonDetail. i have to update the one of the
> property person details status based on person and person detail properties
> and current date.
>
> Person {
>
> String personId
>
> String equivalentId
>
> String name
>
> Long dateOfBirth;
> 
>
> }
>
> PersonDetail {
>
> String detailedId
>
> String equivalentId
>
> Long startDate
>
> Long endDate;
>
> String status
>
> }
>
> Person cache key -> AffinityKey -> AffinityKey equivalentId>
> PersonDetail cache key -> AffinityKey ->
> AffinityKey
>
>
> status of Person details is determined based on Person#dateOfBirth,
> PersonDetail#startDate, PersonDetail#endDate and current date.
>
>
> I see entry processor can nbe applied on given set of cache keys only. Is
> there any way in update each PersonDetail's status in efficient way ?
>
> Can we use mapreduce ? if yes, Could you please share any example ?
>
> Thanks for your help.
>
> Thanks.
>


Re: How to deploy cache to selected cluster group

2017-02-06 Thread davida
Yes Andrey, but it seems that option does not exist for .NET/C#.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-deploy-cache-to-selected-cluster-group-tp10437p10449.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to deploy cache to selected cluster group

2017-02-06 Thread Andrey Mashenkov
Hi David,

It was my misunderstanding.

Yes, NodeFilter set in CacheConfiguration will meet your needs.

On Mon, Feb 6, 2017 at 1:20 PM, davida  wrote:

> Hi Andrey,
>
> Yes, service deployment offers rich functionality in terms of deployment
> options, but I am asking about similar functionality related to
> deploying/creating caches in .NET/C#.
>
> I have found something similar here (Microservices example on top of
> ApacheIgnite: https://github.com/dmagda/MicroServicesExample) using
> IgnitePredicate, but it seems the API does not exist for .NET/C#.
>
> Here is the code from the repository:
>
> 
> 
> 
>
> 
> 
> 
> 
>
> public class DataNodeFilter implements IgnitePredicate
> {
> public boolean apply(ClusterNode node) {
> Boolean dataNode = node.attribute("data.node");
>
> return dataNode != null && dataNode;
> }
> }
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/How-to-deploy-cache-to-selected-
> cluster-group-tp10437p10447.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 
С уважением,
Машенков Андрей Владимирович
Тел. +7-921-932-61-82

Best regards,
Andrey V. Mashenkov
Cerr: +7-921-932-61-82


Re: How to deploy cache to selected cluster group

2017-02-06 Thread davida
Hi Andrey, 

Yes, service deployment offers rich functionality in terms of deployment
options, but I am asking about similar functionality related to
deploying/creating caches in .NET/C#. 

I have found something similar here (Microservices example on top of
ApacheIgnite: https://github.com/dmagda/MicroServicesExample) using
IgnitePredicate, but it seems the API does not exist for .NET/C#.

Here is the code from the repository:










public class DataNodeFilter implements IgnitePredicate
{
public boolean apply(ClusterNode node) {
Boolean dataNode = node.attribute("data.node");

return dataNode != null && dataNode;
}
}



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/How-to-deploy-cache-to-selected-cluster-group-tp10437p10447.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: How to deploy cache to selected cluster group

2017-02-06 Thread Andrey Gura
David,

you can use CacheConfiguration.setNodeFilter() for definition some
nodes where cache will be created.

On Mon, Feb 6, 2017 at 12:03 PM, Andrey Mashenkov
 wrote:
> Hi David,
>
> Please, take a look at  Ignite.services(ClusterGroup grp) [1]
>
> [1] http://apacheignite.gridgain.org/docs/service-grid#igniteservices
>
> On Mon, Feb 6, 2017 at 9:38 AM, davida  wrote:
>>
>> Hi all,
>>
>> Is there a way to deploy cache to predefined cluster group(defined by
>> custom
>> attributes) instead of deploying to every server node ?
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-ignite-users.70518.x6.nabble.com/How-to-deploy-cache-to-selected-cluster-group-tp10437.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
>


Re: Create cache in apache ignite

2017-02-06 Thread Andrey Gura
Hi,

yes, you can configure cache using Spring XML. For start please see
this article and related ones:
https://apacheignite.readme.io/docs/cache-modes

On Mon, Feb 6, 2017 at 11:36 AM, Debasis Pradhan  wrote:
> Hi,
>
> For testing purpose i want to create some cache with 3/4 columns.Can i
> create cache using spring xml, please provide the links or docs if any.
>
> --
> Thanks
> D
> b
>


RE: persist only on delete

2017-02-06 Thread Shawn Du
Hi, 

 

I tested that the cache value was still in memory when calling store delete 
method. For I leave write empty, so it can’t get it from persist store.

 

public void write(Cache.Entry entry)
{
//do nothing
}

 

 

Thanks

Shawn

 

发件人: Vladislav Pyatkov [mailto:vldpyat...@gmail.com] 
发送时间: 2017年2月6日 16:04
收件人: user@ignite.apache.org
主题: Re: 答复: persist only on delete

 

Hi,

 

I think it will be work, because each time when "get"  from a cache Ignite try 
to get the value from persistence story, if it will not find in memory.

 

On Mon, Feb 6, 2017 at 10:39 AM, Shawn Du  > wrote:

Hi,

 

In delete method, we can only get cache key.  In order to get cache entry 
value, we need get Ignite instance and get the cache.

 

Assume we already get all of them. Can we get value in the cache by the key? 
Which is still valid in cache?

 

Thanks

Shawn

 

发件人: Shawn Du [mailto:shawn...@neulion.com.cn  
] 
发送时间: 2017年2月6日 15:12
收件人: user@ignite.apache.org  
主题: persist only on delete 

 

Hi,

 

I have a case which cache entry will be update frequently, and I only want to 
persist it when the cache is manually remove(cache will not change anymore) by 
me.

 

For this case, It is a good idea to implement persist logic in delete/deleteAll 
method while write/writeAll do nothing?

 

@Override
public void delete(Object o)
{
//do nothing, we never have this operation.
}

 

 

Thanks

Shawn





 

-- 

Vladislav Pyatkov



Re: How to deploy cache to selected cluster group

2017-02-06 Thread Andrey Mashenkov
Hi David,

Please, take a look at  Ignite.services(ClusterGroup grp) [1]

[1] http://apacheignite.gridgain.org/docs/service-grid#igniteservices

On Mon, Feb 6, 2017 at 9:38 AM, davida  wrote:

> Hi all,
>
> Is there a way to deploy cache to predefined cluster group(defined by
> custom
> attributes) instead of deploying to every server node ?
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/How-to-deploy-cache-to-selected-
> cluster-group-tp10437.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>


Create cache in apache ignite

2017-02-06 Thread Debasis Pradhan
Hi,

For testing purpose i want to create some cache with 3/4 columns.Can i
create cache using spring xml, please provide the links or docs if any.

-- 
*Thanks *

*D​b​*


RE: persist only on delete

2017-02-06 Thread Shawn Du
Hi,

 

Have a quick test, it works as I expect. I only test with sync API.

Still want to get comments about it. 

 

Thanks

Shawn

 

发件人: Shawn Du [mailto:shawn...@neulion.com.cn] 
发送时间: 2017年2月6日 15:39
收件人: user@ignite.apache.org
主题: 答复: persist only on delete 

 

Hi,

 

In delete method, we can only get cache key.  In order to get cache entry
value, we need get Ignite instance and get the cache.

 

Assume we already get all of them. Can we get value in the cache by the key?
Which is still valid in cache?

 

Thanks

Shawn

 

发件人: Shawn Du [mailto:shawn...@neulion.com.cn] 
发送时间: 2017年2月6日 15:12
收件人: user@ignite.apache.org  
主题: persist only on delete 

 

Hi,

 

I have a case which cache entry will be update frequently, and I only want
to persist it when the cache is manually remove(cache will not change
anymore) by me.

 

For this case, It is a good idea to implement persist logic in
delete/deleteAll method while write/writeAll do nothing?

 

@Override
public void delete(Object o)
{
//do nothing, we never have this operation.
}

 

 

Thanks

Shawn



Re: 答复: persist only on delete

2017-02-06 Thread Vladislav Pyatkov
Hi,

I think it will be work, because each time when "get"  from a cache Ignite
try to get the value from persistence story, if it will not find in memory.

On Mon, Feb 6, 2017 at 10:39 AM, Shawn Du  wrote:

> Hi,
>
>
>
> In delete method, we can only get cache key.  In order to get cache entry
> value, we need get Ignite instance and get the cache.
>
>
>
> Assume we already get all of them. Can we get value in the cache by the
> key? Which is still valid in cache?
>
>
>
> Thanks
>
> Shawn
>
>
>
> *发件人:* Shawn Du [mailto:shawn...@neulion.com.cn]
> *发送时间:* 2017年2月6日 15:12
> *收件人:* user@ignite.apache.org
> *主题:* persist only on delete
>
>
>
> Hi,
>
>
>
> I have a case which cache entry will be update frequently, and I only want
> to persist it when the cache is manually remove(cache will not change
> anymore) by me.
>
>
>
> For this case, It is a good idea to implement persist logic in
> delete/deleteAll method while write/writeAll do nothing?
>
>
>
> @Override
> public void delete(Object o)
> {
> //do nothing, we never have this operation.
> }
>
>
>
>
>
> Thanks
>
> Shawn
>



-- 
Vladislav Pyatkov