You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-26Lines changed: 23 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,7 +287,7 @@ result = pw.get_result()
287
287
| method | method signature |
288
288
|---|---|
289
289
|`pw.map_reduce`(`my_map_function`, `iterdata`, `my_reduce_function`, `chunk_size`)|`iterdata` contains list of objects in the format of `bucket_name/object_name`|
290
-
|`my_map_function(key, data_stream)`|`key`is an entry from`iterdata` that is assigned to the invocation|
290
+
|`my_map_function`(`key`, `data_stream`)|`key`is an entry from`iterdata` that is assigned to the invocation|
291
291
292
292
#### `map_reduce` where partitioner gets entire bucket
* If `chunk_size=None` then partitioner's granularity is a single object .
319
-
*`ibm_cos`is ibm_boto3 client instance. Can be used to access COSfor aditional operations. See [boto3_client](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#client) for allowed operations
318
+
* If `chunk_size=None` then partitioner's granularity is a single object.
320
319
321
320
| method | method signature |
322
321
|---|---|
323
-
|`pw.map_reduce`(`my_map_function`, `bucket_name`, `my_reduce_function`, `chunk_size`, `ibm_cos`)|`bucket_name` contains the name of the bucket |
324
-
|`my_map_function(bucket, key, data_stream)`|`key`is a data objectfrombucket `bucket` that is assigned to the invocation|
322
+
|`pw.map_reduce`(`my_map_function`, `bucket_name`, `my_reduce_function`, `chunk_size`)|`bucket_name` contains the name of the bucket |
323
+
|`my_map_function`(`bucket`, `key`, `data_stream`, `ibm_cos`) |`key`is a data objectfrom`bucket` that is assigned to the invocation. `ibm_cos`is an optional parameter which provides a `boto3_client` (see [here](#geting-boto3-client-from-any-map-function))|
325
324
326
325
327
326
@@ -352,7 +351,7 @@ result = pw.get_result()
352
351
| method | method signature |
353
352
|---|---|
354
353
|`pw.map_reduce`(`my_map_function`, `iterdata`, `my_reduce_function`, `chunk_size`)|`iterdata` contains list of objects in the format of `http://myurl/myobject.data`|
355
-
|`my_map_function(url, data_stream)`|`url`is an entry from`iterdata` that is assigned to the invocation|
354
+
|`my_map_function`(`url`, `data_stream`)|`url`is an entry from`iterdata` that is assigned to the invocation|
356
355
357
356
### Reducer granularity
358
357
By default there will be one reducer forall the objects. If you need one reducer for each object, you must set the parameter
Any map function can get `ibm_cos` which is [boto3_client](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#client). This allows you to access your IBM COS account from any map function
368
-
369
-
For example
370
-
371
-
import pywren_ibm_cloud as pywren
372
-
import os
373
-
374
-
iterdata= [1, 2, 3, 4]
366
+
Any map function can get `ibm_cos` parameter which is [boto3_client](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#client). This allows you to access your IBM COS account from any map function, for example:
0 commit comments