@brown-ds/distribution 0.0.47 → 0.1.0

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(_0x5a736b){const _0x1f8e14={};_0x1f8e14['gid']=_0x5a736b['gid']||'global';function _0x428ebf(_0xac1e24,_0x170d5d,_0x3f9384){global['distributi'+'on']['local']['groups']['get'](_0x1f8e14['gid'],(_0x51053e,_0xd3f57c)=>{const _0x3d6eb0=Object['keys'](_0xd3f57c)['length'];if(_0x3d6eb0===-0xf6*0xc+-0x2476+0x2ffe){_0x3f9384(new Error('No\x20nodes\x20f'+'ound'));return;}let _0x11c100=0x1ff0+-0x201a+-0x7*-0x6;const _0x21b9eb={},_0x123cab={};for(const _0x2d8d17 of Object['keys'](_0xd3f57c)){const _0x197072=_0xd3f57c[_0x2d8d17],_0x3e3388={'node':{'ip':_0x197072['ip'],'port':_0x197072['port']},'service':_0x170d5d['service'],'method':_0x170d5d['method'],'group':_0x170d5d['group']||'local'};global['distributi'+'on']['local']['comm']['send'](_0xac1e24,_0x3e3388,(_0x2b4d5f,_0x47e3c1)=>{_0x2b4d5f?_0x123cab[_0x2d8d17]=_0x2b4d5f:_0x21b9eb[_0x2d8d17]=_0x47e3c1,_0x11c100+=0x1a6e+0x19f2+-0x1175*0x3,_0x11c100===_0x3d6eb0&&_0x3f9384(_0x123cab,_0x21b9eb);});}});}return{'send':_0x428ebf};};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=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0xec35b){const _0x19e1d6={'gid':_0xec35b['gid']||'global'};function _0x3ef6e4(_0x11964b,_0xd1d4ed){const _0x5aef47=id['getSID'](_0x11964b),_0x11c35d={'mapper':_0x11964b['map'],'reducer':_0x11964b['reduce'],'map':function(_0x365602,_0x38c1d1,_0x34231d,_0x1bec09){if(_0x365602['length']==-0xa59*-0x3+0xbad*0x3+-0x4212)_0x1bec09(null,{});else{const _0x536d19=[];let _0x11e731=-0x989+-0x102*0x1f+0x28c7;_0x365602['forEach'](_0x1b59fc=>{distribution[_0x38c1d1]['store']['get'](_0x1b59fc,(_0x401c24,_0x352aaa)=>{_0x11e731++;const _0xa6772e=this['mapper'](_0x1b59fc,_0x352aaa);Array['isArray'](_0xa6772e)?_0x536d19['push'](..._0xa6772e):_0x536d19['push'](_0xa6772e),_0x11e731==_0x365602['length']&&distribution['local']['store']['put'](_0x536d19,_0x34231d+'_map',(_0x19471e,_0x12dd47)=>{_0x1bec09(_0x19471e,_0x536d19);});});});}},'shuffle':function(_0x58cc9b,_0x5cb604,_0x19a6d3){distribution['local']['store']['get'](_0x5cb604+'_map',(_0x4b4df1,_0x2d5d19)=>{if(!_0x4b4df1){let _0x4a63d9=0xe7f+0x43+-0xec2;_0x2d5d19['forEach'](_0x9c8ab3=>{const [_0x266b04]=Object['keys'](_0x9c8ab3);distribution[_0x58cc9b]['mem']['put'](_0x9c8ab3[_0x266b04],{'key':_0x266b04,'action':'append'},(_0x1e9e4b,_0x5c6918)=>{_0x4a63d9++,_0x4a63d9==_0x2d5d19['length']&&_0x19a6d3(null,_0x2d5d19);});});}else _0x19a6d3(_0x4b4df1,{});});},'reduce':function(_0x24052a,_0x3e4b4a,_0x2a0942){distribution['local']['mem']['get']({'key':null,'gid':_0x24052a},(_0x3d524c,_0x5675e9)=>{let _0x44907a=[],_0x5a5867=-0x1aa6+-0x22d8+0x1*0x3d7e;_0x5675e9['length']==0x243c+0x6*-0x3af+-0xe22&&_0x2a0942(null,null),_0x5675e9['forEach'](_0x2b7979=>distribution['local']['mem']['get']({'key':_0x2b7979,'gid':_0x24052a},(_0x5c5fb9,_0x3c0e8c)=>{const _0x2391e0=this['reducer'](_0x2b7979,_0x3c0e8c);_0x44907a=_0x44907a['concat'](_0x2391e0),_0x5a5867++,_0x5a5867==_0x5675e9['length']&&_0x2a0942(null,_0x44907a);}));});}},_0x3e724c=function(_0x46cbac,_0x31ae55){const _0x1b4e2e={};return Object['keys'](_0x31ae55)['forEach'](_0x3f03f9=>{_0x1b4e2e[_0x3f03f9]=[];}),_0x46cbac['forEach'](_0x11c1dc=>{const _0x487702=id['getID'](_0x11c1dc),_0x11a4e3=id['naiveHash'](_0x487702,Object['keys'](_0x31ae55));_0x1b4e2e[_0x11a4e3]['push'](_0x11c1dc);}),_0x1b4e2e;};distribution[_0x19e1d6['gid']]['routes']['put'](_0x11c35d,'mr-'+_0x5aef47,(_0x41bff3,_0x53d96f)=>{distribution['local']['groups']['get'](_0x19e1d6['gid'],(_0x3620bf,_0x672f74)=>{const _0x56ea04=_0x3e724c(_0x11964b['keys'],_0x672f74);let _0xe09642=0xc4*-0x20+0xc63*-0x1+-0x85*-0x47;const _0x3ce435=Object['keys'](_0x672f74)['length'],_0x5059ac={'service':'mr-'+_0x5aef47,'method':'map'};for(const _0x470607 in _0x672f74){_0x5059ac['node']=_0x672f74[_0x470607];const _0x802d07=[_0x56ea04[_0x470607],_0x19e1d6['gid'],_0x5aef47];distribution['local']['comm']['send'](_0x802d07,_0x5059ac,(_0x2576cb,_0x2c21d6)=>{++_0xe09642;if(_0xe09642==_0x3ce435){const _0x3a28f2={'service':'mr-'+_0x5aef47,'method':'shuffle'};distribution[_0x19e1d6['gid']]['comm']['send']([_0x19e1d6['gid'],_0x5aef47],_0x3a28f2,(_0x2ec81f,_0x52ccdb)=>{const _0x19aa91={'service':'mr-'+_0x5aef47,'method':'reduce'};distribution[_0x19e1d6['gid']]['comm']['send']([_0x19e1d6['gid'],_0x5aef47],_0x19aa91,(_0x476341,_0x221f74)=>{let _0x58c8fd=[];for(const _0x30cf48 of Object['values'](_0x221f74)){_0x30cf48!==null&&(_0x58c8fd=_0x58c8fd['concat'](_0x30cf48));}_0xd1d4ed(null,_0x58c8fd);return;distribution[_0x19e1d6['gid']]['routes']['rem']('mr-'+_0x5aef47,(_0x433e5b,_0x542a20)=>{});});});}});}});});}return{'exec':_0x3ef6e4};};module['exports']=mr;
9
+ const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0x25fd4b){const _0x2e9d09={'gid':_0x25fd4b['gid']||'global'};function _0x2b94c5(_0x41aa83,_0x5882c1){const _0x3d7958=id['getSID'](_0x41aa83),_0x2c98d8={'mapper':_0x41aa83['map'],'reducer':_0x41aa83['reduce'],'map':function(_0x13da64,_0x96326c,_0x52508f,_0x4c64e4){if(_0x13da64['length']==-0x1f2b*0x1+-0x17de+0x3709)_0x4c64e4(null,{});else{const _0xadd485=[];let _0x2de1e9=0x1063*0x1+-0xad1*-0x1+-0x1b34;_0x13da64['forEach'](_0x47427a=>{distribution[_0x96326c]['store']['get'](_0x47427a,(_0x1643c8,_0x179075)=>{_0x2de1e9++;const _0x746072=this['mapper'](_0x47427a,_0x179075);Array['isArray'](_0x746072)?_0xadd485['push'](..._0x746072):_0xadd485['push'](_0x746072),_0x2de1e9==_0x13da64['length']&&distribution['local']['store']['put'](_0xadd485,_0x52508f+'_map',(_0x505369,_0x427025)=>{_0x4c64e4(_0x505369,_0xadd485);});});});}},'shuffle':function(_0x485683,_0x52a07d,_0x18715d){distribution['local']['store']['get'](_0x52a07d+'_map',(_0x379ccc,_0x4e5c28)=>{if(!_0x379ccc){let _0x59dc81=-0x23a2+0x1309+0x1099;_0x4e5c28['forEach'](_0x7e8d6b=>{const [_0x9e7f61]=Object['keys'](_0x7e8d6b);distribution[_0x485683]['mem']['put'](_0x7e8d6b[_0x9e7f61],{'key':_0x9e7f61,'action':'append'},(_0xee1926,_0x1eb4ff)=>{_0x59dc81++,_0x59dc81==_0x4e5c28['length']&&_0x18715d(null,_0x4e5c28);});});}else _0x18715d(_0x379ccc,{});});},'reduce':function(_0x3d4f5e,_0xd8c090,_0x31e966){distribution['local']['mem']['get']({'key':null,'gid':_0x3d4f5e},(_0x1f9175,_0x27a433)=>{let _0x4c4c0d=[],_0x560707=0x16f1+0x2331+-0x3a22;_0x27a433['length']==0x5*0x48f+-0x25ca+0x1*0xeff&&_0x31e966(null,null),_0x27a433['forEach'](_0x5c8bf2=>distribution['local']['mem']['get']({'key':_0x5c8bf2,'gid':_0x3d4f5e},(_0x450cc5,_0x46b259)=>{const _0x56c1db=this['reducer'](_0x5c8bf2,_0x46b259);_0x4c4c0d=_0x4c4c0d['concat'](_0x56c1db),_0x560707++,_0x560707==_0x27a433['length']&&_0x31e966(null,_0x4c4c0d);}));});}},_0x474ad0=function(_0x437781,_0x3ee4c8){const _0x51ef25={};return Object['keys'](_0x3ee4c8)['forEach'](_0x30d20e=>{_0x51ef25[_0x30d20e]=[];}),_0x437781['forEach'](_0x110627=>{const _0x570353=id['getID'](_0x110627),_0x36c0ec=id['naiveHash'](_0x570353,Object['keys'](_0x3ee4c8));_0x51ef25[_0x36c0ec]['push'](_0x110627);}),_0x51ef25;};distribution[_0x2e9d09['gid']]['routes']['put'](_0x2c98d8,'mr-'+_0x3d7958,(_0x574c15,_0xd4f7c5)=>{distribution['local']['groups']['get'](_0x2e9d09['gid'],(_0x26ea36,_0x18dfa7)=>{const _0x299848=_0x474ad0(_0x41aa83['keys'],_0x18dfa7);let _0x1148e8=0xf81+-0x2*0x74b+-0xeb;const _0x5b36e9=Object['keys'](_0x18dfa7)['length'],_0x237707={'service':'mr-'+_0x3d7958,'method':'map'};for(const _0xf35548 in _0x18dfa7){_0x237707['node']=_0x18dfa7[_0xf35548];const _0x22d5bf=[_0x299848[_0xf35548],_0x2e9d09['gid'],_0x3d7958];distribution['local']['comm']['send'](_0x22d5bf,_0x237707,(_0xb90796,_0xad07e0)=>{++_0x1148e8;if(_0x1148e8==_0x5b36e9){const _0x385a0e={'service':'mr-'+_0x3d7958,'method':'shuffle'};distribution[_0x2e9d09['gid']]['comm']['send']([_0x2e9d09['gid'],_0x3d7958],_0x385a0e,(_0x30d7e9,_0x1e99fd)=>{const _0x2936fa={'service':'mr-'+_0x3d7958,'method':'reduce'};distribution[_0x2e9d09['gid']]['comm']['send']([_0x2e9d09['gid'],_0x3d7958],_0x2936fa,(_0x268e02,_0x183165)=>{let _0x219824=[];for(const _0x2fbb50 of Object['values'](_0x183165)){_0x2fbb50!==null&&(_0x219824=_0x219824['concat'](_0x2fbb50));}_0x5882c1(null,_0x219824);return;distribution[_0x2e9d09['gid']]['routes']['rem']('mr-'+_0x3d7958,(_0x32a27f,_0x35cda5)=>{});});});}});}});});}return{'exec':_0x2b94c5};};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(_0x5a65c8,_0x48c395,_0x7b40bc){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x5a65c8)+'to\x20'+_0x48c395['service']+':'+_0x48c395['method']+'\x20on\x20'+_0x48c395['node']['ip']+':'+_0x48c395['node']['port']);if(!_0x5a65c8 instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');const _0xdd5700=_0x48c395['node'],_0x20bf2d=_0x48c395['service'],_0x687a05=_0x48c395['method'],_0x15198f=_0x48c395['group']||'local',_0x4c5014=serialization['serialize'](_0x5a65c8),_0x4c224b={'hostname':_0xdd5700['ip'],'port':_0xdd5700['port'],'path':'/'+_0x15198f+'/'+_0x20bf2d+'/'+_0x687a05,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x4c5014)}},_0x5de4a2=http['request'](_0x4c224b,_0x37333c=>{let _0x1e921c='';_0x37333c['on']('data',function(_0x561dd4){_0x1e921c+=_0x561dd4;}),_0x37333c['on']('end',function(){_0x7b40bc&&_0x7b40bc(...serialization['deserializ'+'e'](_0x1e921c));}),_0x37333c['on']('error',function(_0x43b47a){_0x7b40bc&&_0x7b40bc(new Error('Error\x20on\x20r'+'esponse'));});});_0x5de4a2['on']('error',function(_0x2264f4){_0x7b40bc&&_0x7b40bc(new Error(_0x2264f4));}),_0x5de4a2['write'](_0x4c5014),_0x5de4a2['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 http=require('http'),url=require('url'),log=require('../util/lo'+'g'),serialization=require('../util/se'+'rializatio'+'n');function isValidBody(_0x1d8398){if(_0x1d8398['length']===0x3*-0x761+0x110+0x1*0x1513)return new Error('No\x20body');try{_0x1d8398=JSON['parse'](_0x1d8398);}catch(_0x2d3083){return _0x2d3083;}return undefined;}function endRequest(_0x11432d,_0x438dcc){_0x11432d['end'](serialization['serialize']([_0x438dcc]));}const start=function(_0x27f278){const _0x15ef75=http['createServ'+'er']((_0x5bde2a,_0x31a145)=>{if(_0x5bde2a['method']!=='PUT'){_0x31a145['end'](serialization['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const _0x56cb53=url['parse'](_0x5bde2a['url'])['pathname'],[,_0x4338f4,_0x4f6aef,_0x118ae6]=_0x56cb53['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x4338f4+'\x20'+_0x4f6aef+':'+_0x118ae6+'\x20from\x20'+_0x5bde2a['connection']['remoteAddr'+'ess']);let _0x26d95e=[];_0x5bde2a['on']('data',_0x7aa3ca=>{_0x26d95e['push'](_0x7aa3ca);}),_0x5bde2a['on']('end',()=>{_0x26d95e=Buffer['concat'](_0x26d95e)['toString']();let _0x207b74;if(_0x207b74=isValidBody(_0x26d95e)){endRequest(_0x31a145,_0x207b74);return;}_0x26d95e=JSON['parse'](_0x26d95e),_0x26d95e=serialization['deserializ'+'e'](_0x26d95e);const _0x315c69=_0x26d95e;!Array['isArray'](_0x315c69)&&endRequest(_0x31a145,new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x315c69));const _0x2b0671=_0x4f6aef;global['distributi'+'on']['local']['routes']['get']({'serviceName':_0x2b0671,'gid':_0x4338f4},(_0x3988f3,_0x11edad)=>{const _0x7d459d=(_0x12eaa5,_0x31d838)=>{_0x31a145['end'](serialization['serialize']([_0x12eaa5,_0x31d838]));};if(_0x3988f3){_0x7d459d(_0x3988f3);return;}if(!_0x11edad[_0x118ae6]){_0x7d459d(new Error('Method\x20'+_0x118ae6+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x2b0671));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x2b0671+':'+_0x118ae6+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x315c69));_0x315c69['length']===-0x1037*0x1+0xa06*-0x3+0x942*0x5&&_0x11edad[_0x118ae6]['length']===0x1a3c+0x17*-0x13+0xc42*-0x2&&_0x315c69['push'](undefined);try{_0x11edad[_0x118ae6](..._0x315c69,_0x7d459d);}catch(_0x2b7917){_0x7d459d(_0x2b7917);}});});});_0x15ef75['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']=_0x15ef75,_0x27f278(_0x15ef75);}),_0x15ef75['on']('error',_0x21a19b=>{log('Server\x20err'+'or:\x20'+_0x21a19b);throw _0x21a19b;});};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(_0xe9d645,_0x566453){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0xe9d645));if(!_0x566453)return;typeof _0xe9d645==='string'&&(_0xe9d645={'serviceName':_0xe9d645});const _0x21a725=_0xe9d645['serviceNam'+'e'],_0x13c2a0=_0xe9d645['gid'];if(_0x13c2a0&&_0x13c2a0!=='local'){log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x21a725);const _0x5d8a76=global['distributi'+'on'][_0x13c2a0][_0x21a725];_0x566453(null,_0x5d8a76);}else{if(_0x21a725 in routesStore){const _0x288455=routesStore[_0x21a725];log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x21a725),_0x566453(null,_0x288455);}else{const _0x5daf3e=global['toLocal']['get'](_0x21a725);_0x5daf3e?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x21a725),_0x566453(null,{'call':_0x5daf3e})):_0x566453(new Error('Service\x20'+_0x21a725+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x571665,_0x4f08c8,_0x3c95de){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x4f08c8+'\x20'+JSON['stringify'](_0x571665)),routesStore[_0x4f08c8]=_0x571665;_0x3c95de&&_0x3c95de(null,_0x4f08c8);;}function rem(_0x4bdabf,_0x1c74fd){const _0x1ccdcc=routesStore[_0x4bdabf];delete routesStore[_0x4bdabf],_0x1c74fd(null,_0x1ccdcc);};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 */
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.47",
3
+ "version": "0.1.0",
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
  },