Reputation: 3
I have a question regarding EntryProcessor
. If I already have a value that I just want to put back in the map.
Would there be any difference in performance using:
map.set(key, value);
Compared to using EntryProcessor:
Value value = new Value();
map.executeOnKey(key, entry -> entry.setValue(value));
FYI I use sync backups.
Upvotes: 0
Views: 145
Reputation: 458
map.set()
is a higher level API to update the whole value. It saves the cost of deploying the entry processor class (lambda in the example) to the cluster.
EntryProcessor
is better choice if you want to update a small part of larger object (e.g. just a first name for a large customer object).
Upvotes: 0