Igniters,

I propose to replace Map with List<Pair> in getAll and invokeAll, and
Iterable<Pair> in putAll APIs of Ignite 3.x KeyValueView.

1. Performance
putAll simply iterates over the map, we can easily accept Iterable instead.
Iterable can be implemented over anything, it can lazily read data from a
file or some other place, instead of allocating a huge collection and
performing unnecessary hashing.

getAll returns a Map, but we don't know if the user code needs a map or
just wants to iterate over the results, in which case Map is just overhead.

2. Equality
getAll returns Map<K, V>, but in many cases, the map will be useless
because K does not have proper equals()/hashCode() implementation, so
map.get(key) does not work.

Notes:
- It is not clear which Pair class to use yet - IgniteBiTuple or something
else.
- Ignite 3 won't deadlock due to putAll entry order, so we don't have to
worry about sorting.

Thoughts, objections?

Reply via email to