Skip to content

Add optional bucket_type parameter for Map/Reduce#385

Merged
borshop merged 1 commit into
masterfrom
feature/bch/buckettypes4mr
Dec 17, 2014
Merged

Add optional bucket_type parameter for Map/Reduce#385
borshop merged 1 commit into
masterfrom
feature/bch/buckettypes4mr

Conversation

@hazen
Copy link
Copy Markdown

@hazen hazen commented Dec 2, 2014

It looks like support for bucket types were overlooked when the riak-python-client was updated to version 2.1.0 to support Riak 2.0. This addresses issue #383.

Essentially the add() function now supports an optional bucket_type argument which will percolate down to the M/R JSON sent to Riak. If it is not supplied or is None it is assumed that the default bucket type is being used. index() was also updated, but search() was not since it actually now uses Solr indexes instead of bucket types.

@alirizakeles
Copy link
Copy Markdown
Contributor

Thanks @javajolt. I tested with your patch. So it seems working. It runs on bucket 'maps'/'cars', as expected. I'll continue to work with bucket_type map reduce and send more feedback.

@hazen hazen force-pushed the feature/bch/buckettypes4mr branch from 658127f to 89635c4 Compare December 10, 2014 23:47
Comment thread riak/mapreduce.py Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This will always be true, but bucket.bucket_type.name might be "default". Even untyped buckets have a bucket type now.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I suspect I actually mean the argument bucket_type instead of the bucket.bucket_type, i.e., the case where the user actually specified the bucket type. We could always take the bucket_type from the RiakBucketobject here or only add it to the M/R job iff the user explicitly adds it. That was my thought for safest backwards compatibility.

@hazen hazen force-pushed the feature/bch/buckettypes4mr branch 2 times, most recently from e030f30 to c448c75 Compare December 15, 2014 15:15
Comment thread riak/mapreduce.py Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is much better, thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@seancribbs

if isinstance(bucket, RiakBucket):

Would be even better.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@pigmej Agree!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@seancribbs @pigmej Corrected

@hazen hazen force-pushed the feature/bch/buckettypes4mr branch from c448c75 to 540ae75 Compare December 15, 2014 16:37
@seancribbs
Copy link
Copy Markdown

👍 540ae75

borshop added a commit that referenced this pull request Dec 17, 2014
Add optional `bucket_type` parameter for Map/Reduce

Reviewed-by: seancribbs
@hazen
Copy link
Copy Markdown
Author

hazen commented Dec 17, 2014

@borshop merge

@borshop borshop merged commit 540ae75 into master Dec 17, 2014
@hazen hazen deleted the feature/bch/buckettypes4mr branch December 17, 2014 16:57
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.

6 participants