Hello Todd Lipcon, Alexey Serbin, Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/3593

to look at the new patch set (#9).

Change subject: Add ComputeIfAbsent methods to map-util
......................................................................

Add ComputeIfAbsent methods to map-util

This adds two new ComputeIfAbsent methods to map-util, inspired by java's 
implementation,
which can be found here:

https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html#computeIfAbsent-K-java.util.function.Function-

The first one, ComputeIfAbsent, is a simple c++ implementation of the exact same
concept: Retreive a value from a map; if it doesn't exist compute it using a 
lambda
function and insert it first.

The second one is a slight variation that returns a pair instead of a pointer 
to the
value. The pair includes the pointer to the value, but also a bool indicating 
whether
the value was initially absent.

Change-Id: Iba9fa8038e699e66d34ce541cd02c77f46691315
---
M src/kudu/gutil/map-util.h
M src/kudu/util/map-util-test.cc
2 files changed, 70 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/93/3593/9
-- 
To view, visit http://gerrit.cloudera.org:8080/3593
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iba9fa8038e699e66d34ce541cd02c77f46691315
Gerrit-PatchSet: 9
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <dral...@apache.org>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to