Skip to content

Full map_callrw with split args #559

@Serpentian

Description

@Serpentian

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:

  1. mode = nil/'full', bucket_ids = nil - this is old full map_callrw, which is executed on every master in the cluster.
  2. mode = partial, bucket_ids = nil- error,bucket_idsmust be inoptsfor partialmap_callrw`
  3. `mode = 'full', bucket_ids = {1, 2, 3} - error, no split arguments were passed
  4. mode = 'full', bucket_ids = {[1] = ..., [2] = ..., [3] = ...} - arguments in bucket_ids are passed only to the replicasets, where these buckets are found, <args> are passed to ALL masters in replicaset
  5. mode = nil/'partial', bucket_ids = {1, 2, 3} - old partial map_reduce, only on repliasets with buckets 1, 2, 3
  6. mode = nil/'partial', bucket_ids = {[1] = ..., [2] = ..., [3] = ...} - split arguments in partial map_reduce, <args> are passed only to replicasets with buckets 1, 2, 3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions