On Sat, Jan 17, 2015 at 2:14 AM, Sergi Vladykin <[email protected]> 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 <[email protected]>: > > > 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. > > >
