Skip to content

add optional key transformer to support new key formats #103

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

Merged
merged 2 commits into from
Sep 20, 2013

Conversation

evanmcc
Copy link
Contributor

@evanmcc evanmcc commented Aug 27, 2013

Since key formats can change over time, we should allow the application some control of the versions that are read off of the disk. This patch is adds this capability, in order to allow a change in riak_kv that makes the keys take up less space in memory.

@@ -121,6 +123,10 @@ open(Dirname, Opts) ->
%% Get the number of seconds we are willing to wait for the keydir init to timeout
WaitTime = timer:seconds(get_opt(open_timeout, Opts)),

%% Set the key transform for this cask
KeyTransformFun = get_opt(key_transform, Opts),
erlang:put(key_transform, KeyTransformFun),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also stroed in the 'state', why store it in 2 places in the process dictionary?

@Vagabond
Copy link
Contributor

Other than the cosmetic issues mentioned, this looks and works fine +1 once concerns are addressed.

@Vagabond
Copy link
Contributor

Looks good. +1.

evanmcc added a commit that referenced this pull request Sep 20, 2013
add optional key transformer to support new key formats
@evanmcc evanmcc merged commit b95bb9a into develop Sep 20, 2013
@seancribbs seancribbs deleted the pevm-keydir-overhead branch April 1, 2015 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants