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

Add support for KV datatypes (counters, sets, maps) #250

Merged
merged 6 commits into from
Dec 18, 2013

Conversation

seancribbs
Copy link

  • Extracts top-level types into fields as described in yz_dt_extractor.
  • Defines content types that match those used in riak_kv
  • Adds fields and dynamic fields to the default schema.

TODO:

  • riak_test for indexing CRDTs

@seancribbs
Copy link
Author

@rzezeski I'd love a little help here, for some reason yokozuna with my branch creates an unusable cluster in riak_test. In the original directory, the dev nodes start up just fine. In my rtdev, solr bombs. Here's a console output: https://gist.github.com/7936269

@@ -32,7 +32,11 @@
{"application/json",yz_json_extractor},
{"application/xml",yz_xml_extractor},
{"text/plain",yz_text_extractor},
{"text/xml",yz_xml_extractor}]).
{"text/xml",yz_xml_extractor},
Copy link
Contributor

Choose a reason for hiding this comment

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

This list needs to be ordered as the ordsets modules is used to determine extractor.

Copy link
Author

Choose a reason for hiding this comment

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

Addressed in a0fb872

* Extractor registrations have to be sorted.
* There's a tiny delay (about 1s) in committing to Solr, so we have to
  use rt:wait_until/1 for the queries.
* URL-escape fields and terms in search queries going over HTTP.
* Cleanup whitespace
@ghost ghost assigned coderoshi Dec 17, 2013
%% {<<"name_register">>, <<"Ryan Zezeski">>},
%% {<<"phones_set">>, <<"555-5555">>},
%% {<<"phones_set">>, <<"867-5309">>},
%% {<<"page_views_counter">>, <<"1502">>},
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why *_flag is boolean, but *_counter is binary?

Copy link
Author

Choose a reason for hiding this comment

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

I'm following convention of the JSON extractor. Should it be an integer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind, this will work fine. I forgot we converted json numbers to binary too.

@lenary
Copy link

lenary commented Dec 17, 2013

👍 seems all good to me (though I should really run the tests)

@rzezeski
Copy link
Contributor

Yes, please someone make sure they paste the riak_test results output in the PR. All tests but yz_schema_admin should pass.

@seancribbs
Copy link
Author

@rzezeski Is it that my schema changes broke yz_schema_admin or something else?

@rzezeski
Copy link
Contributor

@seancribbs No, caused by upgrade to solr 4.6 (#245).


-spec field_name(field_path_name(), datatype(), binary()) -> binary().
field_name(undefined, map, _Sep) ->
%% (timeforthat)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Got some time for that in 0a31d51

@coderoshi
Copy link
Contributor

+1

@seancribbs
Copy link
Author

👯 WOO!

seancribbs pushed a commit that referenced this pull request Dec 18, 2013
Add support for KV datatypes (counters, sets, maps)
@seancribbs seancribbs merged commit 38e37ee into develop Dec 18, 2013
@seancribbs seancribbs deleted the feature/sdc/crdt-extractors branch December 18, 2013 15:13
@rzezeski
Copy link
Contributor

Where's my riak test output?

@seancribbs
Copy link
Author

@rzezeski Would mine be sufficient? Do you need a full run of verify.sh?

@rzezeski
Copy link
Contributor

@seancribbs I just want to make sure someone ran the full suite. If no one did it's not a huge deal as I will run it on develop soon enough. I know I don't always follow this rule myself but moving forward it would be nice if the result output was a prerequisite for a PR being merged.

@rzezeski
Copy link
Contributor

Dialyzer had two issues with new extractor. I haven't looked at them closely as I'm trying to do something else ATM.

yz_dt_extractor.erl:93: The variable Err can never match since previous clauses completely covered the type #state{}
yz_dt_extractor.erl:99: The call yz_dt_extractor:extract_map(Name::binary()) breaks the contract (field_path_name()) -> fun(({{binary(),module()},term()},state()) -> state())

@seancribbs
Copy link
Author

@rzezeski Thanks, will fix.

@coderoshi
Copy link
Contributor

@rzezeski Sorry about that. My security failure is unrelated to this

yz_wm_extract_test-bitcask   : pass
yz_stat_test-bitcask         : pass
yz_solr_start_timeout-bitcask: pass
yz_siblings-bitcask          : pass
yz_security-bitcask          : fail
yz_schema_admin-bitcask      : pass
yz_rs_migration_test-bitcask : pass
yz_pb-bitcask                : pass
yz_monitor_solr-bitcask      : pass
yz_mapreduce-bitcask         : pass
yz_languages-bitcask         : pass
yz_index_admin-bitcask       : pass
yz_fallback-bitcask          : pass
yz_errors-bitcask            : pass
yz_dt_test-bitcask           : pass
yokozuna_essential-bitcask   : pass
aae_test-bitcask             : pass
---------------------------------------------
1 Tests Failed
16 Tests Passed

@rzezeski
Copy link
Contributor

@coderoshi No problem, thanks for attaching the output.

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.

4 participants