ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Setrakyan <dsetrak...@apache.org>
Subject Re: Addition of new methods to IgniteCache API
Date Sat, 17 Jan 2015 14:26:30 GMT
On Sat, Jan 17, 2015 at 2:14 AM, Sergi Vladykin <sergi.vladykin@gmail.com>
wrote:

> May be its better to pass cache entry to predicate?
>

In my view, using IngiteBiPredicate<K, V> instead of
IgnitePredicate<Cache.Entry<K, Vl>> is easier to read and is more
consistent with EntryProcessor<K,V> design from JCache.


>
> Also removeIf(key, val, IgniteBiPredicate<K, V>) signature looks weird to
> me. Why pass value there?
>

You are absolutely right.
--------
boolean putIf(key, val, IgniteBiPredicate<K, V>)
boolean removeIf(key, IgniteBiPredicate<K, V>)
--------


> regards,
> Sergi Vladykin
>
> 2015-01-17 5:57 GMT+03:00 Dmitriy Setrakyan <dsetrakyan@apache.org>:
>
> > I would like to propose adding 2 additional convenience methods to the
> > IgniteCache API:
> > -----------
> > boolean putIf(key, val, IgniteBiPredicate<K, V>)
> > boolean removeIf(key, val, IgniteBiPredicate<K, V>)
> > -----------
> >
> > Currently user must call one of the JCache.invoke(key, EntryProcessor,
> > args) methods, and then calling explicit put from inside the
> EntryProcessor
> > logic. The new APIs will allow a convenient shortcut for this type of
> > functionality.
> >
> > Let me know if you agree, or if you feel that we should just have the
> > JCache.invoke(...) functionality.
> >
> > D.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message