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

Rename install_hook to set_index_flag #35

Merged
merged 2 commits into from
Feb 8, 2013
Merged

Rename install_hook to set_index_flag #35

merged 2 commits into from
Feb 8, 2013

Conversation

coderoshi
Copy link
Contributor

Now that all data is indexed (otherwise AAE won't work) there is no longer a notion of a hook. All data written to KV is passed to Yokozuna for minimal indexing. But now there is a flag yz_index_content to indicate to Yokozuna that the content should also be indexed.

  • Rename the code in the appropriate places: yz_kv and yz_wm_index
  • Update documentation, explain that everything is indexed and what the index flag does.

@ghost ghost assigned coderoshi Jan 29, 2013
-spec uninstall_hook(binary()) -> ok.
uninstall_hook(Bucket) when is_binary(Bucket) ->
-spec unset_index_flag(binary()) -> ok.
unset_index_flag(Bucket) when is_binary(Bucket) ->
set_index_flag(Bucket, false).

Copy link
Contributor

Choose a reason for hiding this comment

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

  • Let's get rid of the two functions above and instead use set_index_flag/2 directly.
  • Add a doc explaining that the index flag indicates whether or not the KV object's value should be indexed. If false only the minimal amount of information about the object is indexed so that Yokozuna knows about it and AAE can function correctly. If true then the object's value will be indexed as well.
  • Add spec.

@rzezeski
Copy link
Contributor Author

rzezeski commented Feb 2, 2013

Sorry, I came off like a prick with that last comment. I'm just worried about tests like these given what I've seen in riak_kv over the last 2 years. Yokozuna is a new project. I'd like to try something different this time around. I'd like to keep all eunit and EQC tests in Yokozuna as pure as possible. I.e. only test pure functions or functions that require the most minimal of state setup that is to setup and teardown. I'd like to push all functional testing out to riak_test (this means the EQC test you wrote would have to move into riak_test, or somewhere other than the eunit tests).

I like keeping eunit/EQC pure because

  • it avoids global state (ETS tables, gen_severs, etc) of one test from interfering with another
  • the tests run faster
  • the tests have less chance of randomly breaking thus people actually run them, a lot of people ignore the failing riak_kv tests because they are so unpredictable
  • it's easier to write tests against (almost) pure functions

@rzezeski
Copy link
Contributor Author

rzezeski commented Feb 8, 2013

+1 to merge

coderoshi added a commit that referenced this pull request Feb 8, 2013
Rename install_hook to set_index_flag
@coderoshi coderoshi merged commit fd96f14 into master Feb 8, 2013
@coderoshi coderoshi deleted the index-flag branch February 8, 2013 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants