-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Motivation
Currently, map_callrw has two modes: full and partial. In case of full mode a user function is executed on all masters in the cluster, if partial mode is used, then the function is executed on masters of the replicasets, on which buckets from bucket_ids were found. In case of partial mode user can split arguments between replicasets, as it was stated in #539, he can even add arguments, which will be passed to all storages, where partial map_callrw is executed. We can extend it even further by allowing to pass some arguments to ALL masters in the cluster, and split the remainings.
API
Now map_callrw has two modes explicitly: map_callrw(<func>, <args>, {mode = <'full'/'partial'>). By default the mode is full, if opts.bucket_ids were not passed, and partial otherwise. We'll have the following behavior:
mode = nil/'full', bucket_ids = nil- this is old fullmap_callrw, which is executed on every master in the cluster.mode = partial, bucket_ids = nil- error,bucket_idsmust be inoptsfor partialmap_callrw`- `mode = 'full', bucket_ids = {1, 2, 3} - error, no split arguments were passed
mode = 'full', bucket_ids = {[1] = ..., [2] = ..., [3] = ...}- arguments inbucket_idsare passed only to the replicasets, where these buckets are found,<args>are passed to ALL masters in replicasetmode = nil/'partial', bucket_ids = {1, 2, 3}- old partial map_reduce, only on repliasets with buckets 1, 2, 3mode = nil/'partial', bucket_ids = {[1] = ..., [2] = ..., [3] = ...}- split arguments in partialmap_reduce,<args>are passed only to replicasets with buckets 1, 2, 3