Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv/MemDB: making memdb code adapt to generic maps #11436

Merged
merged 1 commit into from Oct 21, 2016

Conversation

chhabaramesh
Copy link
Contributor

Changing code to use generic map for MemDB implementation.

Signed-off-by: Ramesh Chander Ramesh.Chander@sandisk.com

@chhabaramesh
Copy link
Contributor Author

@liewegas , please review and merge this, code changes are to make types generic to try different maps

@yuyuyu101
Copy link
Member

why change to std::map, performance reason?

@chhabaramesh
Copy link
Contributor Author

@yuyuyu101 , yes, seems btree map is not scaling much and is compute intensive. Std::map also does not help much with just this change. But change is more of making it use any map by single line change.

@liewegas
Copy link
Member

This also lets us avoid the annoying iterator invalidation logic. Can you add a flag for that too?

@chhabaramesh
Copy link
Contributor Author

@liewegas , will do it today, apologies for the delay in responding.

Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
@chhabaramesh
Copy link
Contributor Author

@liewegas , Iterartor invalidation works this way now:

. If seq does not change, it is valid
. if using btree and seq no has changed, restart iter.
. If not using btree and seq no has changed, but current key still exists, iter is valid.
. If not using btree and seq not has changed and current key does not exists, restart the iter.

I am still keeping seqno logic for all maps since it should be faster then checking "if key exists" every time.

@liewegas liewegas changed the title kv/MemDB:making memdb code adapt to generic maps kv/MemDB: making memdb code adapt to generic maps Oct 21, 2016
@liewegas liewegas merged commit 3b6e11a into ceph:master Oct 21, 2016
@liewegas
Copy link
Member

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants