@brown-ds/distribution 0.0.43 → 0.0.45

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=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0x26f3a6,_0x2b13cd,_0x4bfe72){typeof _0x2b13cd==='object'&&(_0x2b13cd=_0x2b13cd['key']),distribution[_0x26f3a6['gid']]['status']['get']('nid',(_0x3a6f7d,_0xf28e9a)=>{const _0x551470=Object['values'](_0xf28e9a),_0x4d8f22=util['id']['getID'](_0x2b13cd),_0x9115a0=_0x26f3a6['hash'](_0x4d8f22,_0x551470),_0x2884cf=_0x9115a0['substring'](-0xa18+0x17d8+0xb*-0x140,-0x209f+-0x8*0x232+0x1b*0x1dc);distribution['local']['groups']['get'](_0x26f3a6['gid'],(_0x5d4297,_0x570ecc)=>{const _0x2b2a6d=_0x570ecc[_0x2884cf];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x2b13cd)+'group:\x20'+JSON['stringify'](_0x570ecc)+'\x20node:\x20'+JSON['stringify'](_0x2b2a6d)+'nid:\x20'+JSON['stringify'](_0x9115a0)+'\x20sid:\x20'+JSON['stringify'](_0x2884cf)),_0x4bfe72(_0x2b2a6d);});});}function normalize(_0xaaad88,_0x2f9851){const _0x59c477={};_0xaaad88===null&&(_0xaaad88={});if(typeof _0xaaad88==='string')_0x59c477['key']=_0xaaad88,_0x59c477['gid']=_0x2f9851,_0x59c477['action']='put';else typeof _0xaaad88==='object'&&(_0x59c477['key']=_0xaaad88['key'],_0x59c477['gid']=_0xaaad88['gid']||_0x2f9851,_0x59c477['action']=_0xaaad88['action']||'put');return _0x59c477;};const mem=function(_0x38b43c){const _0x4bfab0={};return _0x4bfab0['gid']=_0x38b43c['gid']||'all',_0x4bfab0['hash']=_0x38b43c['hash']||util['id']['naiveHash'],{'get':(_0x539cfb,_0x3ca648)=>{if(!_0x539cfb){const _0x200e56=[{'key':null,'gid':_0x4bfab0['gid']}];distribution[_0x4bfab0['gid']]['comm']['send'](_0x200e56,{'service':'mem','method':'get'},(_0x42d008,_0x39c873)=>{const _0x476352=Object['values'](_0x39c873)['reduce']((_0x56930c,_0x4f3838)=>_0x56930c['concat'](_0x4f3838),[]);_0x3ca648(_0x42d008,_0x476352);});return;}_0x539cfb=normalize(_0x539cfb,_0x4bfab0['gid']),getNode(_0x4bfab0,_0x539cfb,_0x5624e1=>{const _0x4867ef=[_0x539cfb],_0x550997={'service':'mem','method':'get','node':_0x5624e1};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x539cfb)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x5624e1)),distribution['local']['comm']['send'](_0x4867ef,_0x550997,_0x3ca648);});},'put':(_0x1076c5,_0x14a720,_0x38b91b)=>{_0x14a720=_0x14a720||util['id']['getID'](_0x1076c5),_0x14a720=normalize(_0x14a720,_0x4bfab0['gid']),getNode(_0x4bfab0,_0x14a720,_0x173faa=>{const _0x318f69=[_0x1076c5,_0x14a720],_0x5ae861={'service':'mem','method':'put','node':_0x173faa};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x1076c5)+('configurat'+'ion:\x20')+JSON['stringify'](_0x14a720)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x173faa)),distribution['local']['comm']['send'](_0x318f69,_0x5ae861,_0x38b91b);});},'del':(_0x52f236,_0x2e1b23)=>{getNode(_0x4bfab0,_0x52f236,_0x35ab55=>{const _0x4d1b6a=[{'key':_0x52f236,'gid':_0x4bfab0['gid']}],_0x4b2839={'service':'mem','method':'del','node':_0x35ab55};distribution['local']['comm']['send'](_0x4d1b6a,_0x4b2839,_0x2e1b23);});},'reconf':(_0x1c0fef,_0x5d9a02)=>{distribution[_0x4bfab0['gid']]['mem']['get'](null,(_0x1ee8d4,_0x4375c9)=>{distribution[_0x4bfab0['gid']]['status']['get']('nid',(_0x1cbe31,_0x55e755)=>{const _0x181554=Object['values'](_0x55e755),_0x551028=Object['values'](_0x1c0fef)['map'](_0x5173d1=>util['id']['getNID'](_0x5173d1));log('[mem.recon'+'f\x20received'+'\x20'+_0x4375c9['length']+('\x20keys\x20from'+'\x20')+_0x55e755['length']+'\x20nodes');let _0x5eabca=0x19d1+-0xd1e+0xcb3*-0x1;const _0x54cbbe=()=>{_0x5eabca===_0x4375c9['length']&&_0x5d9a02();};if(_0x4375c9['length']===-0xd*0xd4+0x1ec*-0x1+0xcb0){_0x5d9a02();return;}for(const _0x27385f of _0x4375c9){const _0x57571b=util['id']['getID'](_0x27385f),_0x5539d0=_0x4bfab0['hash'](_0x57571b,_0x551028),_0x3e1524=_0x4bfab0['hash'](_0x57571b,_0x181554);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x5539d0+'\x20new\x20nid:\x20'+_0x3e1524);if(_0x5539d0===_0x3e1524){_0x5eabca++,_0x54cbbe();continue;}const _0x392187=_0x1c0fef[_0x5539d0['substring'](-0x1*0x12bf+-0x4a3*0x8+0x37d7,0xd5*-0x3+-0xcf5+0xf79)],_0x4e2910=[{'key':_0x27385f,'gid':_0x4bfab0['gid']}],_0x4eef53={'service':'mem','method':'del','node':_0x392187};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x27385f+'\x20from\x20'+JSON['stringify'](_0x4eef53)),distribution['local']['comm']['send'](_0x4e2910,_0x4eef53,(_0x216c58,_0x5a1e0a)=>{distribution[_0x4bfab0['gid']]['mem']['put'](_0x5a1e0a,_0x27385f,(_0xa9f57a,_0x5c1d7a)=>{_0x5eabca++,_0x54cbbe();});});}});});}};};module['exports']=mem;
9
+ const distribution=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0x4ad3a9,_0xf7c916,_0x5d2cfc){typeof _0xf7c916==='object'&&(_0xf7c916=_0xf7c916['key']),distribution[_0x4ad3a9['gid']]['status']['get']('nid',(_0x23760d,_0x3b44e9)=>{const _0x1c5729=Object['values'](_0x3b44e9),_0x5befe3=util['id']['getID'](_0xf7c916),_0x2896e6=_0x4ad3a9['hash'](_0x5befe3,_0x1c5729),_0x2bf7a2=_0x2896e6['substring'](0xa07+-0x322*-0x8+-0x2317*0x1,0x50b*0x2+0x2485+-0x174b*0x2);distribution['local']['groups']['get'](_0x4ad3a9['gid'],(_0x273e38,_0x107c25)=>{const _0x52d151=_0x107c25[_0x2bf7a2];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0xf7c916)+'group:\x20'+JSON['stringify'](_0x107c25)+'\x20node:\x20'+JSON['stringify'](_0x52d151)+'nid:\x20'+JSON['stringify'](_0x2896e6)+'\x20sid:\x20'+JSON['stringify'](_0x2bf7a2)),_0x5d2cfc(_0x52d151);});});}function normalize(_0x2d17db,_0x5379c4){const _0x1dcae2={};_0x2d17db===null&&(_0x2d17db={});if(typeof _0x2d17db==='string')_0x1dcae2['key']=_0x2d17db,_0x1dcae2['gid']=_0x5379c4,_0x1dcae2['action']='put';else typeof _0x2d17db==='object'&&(_0x1dcae2['key']=_0x2d17db['key'],_0x1dcae2['gid']=_0x2d17db['gid']||_0x5379c4,_0x1dcae2['action']=_0x2d17db['action']||'put');return _0x1dcae2;};function mem(_0x5e75cd){const _0x4d8e3b={};return _0x4d8e3b['gid']=_0x5e75cd['gid']||'all',_0x4d8e3b['hash']=_0x5e75cd['hash']||util['id']['naiveHash'],{'get':(_0xa07fc5,_0x37158d)=>{if(!_0xa07fc5){const _0x2d53f2=[{'key':null,'gid':_0x4d8e3b['gid']}];distribution[_0x4d8e3b['gid']]['comm']['send'](_0x2d53f2,{'service':'mem','method':'get'},(_0x204022,_0x567384)=>{const _0x1c4fe4=Object['values'](_0x567384)['reduce']((_0x5288fa,_0x2d7964)=>_0x5288fa['concat'](_0x2d7964),[]);_0x37158d(_0x204022,_0x1c4fe4);});return;}_0xa07fc5=normalize(_0xa07fc5,_0x4d8e3b['gid']),getNode(_0x4d8e3b,_0xa07fc5,_0x5d4966=>{const _0x2aa6f8=[_0xa07fc5],_0xfb8bbd={'service':'mem','method':'get','node':_0x5d4966};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0xa07fc5)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x5d4966)),distribution['local']['comm']['send'](_0x2aa6f8,_0xfb8bbd,_0x37158d);});},'put':(_0x501416,_0x8d8325,_0x33543b)=>{_0x8d8325=_0x8d8325||util['id']['getID'](_0x501416),_0x8d8325=normalize(_0x8d8325,_0x4d8e3b['gid']),getNode(_0x4d8e3b,_0x8d8325,_0x310d10=>{const _0xeb3185=[_0x501416,_0x8d8325],_0x4afffb={'service':'mem','method':'put','node':_0x310d10};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x501416)+('configurat'+'ion:\x20')+JSON['stringify'](_0x8d8325)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x310d10)),distribution['local']['comm']['send'](_0xeb3185,_0x4afffb,_0x33543b);});},'del':(_0x3d2ae9,_0xeed2eb)=>{getNode(_0x4d8e3b,_0x3d2ae9,_0xbcc298=>{const _0x3955f1=[{'key':_0x3d2ae9,'gid':_0x4d8e3b['gid']}],_0x39d846={'service':'mem','method':'del','node':_0xbcc298};distribution['local']['comm']['send'](_0x3955f1,_0x39d846,_0xeed2eb);});},'reconf':(_0x2e09eb,_0x58e9f5)=>{distribution[_0x4d8e3b['gid']]['mem']['get'](null,(_0x19f449,_0x26105a)=>{distribution[_0x4d8e3b['gid']]['status']['get']('nid',(_0x19cea5,_0x58e0c2)=>{const _0x4b8977=Object['values'](_0x58e0c2),_0x57e25a=Object['values'](_0x2e09eb)['map'](_0xc5d20e=>util['id']['getNID'](_0xc5d20e));log('[mem.recon'+'f\x20received'+'\x20'+_0x26105a['length']+('\x20keys\x20from'+'\x20')+_0x58e0c2['length']+'\x20nodes');let _0xa11d7a=0x14a9+0x929*-0x3+0x6d2;const _0x4f2592=()=>{_0xa11d7a===_0x26105a['length']&&_0x58e9f5();};if(_0x26105a['length']===0x26c0+-0x19*-0xca+0x1d3d*-0x2){_0x58e9f5();return;}for(const _0x3f5f53 of _0x26105a){const _0x11ce1f=util['id']['getID'](_0x3f5f53),_0x45440f=_0x4d8e3b['hash'](_0x11ce1f,_0x57e25a),_0x734746=_0x4d8e3b['hash'](_0x11ce1f,_0x4b8977);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x45440f+'\x20new\x20nid:\x20'+_0x734746);if(_0x45440f===_0x734746){_0xa11d7a++,_0x4f2592();continue;}const _0x1f2b12=_0x2e09eb[_0x45440f['substring'](-0x1*0x4a3+0x13c0*0x1+-0xf1d,0x234a+-0xfb6*-0x1+-0x32fb)],_0x56fd90=[{'key':_0x3f5f53,'gid':_0x4d8e3b['gid']}],_0x49c988={'service':'mem','method':'del','node':_0x1f2b12};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x3f5f53+'\x20from\x20'+JSON['stringify'](_0x49c988)),distribution['local']['comm']['send'](_0x56fd90,_0x49c988,(_0x35d942,_0x1d57f4)=>{distribution[_0x4d8e3b['gid']]['mem']['put'](_0x1d57f4,_0x3f5f53,(_0x280206,_0x5801af)=>{_0xa11d7a++,_0x4f2592();});});}});});}};};module['exports']=mem;
10
10
  /* eslint-enable */
@@ -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(_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;
9
+ const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0x462fee){const _0x50884d={'gid':_0x462fee['gid']||'global'};function _0x149476(_0x14d54c,_0xb7dd0f){const _0x2388d2=id['getSID'](_0x14d54c),_0x4b7098={'mapper':_0x14d54c['map'],'reducer':_0x14d54c['reduce'],'map':function(_0x977dec,_0x51296c,_0x4d6109,_0x18075a){if(_0x977dec['length']==0x1a8b+-0x2680+0xbf5)_0x18075a(null,{});else{const _0x26f165=[];let _0x3b008b=-0x70e+-0x43*-0x2+0x4c*0x16;_0x977dec['forEach'](_0x2664a8=>{distribution[_0x51296c]['store']['get'](_0x2664a8,(_0x1f70bd,_0x38e222)=>{_0x3b008b++;const _0x2ca044=this['mapper'](_0x2664a8,_0x38e222);Array['isArray'](_0x2ca044)?_0x26f165['push'](..._0x2ca044):_0x26f165['push'](_0x2ca044),_0x3b008b==_0x977dec['length']&&distribution['local']['store']['put'](_0x26f165,_0x4d6109+'_map',(_0x2216d8,_0x596883)=>{_0x18075a(_0x2216d8,_0x26f165);});});});}},'shuffle':function(_0x19e3af,_0x267741,_0x24b4b4){distribution['local']['store']['get'](_0x267741+'_map',(_0x1e4656,_0x532ce9)=>{if(!_0x1e4656){let _0x255c91=-0x4*0x7e9+0x1eb5+0xef;_0x532ce9['forEach'](_0x3827bd=>{const [_0x155b71]=Object['keys'](_0x3827bd);distribution[_0x19e3af]['mem']['put'](_0x3827bd[_0x155b71],{'key':_0x155b71,'action':'append'},(_0x1df586,_0x41c9a8)=>{_0x255c91++,_0x255c91==_0x532ce9['length']&&_0x24b4b4(null,_0x532ce9);});});}else _0x24b4b4(_0x1e4656,{});});},'reduce':function(_0x96312,_0x28135c,_0x430a4c){distribution['local']['mem']['get']({'key':null,'gid':_0x96312},(_0xecbade,_0xfb2a8c)=>{let _0x5030ed=[],_0x1603e0=-0x966*0x3+-0x3b*0x64+-0x1*-0x333e;_0xfb2a8c['length']==-0x3b7+-0x819*-0x2+-0xc7b&&_0x430a4c(null,null),_0xfb2a8c['forEach'](_0x55ad4a=>distribution['local']['mem']['get']({'key':_0x55ad4a,'gid':_0x96312},(_0x5f3ff8,_0x2ab892)=>{const _0x2ca846=this['reducer'](_0x55ad4a,_0x2ab892);_0x5030ed=_0x5030ed['concat'](_0x2ca846),_0x1603e0++,_0x1603e0==_0xfb2a8c['length']&&_0x430a4c(null,_0x5030ed);}));});}},_0x358e36=function(_0x3c9ead,_0x3f26ed){const _0x7a0bf1={};return Object['keys'](_0x3f26ed)['forEach'](_0x48d179=>{_0x7a0bf1[_0x48d179]=[];}),_0x3c9ead['forEach'](_0x86ab5d=>{const _0x458b3c=id['getID'](_0x86ab5d),_0x47e494=id['naiveHash'](_0x458b3c,Object['keys'](_0x3f26ed));_0x7a0bf1[_0x47e494]['push'](_0x86ab5d);}),_0x7a0bf1;};distribution[_0x50884d['gid']]['routes']['put'](_0x4b7098,'mr-'+_0x2388d2,(_0x45f336,_0x25b51b)=>{distribution['local']['groups']['get'](_0x50884d['gid'],(_0x5e071e,_0x55a50f)=>{const _0x313f9c=_0x358e36(_0x14d54c['keys'],_0x55a50f);let _0x2a1d4d=-0x1a7e*-0x1+0x267a+-0x40f8;const _0x5b62bc=Object['keys'](_0x55a50f)['length'],_0x3751c0={'service':'mr-'+_0x2388d2,'method':'map'};for(const _0x46a531 in _0x55a50f){_0x3751c0['node']=_0x55a50f[_0x46a531];const _0x4078fd=[_0x313f9c[_0x46a531],_0x50884d['gid'],_0x2388d2];distribution['local']['comm']['send'](_0x4078fd,_0x3751c0,(_0x5c3dce,_0x458883)=>{++_0x2a1d4d;if(_0x2a1d4d==_0x5b62bc){const _0x30af82={'service':'mr-'+_0x2388d2,'method':'shuffle'};distribution[_0x50884d['gid']]['comm']['send']([_0x50884d['gid'],_0x2388d2],_0x30af82,(_0x1fb6fe,_0x43b114)=>{const _0x201459={'service':'mr-'+_0x2388d2,'method':'reduce'};distribution[_0x50884d['gid']]['comm']['send']([_0x50884d['gid'],_0x2388d2],_0x201459,(_0x394764,_0x5388e0)=>{let _0xd16900=[];for(const _0x518317 of Object['values'](_0x5388e0)){_0x518317!==null&&(_0xd16900=_0xd16900['concat'](_0x518317));}_0xb7dd0f(null,_0xd16900);return;distribution[_0x50884d['gid']]['routes']['rem']('mr-'+_0x2388d2,(_0x423ffa,_0x30da0f)=>{});});});}});}});});}return{'exec':_0x149476};};module['exports']=mr;
10
10
  /* eslint-enable */
@@ -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 http=require('http'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g');function send(_0x254632,_0x57d86e,_0x3b93bd=()=>{}){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x254632)+'to\x20'+_0x57d86e['service']+':'+_0x57d86e['method']+'\x20on\x20'+_0x57d86e['node']['ip']+':'+_0x57d86e['node']['port']);if(!_0x254632 instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');const _0x16cf3f=_0x57d86e['node'],_0x2bf455=_0x57d86e['service'],_0x5877d7=_0x57d86e['method'],_0x1bb10f=serialization['serialize'](_0x254632),_0x316fdd={'hostname':_0x16cf3f['ip'],'port':_0x16cf3f['port'],'path':'/'+_0x2bf455+'/'+_0x5877d7,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x1bb10f)}},_0x18c69a=http['request'](_0x316fdd,_0x4f406e=>{let _0x2b2218='';_0x4f406e['on']('data',function(_0x44eb34){_0x2b2218+=_0x44eb34;}),_0x4f406e['on']('end',function(){_0x3b93bd&&_0x3b93bd(...serialization['deserializ'+'e'](_0x2b2218));}),_0x4f406e['on']('error',function(_0x20919a){_0x3b93bd&&_0x3b93bd(new Error('Error\x20on\x20r'+'esponse'));});});_0x18c69a['on']('error',function(_0x5e99d9){_0x3b93bd&&_0x3b93bd(new Error(_0x5e99d9));}),_0x18c69a['write'](_0x1bb10f),_0x18c69a['end']();}module['exports']={'send':send};
9
+ const http=require('http'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g');function send(_0x19ab05,_0x47382d,_0x34e933){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x19ab05)+'to\x20'+_0x47382d['service']+':'+_0x47382d['method']+'\x20on\x20'+_0x47382d['node']['ip']+':'+_0x47382d['node']['port']);if(!_0x19ab05 instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');const _0x4f2af8=_0x47382d['node'],_0x136253=_0x47382d['service'],_0x189283=_0x47382d['method'],_0x4e16b7=serialization['serialize'](_0x19ab05),_0x28a281={'hostname':_0x4f2af8['ip'],'port':_0x4f2af8['port'],'path':'/'+_0x136253+'/'+_0x189283,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x4e16b7)}},_0x3c44a9=http['request'](_0x28a281,_0x2f5d1f=>{let _0xdda473='';_0x2f5d1f['on']('data',function(_0x169cce){_0xdda473+=_0x169cce;}),_0x2f5d1f['on']('end',function(){_0x34e933&&_0x34e933(...serialization['deserializ'+'e'](_0xdda473));}),_0x2f5d1f['on']('error',function(_0x40a4c2){_0x34e933&&_0x34e933(new Error('Error\x20on\x20r'+'esponse'));});});_0x3c44a9['on']('error',function(_0x41a17d){_0x34e933&&_0x34e933(new Error(_0x41a17d));}),_0x3c44a9['write'](_0x4e16b7),_0x3c44a9['end']();}module['exports']={'send':send};
10
10
  /* eslint-enable */
@@ -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 id=require('../util/id'),log=require('../util/lo'+'g'),kvStore={'store':new Map(),'get'(_0xd93ee){if(!this['store'][_0xd93ee['gid']])return undefined;return this['store'][_0xd93ee['gid']][_0xd93ee['key']];},'put'(_0x45027e,_0x4e8218){!this['store'][_0x45027e['gid']]&&(this['store'][_0x45027e['gid']]=new Map()),this['store'][_0x45027e['gid']][_0x45027e['key']]=_0x4e8218;},'append'(_0x1a77b9,_0x1c3d04){!this['get'](_0x1a77b9)&&this['put'](_0x1a77b9,[]),!Array['isArray'](this['get'](_0x1a77b9))&&this['put'](_0x1a77b9,[this['get'](_0x1a77b9)]),Array['isArray'](_0x1c3d04)?this['put'](_0x1a77b9,this['get'](_0x1a77b9)['concat'](_0x1c3d04)):this['store'][_0x1a77b9['gid']][_0x1a77b9['key']]['push'](_0x1c3d04);},'del'(_0x226963){if(!this['store'][_0x226963['gid']])return undefined;const _0x417f6e=this['store'][_0x226963['gid']][_0x226963['key']];return delete this['store'][_0x226963['gid']][_0x226963['key']],_0x417f6e;},'toString'(){let _0x42998c='';for(const _0x38089 in this['store']){_0x42998c+=_0x38089+':\x20'+JSON['stringify'](this['store'][_0x38089]);}return _0x42998c;}};function normalize(_0x263abd){const _0x28531d={};_0x263abd===null&&(_0x263abd={});if(typeof _0x263abd==='string')_0x28531d['key']=_0x263abd,_0x28531d['gid']='local',_0x28531d['action']='put';else typeof _0x263abd==='object'&&(_0x28531d['key']=_0x263abd['key'],_0x28531d['gid']=_0x263abd['gid'],_0x28531d['action']=_0x263abd['action']);return _0x28531d;};const mem={};mem['put']=function(_0x3b4691,_0x295b4d,_0x20c572){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x295b4d)+'state:\x20'+JSON['stringify'](_0x3b4691)+'\x20store:\x20'+kvStore['toString']()),_0x20c572=_0x20c572||function(){},_0x295b4d=normalize(_0x295b4d),_0x295b4d['key']=_0x295b4d['key']||id['getID'](_0x3b4691),_0x295b4d['gid']=_0x295b4d['gid']||'local',_0x295b4d['action']=_0x295b4d['action']||'put',kvStore[_0x295b4d['action']](_0x295b4d,_0x3b4691),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x20c572&&_0x20c572(null,_0x3b4691);},mem['get']=function(_0x1d9e8e,_0x296b9a){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x1d9e8e)+'\x20store:\x20'+kvStore['toString']()),_0x296b9a=_0x296b9a||function(){},_0x1d9e8e=normalize(_0x1d9e8e),_0x1d9e8e['gid']=_0x1d9e8e['gid']||'local';if(!_0x1d9e8e['key']){let _0x31046b=kvStore['store'][_0x1d9e8e['gid']]||{};_0x31046b=Object['keys'](_0x31046b),_0x296b9a(null,_0x31046b);return;}const _0x11af33=kvStore['get'](_0x1d9e8e);_0x11af33?_0x296b9a(null,_0x11af33):_0x296b9a(new Error('Memory\x20key'+'\x20\x22'+_0x1d9e8e['key']+('\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20not\x20found'+'\x20for\x20')+_0x1d9e8e['gid']+'\x27s\x20store'));},mem['del']=function(_0x37c1bd,_0xbad4cf){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x37c1bd)+'\x20store:\x20'+kvStore['toString']()),_0xbad4cf=_0xbad4cf||function(){},_0x37c1bd=normalize(_0x37c1bd);const _0x59e224=kvStore['del'](_0x37c1bd);log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x59e224?_0xbad4cf(null,_0x59e224):_0xbad4cf(new Error('Memory\x20key'+'\x20\x22'+_0x37c1bd['key']+('\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'not\x20found\x20'+'for\x20')+_0x37c1bd['gid']+'\x27s\x20store'));},module['exports']=mem;
9
+ const id=require('../util/id'),log=require('../util/lo'+'g'),kvStore={'store':new Map(),'get'(_0x2e2196){if(!this['store'][_0x2e2196['gid']])return undefined;return this['store'][_0x2e2196['gid']][_0x2e2196['key']];},'put'(_0x59ae73,_0x5d9a55){!this['store'][_0x59ae73['gid']]&&(this['store'][_0x59ae73['gid']]=new Map()),this['store'][_0x59ae73['gid']][_0x59ae73['key']]=_0x5d9a55;},'append'(_0x5dc886,_0x4422a1){!this['get'](_0x5dc886)&&this['put'](_0x5dc886,[]),!Array['isArray'](this['get'](_0x5dc886))&&this['put'](_0x5dc886,[this['get'](_0x5dc886)]),Array['isArray'](_0x4422a1)?this['put'](_0x5dc886,this['get'](_0x5dc886)['concat'](_0x4422a1)):this['store'][_0x5dc886['gid']][_0x5dc886['key']]['push'](_0x4422a1);},'del'(_0x13da85){if(!this['store'][_0x13da85['gid']])return undefined;const _0x51f639=this['store'][_0x13da85['gid']][_0x13da85['key']];return delete this['store'][_0x13da85['gid']][_0x13da85['key']],_0x51f639;},'toString'(){let _0x1f8be8='';for(const _0x2534c2 in this['store']){_0x1f8be8+=_0x2534c2+':\x20'+JSON['stringify'](this['store'][_0x2534c2]);}return _0x1f8be8;}};function normalize(_0x2222f1){const _0x2a5b0f={};_0x2222f1===null&&(_0x2222f1={});if(typeof _0x2222f1==='string')_0x2a5b0f['key']=_0x2222f1,_0x2a5b0f['gid']='local',_0x2a5b0f['action']='put';else typeof _0x2222f1==='object'&&(_0x2a5b0f['key']=_0x2222f1['key'],_0x2a5b0f['gid']=_0x2222f1['gid'],_0x2a5b0f['action']=_0x2222f1['action']);return _0x2a5b0f;};function put(_0x4e0269,_0x3a80ee,_0x56fee1){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x3a80ee)+'state:\x20'+JSON['stringify'](_0x4e0269)+'\x20store:\x20'+kvStore['toString']()),_0x56fee1=_0x56fee1||function(){},_0x3a80ee=normalize(_0x3a80ee),_0x3a80ee['key']=_0x3a80ee['key']||id['getID'](_0x4e0269),_0x3a80ee['gid']=_0x3a80ee['gid']||'local',_0x3a80ee['action']=_0x3a80ee['action']||'put',kvStore[_0x3a80ee['action']](_0x3a80ee,_0x4e0269),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x56fee1&&_0x56fee1(null,_0x4e0269);};function get(_0x2361d3,_0x384536){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x2361d3)+'\x20store:\x20'+kvStore['toString']()),_0x384536=_0x384536||function(){},_0x2361d3=normalize(_0x2361d3),_0x2361d3['gid']=_0x2361d3['gid']||'local';if(!_0x2361d3['key']){let _0x504bbb=kvStore['store'][_0x2361d3['gid']]||{};_0x504bbb=Object['keys'](_0x504bbb),_0x384536(null,_0x504bbb);return;}const _0x563be5=kvStore['get'](_0x2361d3);_0x563be5?_0x384536(null,_0x563be5):_0x384536(new Error('Memory\x20key'+'\x20\x22'+_0x2361d3['key']+('\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20not\x20found'+'\x20for\x20')+_0x2361d3['gid']+'\x27s\x20store'));}function del(_0x5afc0d,_0x187da8){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x5afc0d)+'\x20store:\x20'+kvStore['toString']()),_0x187da8=_0x187da8||function(){},_0x5afc0d=normalize(_0x5afc0d);const _0x5cb5b9=kvStore['del'](_0x5afc0d);log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x5cb5b9?_0x187da8(null,_0x5cb5b9):_0x187da8(new Error('Memory\x20key'+'\x20\x22'+_0x5afc0d['key']+('\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'not\x20found\x20'+'for\x20')+_0x5afc0d['gid']+'\x27s\x20store'));};module['exports']={'put':put,'get':get,'del':del};
10
10
  /* eslint-enable */
@@ -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 log=require('../util/lo'+'g'),routesStore=new Map();function get(_0x448589,_0x55d83f=()=>{}){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+_0x448589);if(!_0x55d83f)return;if(_0x448589 in routesStore){log('[routes.ge'+'t]\x20Found\x20s'+'ervice:\x20'+_0x448589);const _0x58bd39=routesStore[_0x448589];_0x55d83f(null,_0x58bd39);}else{const _0x5bd949=global['toLocal']['get'](_0x448589);_0x5bd949?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x448589),_0x55d83f(null,{'call':_0x5bd949})):_0x55d83f(new Error('Service\x20'+_0x448589+('\x20not\x20found'+'\x20in\x20routes')));}}function put(_0x23ea1a,_0xf5250a,_0x2d552a){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0xf5250a),routesStore[_0xf5250a]=_0x23ea1a;_0x2d552a&&_0x2d552a(null,_0xf5250a);;}function rem(_0xef4a40,_0x255f1e){const _0x2fad33=routesStore[_0xef4a40];delete routesStore[_0xef4a40],_0x255f1e(null,_0x2fad33);};module['exports']={'get':get,'put':put,'rem':rem};
9
+ const log=require('../util/lo'+'g'),routesStore=new Map();function get(_0x3d8a2d,_0x4a4280){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+_0x3d8a2d);if(!_0x4a4280)return;if(_0x3d8a2d in routesStore){log('[routes.ge'+'t]\x20Found\x20s'+'ervice:\x20'+_0x3d8a2d);const _0x3fa0a2=routesStore[_0x3d8a2d];_0x4a4280(null,_0x3fa0a2);}else{const _0x342a96=global['toLocal']['get'](_0x3d8a2d);_0x342a96?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x3d8a2d),_0x4a4280(null,{'call':_0x342a96})):_0x4a4280(new Error('Service\x20'+_0x3d8a2d+('\x20not\x20found'+'\x20in\x20routes')));}}function put(_0x1bb5be,_0x1c620e,_0x1d5665){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x1c620e),routesStore[_0x1c620e]=_0x1bb5be;_0x1d5665&&_0x1d5665(null,_0x1c620e);;}function rem(_0x566886,_0x4e261a){const _0x1495ec=routesStore[_0x566886];delete routesStore[_0x566886],_0x4e261a(null,_0x1495ec);};module['exports']={'get':get,'put':put,'rem':rem};
10
10
  /* eslint-enable */
@@ -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 fs=require('fs'),path=require('path'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);!fs['existsSync'](baseFolder+'/s-'+global['moreStatus']['sid'])&&fs['mkdirSync'](baseFolder+'/s-'+global['moreStatus']['sid']);function normalize(_0x1f94dc){const _0x3396c5={};_0x1f94dc===null&&(_0x1f94dc={});if(typeof _0x1f94dc==='string')_0x3396c5['key']=_0x1f94dc,_0x3396c5['gid']='local';else typeof _0x1f94dc==='object'&&(_0x3396c5['key']=_0x1f94dc['key'],_0x3396c5['gid']=_0x1f94dc['gid']);return _0x3396c5;};const store={};store['put']=function(_0x4f646b,_0x54d89e,_0x524be1){_0x524be1=_0x524be1||function(){},_0x54d89e=normalize(_0x54d89e),_0x54d89e['key']=_0x54d89e['key']||id['getID'](_0x4f646b),_0x54d89e['gid']=_0x54d89e['gid']||'local';const _0x407be8=serialization['serialize'](_0x4f646b);let _0x3ef366=Buffer['from'](_0x54d89e['key'])['toString']('base64');_0x3ef366=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x54d89e['gid']+'-'+_0x3ef366,log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x54d89e)+'\x20state:\x20'+JSON['stringify'](_0x4f646b)+('\x20filename:'+'\x20')+_0x3ef366),fs['writeFile'](_0x3ef366,_0x407be8,_0x13ae0f=>{_0x13ae0f?_0x524be1(_0x13ae0f):_0x524be1(null,_0x4f646b);});},store['get']=function(_0x21d91d,_0x2bdd75){_0x2bdd75=_0x2bdd75||function(){},_0x21d91d=normalize(_0x21d91d),_0x21d91d['gid']=_0x21d91d['gid']||'local';if(!_0x21d91d['key']){fs['readdir'](baseFolder+'/s-'+global['moreStatus']['sid'],(_0x29ed68,_0x592fb8)=>{if(_0x29ed68)_0x2bdd75(_0x29ed68);else{const _0x4adb67=[];for(let _0x4f6470=0xa*0x328+-0x297+0x1*-0x1cf9;_0x4f6470<_0x592fb8['length'];_0x4f6470++){let _0x46eded=_0x592fb8[_0x4f6470]['split']('-');const _0x375e89=_0x46eded[-0x1463*-0x1+-0x25c0+0x115d];if(_0x375e89!==_0x21d91d['gid'])continue;_0x46eded=_0x46eded[_0x46eded['length']-(-0x29*-0x4f+-0x1c78+-0x87*-0x1e)],_0x4adb67['push'](Buffer['from'](_0x46eded,'base64')['toString']());}_0x2bdd75(null,_0x4adb67);}});return;}let _0x230235=Buffer['from'](_0x21d91d['key'])['toString']('base64');_0x230235=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x21d91d['gid']+'-'+_0x230235,log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x21d91d)+('\x20filename:'+'\x20')+_0x230235),fs['exists'](_0x230235,_0x313c0e=>{if(!_0x313c0e){_0x2bdd75(new Error('File\x20'+_0x230235+('\x20(from\x20key'+'\x20\x27')+_0x21d91d['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x21d91d['gid']));return;}fs['readFile'](_0x230235,(_0x316b42,_0x20ee72)=>{if(!_0x2bdd75)return;_0x316b42?_0x2bdd75(_0x316b42):(_0x20ee72=_0x20ee72['toString'](),_0x2bdd75(null,serialization['deserializ'+'e'](_0x20ee72)));});});},store['del']=function(_0x48cfd8,_0x24de2c){_0x24de2c=_0x24de2c||function(){},_0x48cfd8=normalize(_0x48cfd8);let _0x1a2fe7=Buffer['from'](_0x48cfd8['key'])['toString']('base64');_0x1a2fe7=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x48cfd8['gid']+'-'+_0x1a2fe7,fs['exists'](_0x1a2fe7,_0x2daa44=>{if(!_0x2daa44){_0x24de2c(new Error('File\x20'+_0x1a2fe7+('\x20not\x20found'+'\x20for\x20group'+'\x0a')+_0x48cfd8['gid']));return;}store['get'](_0x48cfd8,(_0x3b25d0,_0x5d58a9)=>{fs['rm'](_0x1a2fe7,function(_0x370b9b){_0x370b9b?_0x24de2c(_0x370b9b):_0x24de2c(null,_0x5d58a9);});});});},module['exports']=store;
9
+ const fs=require('fs'),path=require('path'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);!fs['existsSync'](baseFolder+'/s-'+global['moreStatus']['sid'])&&fs['mkdirSync'](baseFolder+'/s-'+global['moreStatus']['sid']);function normalize(_0x173044){const _0x15fbb0={};_0x173044===null&&(_0x173044={});if(typeof _0x173044==='string')_0x15fbb0['key']=_0x173044,_0x15fbb0['gid']='local';else typeof _0x173044==='object'&&(_0x15fbb0['key']=_0x173044['key'],_0x15fbb0['gid']=_0x173044['gid']);return _0x15fbb0;};function put(_0x274319,_0x2c12e7,_0x5a4856){_0x5a4856=_0x5a4856||function(){},_0x2c12e7=normalize(_0x2c12e7),_0x2c12e7['key']=_0x2c12e7['key']||id['getID'](_0x274319),_0x2c12e7['gid']=_0x2c12e7['gid']||'local';const _0x4641e9=serialization['serialize'](_0x274319);let _0x1c0053=Buffer['from'](_0x2c12e7['key'])['toString']('base64');_0x1c0053=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x2c12e7['gid']+'-'+_0x1c0053,log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x2c12e7)+'\x20state:\x20'+JSON['stringify'](_0x274319)+('\x20filename:'+'\x20')+_0x1c0053),fs['writeFile'](_0x1c0053,_0x4641e9,_0x337244=>{_0x337244?_0x5a4856(_0x337244):_0x5a4856(null,_0x274319);});}function get(_0x284c92,_0x44f6ed){_0x44f6ed=_0x44f6ed||function(){},_0x284c92=normalize(_0x284c92),_0x284c92['gid']=_0x284c92['gid']||'local';if(!_0x284c92['key']){fs['readdir'](baseFolder+'/s-'+global['moreStatus']['sid'],(_0xeaf544,_0x334b07)=>{if(_0xeaf544)_0x44f6ed(_0xeaf544);else{const _0x35ae85=[];for(let _0x185297=0x4f6*0x1+-0x10c3+0xbcd;_0x185297<_0x334b07['length'];_0x185297++){let _0x3258b6=_0x334b07[_0x185297]['split']('-');const _0x9b8808=_0x3258b6[-0xa5e+-0xda3*-0x1+0x3*-0x117];if(_0x9b8808!==_0x284c92['gid'])continue;_0x3258b6=_0x3258b6[_0x3258b6['length']-(0x1b1a+-0x317*0xb+-0x31*-0x24)],_0x35ae85['push'](Buffer['from'](_0x3258b6,'base64')['toString']());}_0x44f6ed(null,_0x35ae85);}});return;}let _0x3bb2cc=Buffer['from'](_0x284c92['key'])['toString']('base64');_0x3bb2cc=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x284c92['gid']+'-'+_0x3bb2cc,log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x284c92)+('\x20filename:'+'\x20')+_0x3bb2cc),fs['readFile'](_0x3bb2cc,(_0xe074bf,_0x5c350e)=>{_0xe074bf?_0xe074bf['code']==='ENOENT'?_0x44f6ed(new Error('File\x20'+_0x3bb2cc+('\x20(from\x20key'+'\x20\x27')+_0x284c92['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x284c92['gid'])):_0x44f6ed(_0xe074bf):_0x44f6ed(null,serialization['deserializ'+'e'](_0x5c350e['toString']()));});}function del(_0x2379d0,_0x32aaef){_0x32aaef=_0x32aaef||function(){},_0x2379d0=normalize(_0x2379d0);let _0x494c23=Buffer['from'](_0x2379d0['key'])['toString']('base64');_0x494c23=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x2379d0['gid']+'-'+_0x494c23,get(_0x2379d0,(_0x43cbcc,_0x5920ba)=>{if(_0x43cbcc){_0x32aaef(_0x43cbcc);return;}fs['rm'](_0x494c23,_0xdc2e=>{_0xdc2e?_0x32aaef(_0xdc2e):_0x32aaef(null,_0x5920ba);});});}module['exports']={'put':put,'get':get,'del':del};
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,