@brown-ds/distribution 0.0.46 → 0.0.48

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.
@@ -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
- function comm(_0x11980a){const _0x48f93e={};_0x48f93e['gid']=_0x11980a['gid']||'global';function _0x7695ef(_0x5b8d76,_0x17fa63,_0x147278){global['distributi'+'on']['local']['groups']['get'](_0x48f93e['gid'],(_0x5d59f3,_0x5c857c)=>{const _0x1c4e25=Object['keys'](_0x5c857c)['length'];if(_0x1c4e25===-0x392*0x9+0x2537+0x1*-0x515){_0x147278(new Error('No\x20nodes\x20f'+'ound'));return;}let _0x7fb3b2=0xe41*-0x1+0x13d*0x1+0xd04;const _0x547f91={},_0x576c2b={};for(const _0x2ff7b2 of Object['keys'](_0x5c857c)){const _0x7e519d=_0x5c857c[_0x2ff7b2],_0x4b7cc4={'node':{'ip':_0x7e519d['ip'],'port':_0x7e519d['port']},'service':_0x17fa63['service'],'method':_0x17fa63['method']};global['distributi'+'on']['local']['comm']['send'](_0x5b8d76,_0x4b7cc4,(_0x164c85,_0x38a301)=>{_0x164c85?_0x576c2b[_0x2ff7b2]=_0x164c85:_0x547f91[_0x2ff7b2]=_0x38a301,_0x7fb3b2+=0xb6c+0x14ea+-0x2055,_0x7fb3b2===_0x1c4e25&&_0x147278(_0x576c2b,_0x547f91);});}});}return{'send':_0x7695ef};};module['exports']=comm;
9
+ function comm(_0x3ff307){const _0x27d376={};_0x27d376['gid']=_0x3ff307['gid']||'global';function _0x3a6af3(_0x2830e3,_0x55cfbd,_0xeaadfb){global['distributi'+'on']['local']['groups']['get'](_0x27d376['gid'],(_0x1ac991,_0x38d838)=>{const _0x372909=Object['keys'](_0x38d838)['length'];if(_0x372909===0x8f5*-0x2+0x1d5f+-0xb75){_0xeaadfb(new Error('No\x20nodes\x20f'+'ound'));return;}let _0xdc7351=0x29c*-0x7+-0x1082+0x22c6;const _0x1b694e={},_0x57635d={};for(const _0x395b8c of Object['keys'](_0x38d838)){const _0x931efa=_0x38d838[_0x395b8c],_0x1502ce={'node':{'ip':_0x931efa['ip'],'port':_0x931efa['port']},'service':_0x55cfbd['service'],'method':_0x55cfbd['method'],'gid':_0x55cfbd['gid']||'local'};global['distributi'+'on']['local']['comm']['send'](_0x2830e3,_0x1502ce,(_0x5e82ce,_0x24e7c4)=>{_0x5e82ce?_0x57635d[_0x395b8c]=_0x5e82ce:_0x1b694e[_0x395b8c]=_0x24e7c4,_0xdc7351+=0x1*-0xf63+0x61*-0x19+-0x43*-0x5f,_0xdc7351===_0x372909&&_0xeaadfb(_0x57635d,_0x1b694e);});}});}return{'send':_0x3a6af3};};module['exports']=comm;
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=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;
9
+ const distribution=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0x3ba64f,_0x2c9ee5,_0x30b3a1){typeof _0x2c9ee5==='object'&&(_0x2c9ee5=_0x2c9ee5['key']),distribution[_0x3ba64f['gid']]['status']['get']('nid',(_0x1e2529,_0x33b0f8)=>{const _0x4cf427=Object['values'](_0x33b0f8),_0x10c42a=util['id']['getID'](_0x2c9ee5),_0x2075a7=_0x3ba64f['hash'](_0x10c42a,_0x4cf427),_0x224ecf=_0x2075a7['substring'](-0x2b*-0xe6+-0x2f*0xbb+-0x44d,0x26b5+-0x1*-0xf1+-0x27a1);distribution['local']['groups']['get'](_0x3ba64f['gid'],(_0x4313d3,_0x361168)=>{const _0x4de3ae=_0x361168[_0x224ecf];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x2c9ee5)+'group:\x20'+JSON['stringify'](_0x361168)+'\x20node:\x20'+JSON['stringify'](_0x4de3ae)+'nid:\x20'+JSON['stringify'](_0x2075a7)+'\x20sid:\x20'+JSON['stringify'](_0x224ecf)),_0x30b3a1(_0x4de3ae);});});}function normalize(_0x204615,_0x39f633){const _0x3580d0={};_0x204615===null&&(_0x204615={});if(typeof _0x204615==='string')_0x3580d0['key']=_0x204615,_0x3580d0['gid']=_0x39f633,_0x3580d0['action']='put';else typeof _0x204615==='object'&&(_0x3580d0['key']=_0x204615['key'],_0x3580d0['gid']=_0x204615['gid']||_0x39f633,_0x3580d0['action']=_0x204615['action']||'put');return _0x3580d0;};function mem(_0x4da3ff){const _0x42ed82={};return _0x42ed82['gid']=_0x4da3ff['gid']||'all',_0x42ed82['hash']=_0x4da3ff['hash']||util['id']['naiveHash'],{'get':(_0x256b00,_0x32d4f9)=>{if(!_0x256b00){const _0x1f6564=[{'key':null,'gid':_0x42ed82['gid']}];distribution[_0x42ed82['gid']]['comm']['send'](_0x1f6564,{'service':'mem','method':'get'},(_0x3e5078,_0x1eb776)=>{const _0x159334=Object['values'](_0x1eb776)['reduce']((_0x33062f,_0x2b3920)=>_0x33062f['concat'](_0x2b3920),[]);_0x32d4f9(_0x3e5078,_0x159334);});return;}_0x256b00=normalize(_0x256b00,_0x42ed82['gid']),getNode(_0x42ed82,_0x256b00,_0x237fa2=>{const _0x57f5f7=[_0x256b00],_0x1c44f6={'service':'mem','method':'get','node':_0x237fa2};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x256b00)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x237fa2)),distribution['local']['comm']['send'](_0x57f5f7,_0x1c44f6,_0x32d4f9);});},'put':(_0x113743,_0x328c86,_0x4b7004)=>{_0x328c86=_0x328c86||util['id']['getID'](_0x113743),_0x328c86=normalize(_0x328c86,_0x42ed82['gid']),getNode(_0x42ed82,_0x328c86,_0x4d9acd=>{const _0x18817a=[_0x113743,_0x328c86],_0x57ae35={'service':'mem','method':'put','node':_0x4d9acd};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x113743)+('configurat'+'ion:\x20')+JSON['stringify'](_0x328c86)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x4d9acd)),distribution['local']['comm']['send'](_0x18817a,_0x57ae35,_0x4b7004);});},'del':(_0xa12052,_0x2a7439)=>{getNode(_0x42ed82,_0xa12052,_0x22b652=>{const _0x327271=[{'key':_0xa12052,'gid':_0x42ed82['gid']}],_0x4838d8={'service':'mem','method':'del','node':_0x22b652};distribution['local']['comm']['send'](_0x327271,_0x4838d8,_0x2a7439);});},'reconf':(_0x25fd4d,_0x12bb17)=>{distribution[_0x42ed82['gid']]['mem']['get'](null,(_0xa873d3,_0x651583)=>{distribution[_0x42ed82['gid']]['status']['get']('nid',(_0x48643a,_0x8bd506)=>{const _0x3dc7fe=Object['values'](_0x8bd506),_0x163a21=Object['values'](_0x25fd4d)['map'](_0x5ea3e6=>util['id']['getNID'](_0x5ea3e6));log('[mem.recon'+'f\x20received'+'\x20'+_0x651583['length']+('\x20keys\x20from'+'\x20')+_0x8bd506['length']+'\x20nodes');let _0x4456b6=0x18d+-0x504+0x377;const _0x8db5eb=()=>{_0x4456b6===_0x651583['length']&&_0x12bb17();};if(_0x651583['length']===-0x2040+0x8b2+0x178e){_0x12bb17();return;}for(const _0x47fffc of _0x651583){const _0x17bfa9=util['id']['getID'](_0x47fffc),_0x101786=_0x42ed82['hash'](_0x17bfa9,_0x163a21),_0x3bc0bf=_0x42ed82['hash'](_0x17bfa9,_0x3dc7fe);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x101786+'\x20new\x20nid:\x20'+_0x3bc0bf);if(_0x101786===_0x3bc0bf){_0x4456b6++,_0x8db5eb();continue;}const _0x44c3f4=_0x25fd4d[_0x101786['substring'](-0xac1+-0x7e9+0x12aa,0xee8*-0x1+0x14ee+-0x601)],_0x1b69f5=[{'key':_0x47fffc,'gid':_0x42ed82['gid']}],_0xc01f25={'service':'mem','method':'del','node':_0x44c3f4};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x47fffc+'\x20from\x20'+JSON['stringify'](_0xc01f25)),distribution['local']['comm']['send'](_0x1b69f5,_0xc01f25,(_0x2d47fd,_0x5af87d)=>{distribution[_0x42ed82['gid']]['mem']['put'](_0x5af87d,_0x47fffc,(_0x1e9731,_0xba6e06)=>{_0x4456b6++,_0x8db5eb();});});}});});}};};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(_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;
9
+ const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0x245017){const _0x4221e2={'gid':_0x245017['gid']||'global'};function _0x3b541e(_0x278b20,_0x16df72){const _0x5aece6=id['getSID'](_0x278b20),_0xca6e4f={'mapper':_0x278b20['map'],'reducer':_0x278b20['reduce'],'map':function(_0x4d9914,_0x157672,_0x2a0cf2,_0x42c0f2){if(_0x4d9914['length']==-0x9*0x20d+0x1be5+-0x970*0x1)_0x42c0f2(null,{});else{const _0x5f084c=[];let _0x373feb=-0x1cb5+0x51c*0x2+0x1*0x127d;_0x4d9914['forEach'](_0x2d0951=>{distribution[_0x157672]['store']['get'](_0x2d0951,(_0x4a1db7,_0x4efd72)=>{_0x373feb++;const _0x37c698=this['mapper'](_0x2d0951,_0x4efd72);Array['isArray'](_0x37c698)?_0x5f084c['push'](..._0x37c698):_0x5f084c['push'](_0x37c698),_0x373feb==_0x4d9914['length']&&distribution['local']['store']['put'](_0x5f084c,_0x2a0cf2+'_map',(_0x2aff0e,_0x618408)=>{_0x42c0f2(_0x2aff0e,_0x5f084c);});});});}},'shuffle':function(_0x5cf805,_0x23c4b8,_0x356977){distribution['local']['store']['get'](_0x23c4b8+'_map',(_0x12610b,_0x1cd31f)=>{if(!_0x12610b){let _0x5dbb74=-0x78a+0x13da+-0xc50;_0x1cd31f['forEach'](_0x4339de=>{const [_0x276299]=Object['keys'](_0x4339de);distribution[_0x5cf805]['mem']['put'](_0x4339de[_0x276299],{'key':_0x276299,'action':'append'},(_0x4b06b9,_0x502649)=>{_0x5dbb74++,_0x5dbb74==_0x1cd31f['length']&&_0x356977(null,_0x1cd31f);});});}else _0x356977(_0x12610b,{});});},'reduce':function(_0x4389bd,_0x3a0726,_0x105978){distribution['local']['mem']['get']({'key':null,'gid':_0x4389bd},(_0x18a902,_0x2721c8)=>{let _0x266ba4=[],_0xefbd34=0xd3d*0x1+-0x14d+-0xbf0;_0x2721c8['length']==-0xcde+0x182d*0x1+-0xb4f&&_0x105978(null,null),_0x2721c8['forEach'](_0x582bcd=>distribution['local']['mem']['get']({'key':_0x582bcd,'gid':_0x4389bd},(_0x1c1dc3,_0x53c232)=>{const _0x3956b4=this['reducer'](_0x582bcd,_0x53c232);_0x266ba4=_0x266ba4['concat'](_0x3956b4),_0xefbd34++,_0xefbd34==_0x2721c8['length']&&_0x105978(null,_0x266ba4);}));});}},_0x20af29=function(_0x5636e8,_0x44af7c){const _0x2b624a={};return Object['keys'](_0x44af7c)['forEach'](_0x4aba1d=>{_0x2b624a[_0x4aba1d]=[];}),_0x5636e8['forEach'](_0x331451=>{const _0x48021b=id['getID'](_0x331451),_0x28c562=id['naiveHash'](_0x48021b,Object['keys'](_0x44af7c));_0x2b624a[_0x28c562]['push'](_0x331451);}),_0x2b624a;};distribution[_0x4221e2['gid']]['routes']['put'](_0xca6e4f,'mr-'+_0x5aece6,(_0x2556fa,_0x21e5fb)=>{distribution['local']['groups']['get'](_0x4221e2['gid'],(_0x46da67,_0x1c3649)=>{const _0x2160d4=_0x20af29(_0x278b20['keys'],_0x1c3649);let _0x59ad89=0x1*-0x4a7+-0x2130+0xc9d*0x3;const _0x4c34f3=Object['keys'](_0x1c3649)['length'],_0x1f72c4={'service':'mr-'+_0x5aece6,'method':'map'};for(const _0x54d376 in _0x1c3649){_0x1f72c4['node']=_0x1c3649[_0x54d376];const _0x465ec9=[_0x2160d4[_0x54d376],_0x4221e2['gid'],_0x5aece6];distribution['local']['comm']['send'](_0x465ec9,_0x1f72c4,(_0x27f5f2,_0x427568)=>{++_0x59ad89;if(_0x59ad89==_0x4c34f3){const _0x58cdd5={'service':'mr-'+_0x5aece6,'method':'shuffle'};distribution[_0x4221e2['gid']]['comm']['send']([_0x4221e2['gid'],_0x5aece6],_0x58cdd5,(_0x797bb2,_0x28587c)=>{const _0x304270={'service':'mr-'+_0x5aece6,'method':'reduce'};distribution[_0x4221e2['gid']]['comm']['send']([_0x4221e2['gid'],_0x5aece6],_0x304270,(_0x5a9688,_0x12861c)=>{let _0x4420a0=[];for(const _0x390fe8 of Object['values'](_0x12861c)){_0x390fe8!==null&&(_0x4420a0=_0x4420a0['concat'](_0x390fe8));}_0x16df72(null,_0x4420a0);return;distribution[_0x4221e2['gid']]['routes']['rem']('mr-'+_0x5aece6,(_0x14297a,_0xc71d57)=>{});});});}});}});});}return{'exec':_0x3b541e};};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(_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};
9
+ const http=require('http'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g');function send(_0x300bcb,_0x3023ca,_0x34e3b3){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x300bcb)+'to\x20'+_0x3023ca['service']+':'+_0x3023ca['method']+'\x20on\x20'+_0x3023ca['node']['ip']+':'+_0x3023ca['node']['port']);if(!_0x300bcb instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');const _0x35595c=_0x3023ca['node'],_0x184741=_0x3023ca['service'],_0x4a4e97=_0x3023ca['method'],_0x4e0578=_0x3023ca['gid']||'local',_0x5cfefb=serialization['serialize'](_0x300bcb),_0x20ba86={'hostname':_0x35595c['ip'],'port':_0x35595c['port'],'path':'/'+_0x4e0578+'/'+_0x184741+'/'+_0x4a4e97,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x5cfefb)}},_0x4aedd9=http['request'](_0x20ba86,_0x42eaf5=>{let _0x367027='';_0x42eaf5['on']('data',function(_0x5ca18f){_0x367027+=_0x5ca18f;}),_0x42eaf5['on']('end',function(){_0x34e3b3&&_0x34e3b3(...serialization['deserializ'+'e'](_0x367027));}),_0x42eaf5['on']('error',function(_0x190227){_0x34e3b3&&_0x34e3b3(new Error('Error\x20on\x20r'+'esponse'));});});_0x4aedd9['on']('error',function(_0x33f3a1){_0x34e3b3&&_0x34e3b3(new Error(_0x33f3a1));}),_0x4aedd9['write'](_0x5cfefb),_0x4aedd9['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'(_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};
9
+ const id=require('../util/id'),log=require('../util/lo'+'g'),kvStore={'store':new Map(),'get'(_0x26585a){if(!this['store'][_0x26585a['gid']])return undefined;return this['store'][_0x26585a['gid']][_0x26585a['key']];},'put'(_0xe29537,_0x43c1f7){!this['store'][_0xe29537['gid']]&&(this['store'][_0xe29537['gid']]=new Map()),this['store'][_0xe29537['gid']][_0xe29537['key']]=_0x43c1f7;},'append'(_0x16d74a,_0x18f333){!this['get'](_0x16d74a)&&this['put'](_0x16d74a,[]),!Array['isArray'](this['get'](_0x16d74a))&&this['put'](_0x16d74a,[this['get'](_0x16d74a)]),Array['isArray'](_0x18f333)?this['put'](_0x16d74a,this['get'](_0x16d74a)['concat'](_0x18f333)):this['store'][_0x16d74a['gid']][_0x16d74a['key']]['push'](_0x18f333);},'del'(_0x588206){if(!this['store'][_0x588206['gid']])return undefined;const _0x1c68b0=this['store'][_0x588206['gid']][_0x588206['key']];return delete this['store'][_0x588206['gid']][_0x588206['key']],_0x1c68b0;},'toString'(){let _0x5b2567='';for(const _0x2347a3 in this['store']){_0x5b2567+=_0x2347a3+':\x20'+JSON['stringify'](this['store'][_0x2347a3]);}return _0x5b2567;}};function normalize(_0x60e5f6){const _0x1ac61a={};_0x60e5f6===null&&(_0x60e5f6={});if(typeof _0x60e5f6==='string')_0x1ac61a['key']=_0x60e5f6,_0x1ac61a['gid']='local',_0x1ac61a['action']='put';else typeof _0x60e5f6==='object'&&(_0x1ac61a['key']=_0x60e5f6['key'],_0x1ac61a['gid']=_0x60e5f6['gid'],_0x1ac61a['action']=_0x60e5f6['action']);return _0x1ac61a;};function put(_0x40b1c3,_0x400283,_0x3d8828){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x400283)+'state:\x20'+JSON['stringify'](_0x40b1c3)+'\x20store:\x20'+kvStore['toString']()),_0x3d8828=_0x3d8828||function(){},_0x400283=normalize(_0x400283),_0x400283['key']=_0x400283['key']||id['getID'](_0x40b1c3),_0x400283['gid']=_0x400283['gid']||'local',_0x400283['action']=_0x400283['action']||'put',kvStore[_0x400283['action']](_0x400283,_0x40b1c3),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x3d8828&&_0x3d8828(null,_0x40b1c3);};function get(_0x10d1ff,_0x201974){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x10d1ff)+'\x20store:\x20'+kvStore['toString']()),_0x201974=_0x201974||function(){},_0x10d1ff=normalize(_0x10d1ff),_0x10d1ff['gid']=_0x10d1ff['gid']||'local';if(!_0x10d1ff['key']){let _0x4e192e=kvStore['store'][_0x10d1ff['gid']]||{};_0x4e192e=Object['keys'](_0x4e192e),_0x201974(null,_0x4e192e);return;}const _0x360c2e=kvStore['get'](_0x10d1ff);_0x360c2e?_0x201974(null,_0x360c2e):_0x201974(new Error('Memory\x20key'+'\x20\x22'+_0x10d1ff['key']+('\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20not\x20found'+'\x20for\x20')+_0x10d1ff['gid']+'\x27s\x20store'));}function del(_0x53b5c6,_0x214f32){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x53b5c6)+'\x20store:\x20'+kvStore['toString']()),_0x214f32=_0x214f32||function(){},_0x53b5c6=normalize(_0x53b5c6);const _0x27a824=kvStore['del'](_0x53b5c6);log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x27a824?_0x214f32(null,_0x27a824):_0x214f32(new Error('Memory\x20key'+'\x20\x22'+_0x53b5c6['key']+('\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'not\x20found\x20'+'for\x20')+_0x53b5c6['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 http=require('http'),url=require('url'),log=require('../util/lo'+'g'),serialization=require('../util/se'+'rializatio'+'n');function isValidBody(_0x41792c){if(_0x41792c['length']===0x1b3+-0xbf8*-0x2+-0x19a3)return new Error('No\x20body');try{_0x41792c=JSON['parse'](_0x41792c);}catch(_0x3e40db){return _0x3e40db;}return undefined;}function endRequest(_0x25f287,_0x5027a3){_0x25f287['end'](serialization['serialize']([_0x5027a3]));}const start=function(_0x4c056c){const _0x5bcb25=http['createServ'+'er']((_0x159f99,_0x329caf)=>{if(_0x159f99['method']!=='PUT'){_0x329caf['end'](serialization['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const _0x47ba5d=url['parse'](_0x159f99['url'])['pathname'],[,_0x20aef1,_0x45c8ac]=_0x47ba5d['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x20aef1+':'+_0x45c8ac+'\x20from\x20'+_0x159f99['connection']['remoteAddr'+'ess']);let _0xdbb187=[];_0x159f99['on']('data',_0x51179f=>{_0xdbb187['push'](_0x51179f);}),_0x159f99['on']('end',()=>{_0xdbb187=Buffer['concat'](_0xdbb187)['toString']();let _0x3c1562;if(_0x3c1562=isValidBody(_0xdbb187)){endRequest(_0x329caf,_0x3c1562);return;}_0xdbb187=JSON['parse'](_0xdbb187),_0xdbb187=serialization['deserializ'+'e'](_0xdbb187);const _0x2c8ef0=_0xdbb187;!Array['isArray'](_0x2c8ef0)&&endRequest(_0x329caf,new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x2c8ef0));const _0x130beb=_0x20aef1;global['distributi'+'on']['local']['routes']['get'](_0x130beb,(_0x52b93a,_0x4b0d62)=>{const _0x2e769a=(_0x1e4755,_0x2e6e36)=>{_0x329caf['end'](serialization['serialize']([_0x1e4755,_0x2e6e36]));};if(_0x52b93a){_0x2e769a(_0x52b93a);return;}if(!_0x4b0d62[_0x45c8ac]){_0x2e769a(new Error('Method\x20'+_0x45c8ac+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x130beb));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x130beb+':'+_0x45c8ac+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x2c8ef0));_0x2c8ef0['length']===0x8fe+0xc73*0x2+-0x6c7*0x5&&_0x4b0d62[_0x45c8ac]['length']===0x1f42+-0x21*0x44+-0x167b&&_0x2c8ef0['push'](undefined);try{_0x4b0d62[_0x45c8ac](..._0x2c8ef0,_0x2e769a);}catch(_0x305022){_0x2e769a(_0x305022);}});});});_0x5bcb25['listen'](global['nodeConfig']['port'],global['nodeConfig']['ip'],()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+global['nodeConfig']['ip']+':'+global['nodeConfig']['port']+'/'),global['distributi'+'on']['node']['server']=_0x5bcb25,_0x4c056c(_0x5bcb25);}),_0x5bcb25['on']('error',_0x13ff4b=>{log('Server\x20err'+'or:\x20'+_0x13ff4b);throw _0x13ff4b;});};module['exports']={'start':start};
9
+ const http=require('http'),url=require('url'),log=require('../util/lo'+'g'),serialization=require('../util/se'+'rializatio'+'n');function isValidBody(_0x377981){if(_0x377981['length']===-0x1814+-0x1cf9*0x1+0x350d)return new Error('No\x20body');try{_0x377981=JSON['parse'](_0x377981);}catch(_0x185f27){return _0x185f27;}return undefined;}function endRequest(_0x540e16,_0x3d1ccb){_0x540e16['end'](serialization['serialize']([_0x3d1ccb]));}const start=function(_0x966886){const _0x3a6518=http['createServ'+'er']((_0x81d7f9,_0x24b09d)=>{if(_0x81d7f9['method']!=='PUT'){_0x24b09d['end'](serialization['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const _0x25b575=url['parse'](_0x81d7f9['url'])['pathname'],[,_0x10d46f,_0x549703,_0x7b93c4]=_0x25b575['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x10d46f+'\x20'+_0x549703+':'+_0x7b93c4+'\x20from\x20'+_0x81d7f9['connection']['remoteAddr'+'ess']);let _0x5b05d9=[];_0x81d7f9['on']('data',_0x259bfc=>{_0x5b05d9['push'](_0x259bfc);}),_0x81d7f9['on']('end',()=>{_0x5b05d9=Buffer['concat'](_0x5b05d9)['toString']();let _0x3c4071;if(_0x3c4071=isValidBody(_0x5b05d9)){endRequest(_0x24b09d,_0x3c4071);return;}_0x5b05d9=JSON['parse'](_0x5b05d9),_0x5b05d9=serialization['deserializ'+'e'](_0x5b05d9);const _0xeab15c=_0x5b05d9;!Array['isArray'](_0xeab15c)&&endRequest(_0x24b09d,new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0xeab15c));const _0x336473=_0x549703;global['distributi'+'on']['local']['routes']['get']({'service':_0x549703,'gid':_0x10d46f},(_0x53dc03,_0x1c3871)=>{const _0x9e7383=(_0x365a8e,_0x1d3e09)=>{_0x24b09d['end'](serialization['serialize']([_0x365a8e,_0x1d3e09]));};if(_0x53dc03){_0x9e7383(_0x53dc03);return;}if(!_0x1c3871[_0x7b93c4]){_0x9e7383(new Error('Method\x20'+_0x7b93c4+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x336473));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x336473+':'+_0x7b93c4+('\x20with\x20args'+':\x20')+JSON['stringify'](_0xeab15c));_0xeab15c['length']===-0x1ecd+-0x33*0x95+0x3c7d&&_0x1c3871[_0x7b93c4]['length']===0x43f*0x1+-0x9*0x24+-0x28*0x13&&_0xeab15c['push'](undefined);try{_0x1c3871[_0x7b93c4](..._0xeab15c,_0x9e7383);}catch(_0xebf001){_0x9e7383(_0xebf001);}});});});_0x3a6518['listen'](global['nodeConfig']['port'],global['nodeConfig']['ip'],()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+global['nodeConfig']['ip']+':'+global['nodeConfig']['port']+'/'),global['distributi'+'on']['node']['server']=_0x3a6518,_0x966886(_0x3a6518);}),_0x3a6518['on']('error',_0x51f1ef=>{log('Server\x20err'+'or:\x20'+_0x51f1ef);throw _0x51f1ef;});};module['exports']={'start':start};
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(_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};
9
+ const log=require('../util/lo'+'g'),routesStore=new Map();function get(_0xd7907f,_0xed0098){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0xd7907f));if(!_0xed0098)return;typeof _0xd7907f==='string'&&(_0xd7907f={'service':_0xd7907f});const _0x3ba868=_0xd7907f['service'],_0x5195df=_0xd7907f['gid'];if(_0x5195df&&_0x5195df!=='local')log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x3ba868),_0xed0098(null,global['distributi'+'on'][_0x5195df][_0x3ba868]);else{if(_0x3ba868 in routesStore)log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x3ba868),_0xed0098(null,routesStore[_0x3ba868]);else{const _0x32adc9=global['toLocal']['get'](_0x3ba868);_0x32adc9?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x3ba868),_0xed0098(null,{'call':_0x32adc9})):_0xed0098(new Error('Service\x20'+_0x3ba868+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x1f51cd,_0x4a907d,_0x41a465){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x4a907d+'\x20'+JSON['stringify'](_0x1f51cd)),routesStore[_0x4a907d]=_0x1f51cd;_0x41a465&&_0x41a465(null,_0x4a907d);;}function rem(_0x451b3f,_0x3f58ab){const _0x5b8abb=routesStore[_0x451b3f];delete routesStore[_0x451b3f],_0x3f58ab(null,_0x5b8abb);};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(_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};
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(_0x118f7e){const _0x3fd6db={};_0x118f7e===null&&(_0x118f7e={});if(typeof _0x118f7e==='string')_0x3fd6db['key']=_0x118f7e,_0x3fd6db['gid']='local';else typeof _0x118f7e==='object'&&(_0x3fd6db['key']=_0x118f7e['key'],_0x3fd6db['gid']=_0x118f7e['gid']);return _0x3fd6db;};function put(_0x36bd7c,_0x219bb1,_0x4cfea1){_0x4cfea1=_0x4cfea1||function(){},_0x219bb1=normalize(_0x219bb1),_0x219bb1['key']=_0x219bb1['key']||id['getID'](_0x36bd7c),_0x219bb1['gid']=_0x219bb1['gid']||'local';const _0x40a15f=serialization['serialize'](_0x36bd7c);let _0xb22032=Buffer['from'](_0x219bb1['key'])['toString']('base64');_0xb22032=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x219bb1['gid']+'-'+_0xb22032,log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x219bb1)+'\x20state:\x20'+JSON['stringify'](_0x36bd7c)+('\x20filename:'+'\x20')+_0xb22032),fs['writeFile'](_0xb22032,_0x40a15f,_0x3bcd97=>{_0x3bcd97?_0x4cfea1(_0x3bcd97):_0x4cfea1(null,_0x36bd7c);});}function get(_0x13325a,_0x1dabf5){_0x1dabf5=_0x1dabf5||function(){},_0x13325a=normalize(_0x13325a),_0x13325a['gid']=_0x13325a['gid']||'local';if(!_0x13325a['key']){fs['readdir'](baseFolder+'/s-'+global['moreStatus']['sid'],(_0x25bc24,_0x146254)=>{if(_0x25bc24)_0x1dabf5(_0x25bc24);else{const _0x5bb71e=[];for(let _0x2a63fe=0x351+0x112c+-0x147d;_0x2a63fe<_0x146254['length'];_0x2a63fe++){let _0x4dfc03=_0x146254[_0x2a63fe]['split']('-');const _0x286ecc=_0x4dfc03[0x1*-0x18f4+-0xf55+0x2849];if(_0x286ecc!==_0x13325a['gid'])continue;_0x4dfc03=_0x4dfc03[_0x4dfc03['length']-(0x76b*0x3+-0x8*-0x371+-0x31c8)],_0x5bb71e['push'](Buffer['from'](_0x4dfc03,'base64')['toString']());}_0x1dabf5(null,_0x5bb71e);}});return;}let _0x3fc3f0=Buffer['from'](_0x13325a['key'])['toString']('base64');_0x3fc3f0=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x13325a['gid']+'-'+_0x3fc3f0,log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x13325a)+('\x20filename:'+'\x20')+_0x3fc3f0),fs['readFile'](_0x3fc3f0,(_0xf9236e,_0x53a4f4)=>{_0xf9236e?_0xf9236e['code']==='ENOENT'?_0x1dabf5(new Error('File\x20'+_0x3fc3f0+('\x20(from\x20key'+'\x20\x27')+_0x13325a['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x13325a['gid'])):_0x1dabf5(_0xf9236e):_0x1dabf5(null,serialization['deserializ'+'e'](_0x53a4f4['toString']()));});}function del(_0x337936,_0x19b174){_0x19b174=_0x19b174||function(){},_0x337936=normalize(_0x337936);let _0x8e6929=Buffer['from'](_0x337936['key'])['toString']('base64');_0x8e6929=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x337936['gid']+'-'+_0x8e6929,get(_0x337936,(_0x5986f4,_0x4aa473)=>{if(_0x5986f4){_0x19b174(_0x5986f4);return;}fs['rm'](_0x8e6929,_0x543c5a=>{_0x543c5a?_0x19b174(_0x543c5a):_0x19b174(null,_0x4aa473);});});}module['exports']={'put':put,'get':get,'del':del};
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
- "useLibrary": false,
6
+ "useLibrary": true,
7
7
  "directories": {
8
8
  "test": "test"
9
9
  },