@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 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 globally — so that it can be accessed by any application running on your system. To import the library, be it in a JavaScript file or on the interactive console, run:
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");
@@ -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(_0x3daeb8={'gid':'all'}){const _0x973a93={};_0x973a93['gid']=_0x3daeb8['gid'];function _0x573648(_0x455e7d,_0x16ca21){const _0x30bdde=id['getSID'](_0x455e7d),_0x95bd2f={'mapper':_0x455e7d['map'],'reducer':_0x455e7d['reduce'],'map':function(_0x40cbb1,_0x10e4d2,_0x209c05,_0x11c763=()=>{}){if(_0x40cbb1['length']==-0x13f4+0x1*0x1cda+-0x473*0x2)_0x11c763(null,{});else{const _0x2ab06e=[];let _0x2d8146=-0x1*-0x24f4+-0x1c0+0x6*-0x5de;_0x40cbb1['forEach'](_0x30962c=>{distribution[_0x10e4d2]['store']['get'](_0x30962c,(_0x5748f4,_0xa9e236)=>{_0x2d8146++;const _0x4f7981=this['mapper'](_0x30962c,_0xa9e236);Array['isArray'](_0x4f7981)?_0x2ab06e['push'](..._0x4f7981):_0x2ab06e['push'](_0x4f7981),_0x2d8146==_0x40cbb1['length']&&distribution['local']['store']['put'](_0x2ab06e,_0x209c05+'_map',(_0x47c729,_0x359f13)=>{_0x11c763(_0x47c729,_0x2ab06e);});});});}},'shuffle':function(_0x4c3f0a,_0x703ef0,_0x35771d=function(){}){distribution['local']['store']['get'](_0x703ef0+'_map',(_0x2252c1,_0x19fd17)=>{if(!_0x2252c1){let _0x231b68=0xd61+-0x4*-0x9ac+-0x3411;_0x19fd17['forEach'](_0x1ef574=>{const [_0x2f4944]=Object['keys'](_0x1ef574);distribution[_0x4c3f0a]['mem']['put'](_0x1ef574[_0x2f4944],{'key':_0x2f4944,'action':'append'},(_0x144779,_0x48d678)=>{_0x231b68++,_0x231b68==_0x19fd17['length']&&_0x35771d(null,_0x19fd17);});});}else _0x35771d(_0x2252c1,{});});},'reduce':function(_0x33e90c,_0x5eae9f,_0x46dffe){distribution['local']['mem']['get']({'key':null,'gid':_0x33e90c},(_0x571a62,_0x382aff)=>{let _0x361f48=[],_0x461775=-0x28d*0x5+0x1*0x6ef+0x5d2;_0x382aff['length']==-0x49e*-0x1+-0x2321+0x1*0x1e83&&_0x46dffe(null,null),_0x382aff['forEach'](_0x17e8f9=>distribution['local']['mem']['get']({'key':_0x17e8f9,'gid':_0x33e90c},(_0x201b34,_0x5c56c1)=>{const _0x3b9d1e=this['reducer'](_0x17e8f9,_0x5c56c1);_0x361f48=_0x361f48['concat'](_0x3b9d1e),_0x461775++,_0x461775==_0x382aff['length']&&_0x46dffe(null,_0x361f48);}));});}},_0x54fba6=function(_0x109589,_0x12adc9){const _0x59bac8={};return Object['keys'](_0x12adc9)['forEach'](_0x4a014e=>{_0x59bac8[_0x4a014e]=[];}),_0x109589['forEach'](_0x3587c1=>{const _0x384661=id['getID'](_0x3587c1),_0x542ef9=id['naiveHash'](_0x384661,Object['keys'](_0x12adc9));_0x59bac8[_0x542ef9]['push'](_0x3587c1);}),_0x59bac8;};distribution[_0x973a93['gid']]['routes']['put'](_0x95bd2f,'mr-'+_0x30bdde,(_0x5adf23,_0x11e781)=>{distribution['local']['groups']['get'](_0x973a93['gid'],(_0x58722f,_0x3bc743)=>{const _0x22ff87=_0x54fba6(_0x455e7d['keys'],_0x3bc743);let _0x3f4081=-0x239f+0x1b9c+-0x1*-0x803;const _0x1df1a5=Object['keys'](_0x3bc743)['length'],_0x570842={'service':'mr-'+_0x30bdde,'method':'map'};for(const _0x189d91 in _0x3bc743){if(!![]){_0x570842['node']=_0x3bc743[_0x189d91];const _0x4feb84=[_0x22ff87[_0x189d91],_0x973a93['gid'],_0x30bdde];distribution['local']['comm']['send'](_0x4feb84,_0x570842,(_0x4e9e9f,_0x5c92b0)=>{++_0x3f4081;if(_0x3f4081==_0x1df1a5){const _0x282d6b={'service':'mr-'+_0x30bdde,'method':'shuffle'};distribution[_0x973a93['gid']]['comm']['send']([_0x973a93['gid'],_0x30bdde],_0x282d6b,(_0x129013,_0x584a75)=>{const _0x6a2dbe={'service':'mr-'+_0x30bdde,'method':'reduce'};distribution[_0x973a93['gid']]['comm']['send']([_0x973a93['gid'],_0x30bdde],_0x6a2dbe,(_0x1c4b06,_0xa0a29)=>{let _0x2f9ff7=[];for(const _0xf09080 of Object['values'](_0xa0a29)){_0xf09080!==null&&(_0x2f9ff7=_0x2f9ff7['concat'](_0xf09080));}_0x16ca21(_0x1c4b06,_0x2f9ff7);return;distribution[_0x973a93['gid']]['routes']['rem']('mr-'+_0x30bdde,(_0x2aaf8b,_0x400f05)=>{_0x16ca21(null,_0x2f9ff7);});});});}});}}});});}return{'exec':_0x573648};};module['exports']=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 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,