@brown-ds/distribution 0.0.42 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -1
- package/distribution/all/mr.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,11 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
This is the distribution library. When loaded, distribution introduces functionality supporting the distributed execution of programs. To download it:
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
5
7
|
```sh
|
|
6
8
|
$ npm i '@brown-ds/distribution'
|
|
7
9
|
```
|
|
8
10
|
|
|
9
|
-
This command downloads and installs the distribution library
|
|
11
|
+
This command downloads and installs the distribution library.
|
|
12
|
+
|
|
13
|
+
## Testing
|
|
14
|
+
|
|
15
|
+
There are several categories of tests:
|
|
16
|
+
* Regular Tests (`*.test.js`)
|
|
17
|
+
* Scenario Tests (`*.scenario.js`)
|
|
18
|
+
* Extra Credit Tests (`*.extra.test.js`)
|
|
19
|
+
|
|
20
|
+
By default, tests excluding those with non-distribution in their names are run. Use the options below to control the test suite:
|
|
21
|
+
|
|
22
|
+
### Running Tests
|
|
23
|
+
|
|
24
|
+
1. Run all regular tests (default):
|
|
25
|
+
```sh
|
|
26
|
+
$ npm test
|
|
27
|
+
```
|
|
28
|
+
2. Run scenario tests:
|
|
29
|
+
```sh
|
|
30
|
+
$ npm test -- -c
|
|
31
|
+
```
|
|
32
|
+
3. Run extra credit tests:
|
|
33
|
+
```sh
|
|
34
|
+
$ npm test -- -ec
|
|
35
|
+
```
|
|
36
|
+
4. Run the `non-distribution` tests:
|
|
37
|
+
```sh
|
|
38
|
+
$ npm test -- -n
|
|
39
|
+
```
|
|
40
|
+
5. Combine options:
|
|
41
|
+
```sh
|
|
42
|
+
$ npm test -- -c -ec -n
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
To import the library, be it in a JavaScript file or on the interactive console, run:
|
|
10
48
|
|
|
11
49
|
```js
|
|
12
50
|
let distribution = require("@brown-ds/distribution");
|
package/distribution/all/mr.js
CHANGED
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(
|
|
9
|
+
const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0x268e55={'gid':'all'}){const _0x6c6004={};_0x6c6004['gid']=_0x268e55['gid'];function _0x2bd47b(_0x2aa17d,_0x28f51e){const _0x45fd82=id['getSID'](_0x2aa17d),_0x5b2961={'mapper':_0x2aa17d['map'],'reducer':_0x2aa17d['reduce'],'map':function(_0x49f03e,_0x3f8333,_0x447526,_0x1577ba=()=>{}){if(_0x49f03e['length']==0x3c0+0x1546+-0x1906)_0x1577ba(null,{});else{const _0x2a713a=[];let _0x722c0e=0xb20*-0x1+0x1*0x1a26+-0xf06*0x1;_0x49f03e['forEach'](_0x8babd8=>{distribution[_0x3f8333]['store']['get'](_0x8babd8,(_0x3e9aa5,_0x1b0aa8)=>{_0x722c0e++;const _0x1b5fe4=this['mapper'](_0x8babd8,_0x1b0aa8);Array['isArray'](_0x1b5fe4)?_0x2a713a['push'](..._0x1b5fe4):_0x2a713a['push'](_0x1b5fe4),_0x722c0e==_0x49f03e['length']&&distribution['local']['store']['put'](_0x2a713a,_0x447526+'_map',(_0x36b568,_0x44ebfb)=>{_0x1577ba(_0x36b568,_0x2a713a);});});});}},'shuffle':function(_0x4a816f,_0x47c33c,_0x1b5f4d=function(){}){distribution['local']['store']['get'](_0x47c33c+'_map',(_0x59319a,_0x14ddd6)=>{if(!_0x59319a){let _0x4c3680=0x5fe+-0x2603+0x2005;_0x14ddd6['forEach'](_0x14a7c5=>{const [_0x22412e]=Object['keys'](_0x14a7c5);distribution[_0x4a816f]['mem']['put'](_0x14a7c5[_0x22412e],{'key':_0x22412e,'action':'append'},(_0x9c6a9b,_0x3afd32)=>{_0x4c3680++,_0x4c3680==_0x14ddd6['length']&&_0x1b5f4d(null,_0x14ddd6);});});}else _0x1b5f4d(_0x59319a,{});});},'reduce':function(_0xeeee1f,_0x17c32a,_0x21d61e){distribution['local']['mem']['get']({'key':null,'gid':_0xeeee1f},(_0x5677ed,_0x2057e4)=>{let _0x3e95cc=[],_0x4ca1b2=0x250*0xc+-0x24b5+0x8f5;_0x2057e4['length']==0x136*-0xd+-0xd62+0x1d20&&_0x21d61e(null,null),_0x2057e4['forEach'](_0x1e3bc0=>distribution['local']['mem']['get']({'key':_0x1e3bc0,'gid':_0xeeee1f},(_0x5a2fad,_0x17234d)=>{const _0x24272a=this['reducer'](_0x1e3bc0,_0x17234d);_0x3e95cc=_0x3e95cc['concat'](_0x24272a),_0x4ca1b2++,_0x4ca1b2==_0x2057e4['length']&&_0x21d61e(null,_0x3e95cc);}));});}},_0x20bb11=function(_0x1842ed,_0x37d2d4){const _0x36b480={};return Object['keys'](_0x37d2d4)['forEach'](_0x571a84=>{_0x36b480[_0x571a84]=[];}),_0x1842ed['forEach'](_0x169228=>{const _0x30d5c5=id['getID'](_0x169228),_0x53b5b2=id['naiveHash'](_0x30d5c5,Object['keys'](_0x37d2d4));_0x36b480[_0x53b5b2]['push'](_0x169228);}),_0x36b480;};distribution[_0x6c6004['gid']]['routes']['put'](_0x5b2961,'mr-'+_0x45fd82,(_0x2eaba0,_0x28a5c1)=>{distribution['local']['groups']['get'](_0x6c6004['gid'],(_0x2c64b3,_0x4092af)=>{const _0x45cdf2=_0x20bb11(_0x2aa17d['keys'],_0x4092af);let _0xe9489d=0x2634+-0xe78*0x1+-0x17bc;const _0x12d003=Object['keys'](_0x4092af)['length'],_0x3d12e5={'service':'mr-'+_0x45fd82,'method':'map'};for(const _0x3e246e in _0x4092af){_0x3d12e5['node']=_0x4092af[_0x3e246e];const _0xaccd98=[_0x45cdf2[_0x3e246e],_0x6c6004['gid'],_0x45fd82];distribution['local']['comm']['send'](_0xaccd98,_0x3d12e5,(_0x5f1fb4,_0x5d0dcb)=>{++_0xe9489d;if(_0xe9489d==_0x12d003){const _0x5a34c1={'service':'mr-'+_0x45fd82,'method':'shuffle'};distribution[_0x6c6004['gid']]['comm']['send']([_0x6c6004['gid'],_0x45fd82],_0x5a34c1,(_0x17e26c,_0x3f0000)=>{const _0x190e39={'service':'mr-'+_0x45fd82,'method':'reduce'};distribution[_0x6c6004['gid']]['comm']['send']([_0x6c6004['gid'],_0x45fd82],_0x190e39,(_0x35af5e,_0x112f24)=>{let _0xbdc3cf=[];for(const _0x434cc6 of Object['values'](_0x112f24)){_0x434cc6!==null&&(_0xbdc3cf=_0xbdc3cf['concat'](_0x434cc6));}_0x28f51e(null,_0xbdc3cf);return;distribution[_0x6c6004['gid']]['routes']['rem']('mr-'+_0x45fd82,(_0xa9864,_0x37a160)=>{});});});}});}});});}return{'exec':_0x2bd47b};};module['exports']=mr;
|
|
10
10
|
/* eslint-enable */
|