Cache.invoke are terribly slow and can't update cache

2016-12-21 Thread Shawn Du
Hi experts, I try to update cache by delta by calling invoke. This is the code, it is terribly slow and run out of Memory and no cache updated. Please help. table.getRows().forEach(r -> cache.invoke(r.getKey(), (entry, args) -> { BinaryObject bo = entry.getValue(); if (

Re: Cache.invoke are terribly slow and can't update cache

2016-12-21 Thread vkulichenko
Hi Shawn, Cache is not updated because you never update it :) i.e. entry.setValue() is never called. Bad performance can be caused by the fact that you do multiple operations one after another in a single thread without any batching. Consider using invokeAll or IgniteDataStreamer. As for OOME, i

答复: Cache.invoke are terribly slow and can't update cache

2016-12-21 Thread Shawn Du
nks Shawn -邮件原件- 发件人: vkulichenko [mailto:valentin.kuliche...@gmail.com] 发送时间: 2016年12月22日 2:52 收件人: user@ignite.apache.org 主题: Re: Cache.invoke are terribly slow and can't update cache Hi Shawn, Cache is not updated because you never update it :) i.e. entry.setValue() is never called

答复: Cache.invoke are terribly slow and can't update cache

2016-12-22 Thread Shawn Du
error prone. Thanks Shawn -邮件原件- 发件人: Shawn Du [mailto:shawn...@neulion.com.cn] 发送时间: 2016年12月22日 10:34 收件人: user@ignite.apache.org 主题: 答复: Cache.invoke are terribly slow and can't update cache Thanks Val! Can you explain more detail how "invoke" works internally comparin

Re: 答复: Cache.invoke are terribly slow and can't update cache

2016-12-22 Thread vkulichenko
Shawn, #1 - Yes, peer class loading is needed if you don't have entry processor implementation class deployed on server nodes. #2 - Correct. Moreover, I would recommend not to use lambdas or anonymous classes for anything that can be serialized, but to use static classes instead (this is actually

回复:Re: 答复: Cache.invoke are terribly slow and can't update cache

2016-12-22 Thread shawn.du
Thanks Val!Now I understood entryprocessor better. as to "error prone", I meant if we follow the document,it will be error prone.  For EntryProcessor is just an interface, it doesn't prohibit user to use lamda or anonymous classes.  When

Re: 回复:Re: 答复: Cache.invoke are terribly slow and can't update cache

2016-12-22 Thread vkulichenko
Shawn, You just should keep in mind that this is an object that will be serialized, sent across network and invoked on other side. The purpose of entry processor is to be executed on server side and atomically read and update a single entry. Having said that, the logic you described doesn't make m

答复: 回复:Re: 答复: Cache.invoke are terribly slow and can't update cache

2016-12-22 Thread Shawn Du
Thanks Val, that's good. -邮件原件- 发件人: vkulichenko [mailto:valentin.kuliche...@gmail.com] 发送时间: 2016年12月23日 9:47 收件人: user@ignite.apache.org 主题: Re: 回复:Re: 答复: Cache.invoke are terribly slow and can't update cache Shawn, You just should keep in mind that this is an object th