@brown-ds/distribution 0.0.41 → 0.0.43

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
- const comm=function(_0x48a27e){let _0x21c2c2={};return _0x21c2c2['gid']=_0x48a27e['gid']||'global',{'send':(_0x4fe6d6,_0x556559,_0x13fdcb)=>{global['distributi'+'on']['local']['groups']['get'](_0x21c2c2['gid'],(_0x34177f,_0x3c762b)=>{let _0x43e53a=Object['keys'](_0x3c762b)['length'];if(_0x43e53a===0x23fa+-0x240+-0x21ba){_0x13fdcb(new Error('No\x20nodes\x20f'+'ound'));return;}let _0x153528=0x74a+-0x1d80+0x1636,_0x3fee4c={},_0x3763a9={};for(let _0x41f4cf of Object['keys'](_0x3c762b)){let _0x2774a6=_0x3c762b[_0x41f4cf],_0xed4852={'node':{'ip':_0x2774a6['ip'],'port':_0x2774a6['port']},'service':_0x556559['service'],'method':_0x556559['method']};distribution['local']['comm']['send'](_0x4fe6d6,_0xed4852,(_0x1cd74d,_0x37f5ef)=>{_0x1cd74d?_0x3763a9[_0x41f4cf]=_0x1cd74d:_0x3fee4c[_0x41f4cf]=_0x37f5ef,_0x153528+=0x11b8+-0x1e18+0xc61,_0x153528===_0x43e53a&&_0x13fdcb(_0x3763a9,_0x3fee4c);});}});}};};module['exports']=comm;
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;
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');let gossip=function(_0x2c092a){let _0x456f42={};return _0x456f42['gid']=_0x2c092a['gid']||'global',_0x456f42['subset']=_0x2c092a['subset']||function(_0x2ce2b9){return Math['ceil'](Math['log'](_0x2ce2b9['length']));},{'send':(_0x1dbbaa,_0x43305d,_0x33fc7b)=>{global['distributi'+'on']['local']['groups']['get'](_0x456f42['gid'],(_0x5a700c,_0x9bf48d)=>{let _0x549350=_0x456f42['subset'](Object['keys'](_0x9bf48d)),_0x55cffa=function(_0x2a3ad1){let _0x5024fe=new Set();while(_0x5024fe['size']<_0x549350){let _0x59c9a0=Math['floor'](Math['random']()*_0x2a3ad1['length']);_0x5024fe['add'](_0x2a3ad1[_0x59c9a0]);}return _0x5024fe;},_0x4c6b65=_0x55cffa(Object['keys'](_0x9bf48d)),_0x63ad61={},_0x412dc8={},_0x25c6f0=-0x6*0x44+-0x23ae+-0x16f*-0x1a;if(_0x1dbbaa['mid']&&_0x1dbbaa['gid']){}else _0x1dbbaa={'message':_0x1dbbaa,'remote':_0x43305d,'mid':id['getMID'](_0x1dbbaa),'gid':_0x456f42['gid']};for(let _0x5dbeca of _0x4c6b65){let _0x5e1c92=_0x9bf48d[_0x5dbeca],_0x504df3={'node':{'ip':_0x5e1c92['ip'],'port':_0x5e1c92['port']},'service':'gossip','method':'recv'};global['distributi'+'on']['local']['comm']['send']([_0x1dbbaa],_0x504df3,(_0x2d60e0,_0x1c5fa0)=>{_0x2d60e0?_0x412dc8[_0x5dbeca]=_0x2d60e0:_0x63ad61[_0x5dbeca]=_0x1c5fa0,_0x25c6f0+=0xf*-0x3a+-0x2*-0x3f1+0x47b*-0x1,_0x25c6f0===_0x549350&&(_0x33fc7b&&_0x33fc7b(_0x412dc8,_0x63ad61));});}});},'at':(_0x2d2245,_0x21fc9b,_0x5ed429)=>{let _0x402bb1=setInterval(_0x21fc9b,_0x2d2245);_0x5ed429&&_0x5ed429(null,_0x402bb1);},'del':(_0x21b20a,_0x1f9bd9)=>{clearInterval(_0x21b20a),_0x1f9bd9&&_0x1f9bd9(null,_0x21b20a);}};};module['exports']=gossip;
9
+ const id=require('../util/id'),gossip=function(_0x2b8b8c){const _0x475077={};return _0x475077['gid']=_0x2b8b8c['gid']||'global',_0x475077['subset']=_0x2b8b8c['subset']||function(_0x9ca960){return Math['ceil'](Math['log'](_0x9ca960['length']));},{'send':(_0x36ae05,_0x11cbb2,_0x881258)=>{global['distributi'+'on']['local']['groups']['get'](_0x475077['gid'],(_0x1002cc,_0x45cb3f)=>{const _0x3f1a4e=_0x475077['subset'](Object['keys'](_0x45cb3f)),_0x4a721a=function(_0x25671e){const _0x4baab8=new Set();while(_0x4baab8['size']<_0x3f1a4e){const _0x15b724=Math['floor'](Math['random']()*_0x25671e['length']);_0x4baab8['add'](_0x25671e[_0x15b724]);}return _0x4baab8;},_0x301671=_0x4a721a(Object['keys'](_0x45cb3f)),_0xffcb19={},_0x5d7f55={};let _0x139945=0x15*-0xb6+-0x9*0x258+0x2406;if(_0x36ae05['mid']&&_0x36ae05['gid']){}else _0x36ae05={'message':_0x36ae05,'remote':_0x11cbb2,'mid':id['getMID'](_0x36ae05),'gid':_0x475077['gid']};for(const _0x22723c of _0x301671){const _0x39d636=_0x45cb3f[_0x22723c],_0x6cf7e9={'node':{'ip':_0x39d636['ip'],'port':_0x39d636['port']},'service':'gossip','method':'recv'};global['distributi'+'on']['local']['comm']['send']([_0x36ae05],_0x6cf7e9,(_0x2916ad,_0x22f437)=>{_0x2916ad?_0x5d7f55[_0x22723c]=_0x2916ad:_0xffcb19[_0x22723c]=_0x22f437,_0x139945+=-0x60e+-0x5e7*-0x1+-0x1*-0x28,_0x139945===_0x3f1a4e&&(_0x881258&&_0x881258(_0x5d7f55,_0xffcb19));});}});},'at':(_0x5f1dcb,_0x2946f3,_0x19cee4)=>{const _0x3853f1=setInterval(_0x2946f3,_0x5f1dcb);_0x19cee4&&_0x19cee4(null,_0x3853f1);},'del':(_0x544c82,_0x68fcde)=>{clearInterval(_0x544c82),_0x68fcde&&_0x68fcde(null,_0x544c82);}};};module['exports']=gossip;
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 groups=function(_0x3d6e23){let _0x539a05={};return _0x539a05['gid']=_0x3d6e23['gid']||'global',{'put':(_0x3bd42f,_0x142d63,_0x2c6680)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x3bd42f,_0x142d63],{'service':'groups','method':'put'},_0x2c6680);},'del':(_0x3e1894,_0x10dbe6)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x3e1894],{'service':'groups','method':'del'},_0x10dbe6);},'get':(_0x51b365,_0x2f5287)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x51b365],{'service':'groups','method':'get'},_0x2f5287);},'add':(_0x1c572c,_0x3f97c9,_0x52f43a)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x1c572c,_0x3f97c9],{'service':'groups','method':'add'},_0x52f43a);},'rem':(_0x5ca29b,_0x315e62,_0x5eb9a2)=>{global['distributi'+'on'][_0x539a05['gid']]['comm']['send']([_0x5ca29b,_0x315e62],{'service':'groups','method':'rem'},_0x5eb9a2);}};};module['exports']=groups;
9
+ const groups=function(_0x27bdae){const _0x30ce69={};return _0x30ce69['gid']=_0x27bdae['gid']||'global',{'put':(_0x15e8b2,_0x343fca,_0x36a777)=>{global['distributi'+'on'][_0x30ce69['gid']]['comm']['send']([_0x15e8b2,_0x343fca],{'service':'groups','method':'put'},_0x36a777);},'del':(_0x302f70,_0x2e5da9)=>{global['distributi'+'on'][_0x30ce69['gid']]['comm']['send']([_0x302f70],{'service':'groups','method':'del'},_0x2e5da9);},'get':(_0x1b2b65,_0x7f4fa)=>{global['distributi'+'on'][_0x30ce69['gid']]['comm']['send']([_0x1b2b65],{'service':'groups','method':'get'},_0x7f4fa);},'add':(_0x406ecb,_0x4d7114,_0x41529c)=>{global['distributi'+'on'][_0x30ce69['gid']]['comm']['send']([_0x406ecb,_0x4d7114],{'service':'groups','method':'add'},_0x41529c);},'rem':(_0x417a3e,_0xb9879f,_0xa28bb0)=>{global['distributi'+'on'][_0x30ce69['gid']]['comm']['send']([_0x417a3e,_0xb9879f],{'service':'groups','method':'rem'},_0xa28bb0);}};};module['exports']=groups;
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(_0x589765,_0x19e411,_0xc1f933){typeof _0x19e411==='object'&&(_0x19e411=_0x19e411['key']),distribution[_0x589765['gid']]['status']['get']('nid',(_0x56a4dc,_0x327511)=>{let _0x1ec6eb=Object['values'](_0x327511),_0x2a079a=util['id']['getID'](_0x19e411),_0x2b837c=_0x589765['hash'](_0x2a079a,_0x1ec6eb),_0x3f4b86=_0x2b837c['substring'](0xfac+0x12f2+-0x229e,0x1676+-0x17c*0x1a+-0x33b*-0x5);distribution['local']['groups']['get'](_0x589765['gid'],(_0x36b12d,_0x3152f9)=>{let _0xe9ec=_0x3152f9[_0x3f4b86];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x19e411)+'group:\x20'+JSON['stringify'](_0x3152f9)+'\x20node:\x20'+JSON['stringify'](_0xe9ec)+'nid:\x20'+JSON['stringify'](_0x2b837c)+'\x20sid:\x20'+JSON['stringify'](_0x3f4b86)),_0xc1f933(_0xe9ec);});});}function normalize(_0xe68513,_0x44d826){let _0x23951e={};_0xe68513===null&&(_0xe68513={});if(typeof _0xe68513==='string')_0x23951e['key']=_0xe68513,_0x23951e['gid']=_0x44d826,_0x23951e['action']='put';else typeof _0xe68513==='object'&&(_0x23951e['key']=_0xe68513['key'],_0x23951e['gid']=_0xe68513['gid']||_0x44d826,_0x23951e['action']=_0xe68513['action']||'put');return _0x23951e;};const mem=function(_0x3a1d0e){let _0x2283ec={};return _0x2283ec['gid']=_0x3a1d0e['gid']||'all',_0x2283ec['hash']=_0x3a1d0e['hash']||util['id']['naiveHash'],{'get':(_0xaccb4e,_0x5dad77)=>{if(!_0xaccb4e){let _0x886e1d=[{'key':null,'gid':_0x2283ec['gid']}];distribution[_0x2283ec['gid']]['comm']['send'](_0x886e1d,{'service':'mem','method':'get'},(_0x71d717,_0xf9e85d)=>{let _0x50cc5a=Object['values'](_0xf9e85d)['reduce']((_0x614ca4,_0x13fda0)=>_0x614ca4['concat'](_0x13fda0),[]);_0x5dad77(_0x71d717,_0x50cc5a);});return;}_0xaccb4e=normalize(_0xaccb4e,_0x2283ec['gid']),getNode(_0x2283ec,_0xaccb4e,_0x4083f4=>{let _0x1c45e4=[_0xaccb4e],_0xc7d1fc={'service':'mem','method':'get','node':_0x4083f4};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0xaccb4e)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x4083f4)),distribution['local']['comm']['send'](_0x1c45e4,_0xc7d1fc,_0x5dad77);});},'put':(_0x2ac3e5,_0x2d7ec8,_0x4fecc2)=>{_0x2d7ec8=_0x2d7ec8||util['id']['getID'](_0x2ac3e5),_0x2d7ec8=normalize(_0x2d7ec8,_0x2283ec['gid']),getNode(_0x2283ec,_0x2d7ec8,_0x286b9e=>{let _0x49f76f=[_0x2ac3e5,_0x2d7ec8],_0x21c899={'service':'mem','method':'put','node':_0x286b9e};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x2ac3e5)+('configurat'+'ion:\x20')+JSON['stringify'](_0x2d7ec8)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x286b9e)),distribution['local']['comm']['send'](_0x49f76f,_0x21c899,_0x4fecc2);});},'del':(_0x16b8b2,_0x5ede00)=>{getNode(_0x2283ec,_0x16b8b2,_0x35d4fc=>{let _0x44075a=[{'key':_0x16b8b2,'gid':_0x2283ec['gid']}],_0x48105a={'service':'mem','method':'del','node':_0x35d4fc};distribution['local']['comm']['send'](_0x44075a,_0x48105a,_0x5ede00);});},'reconf':(_0x2ae122,_0x2ec210)=>{distribution[_0x2283ec['gid']]['mem']['get'](null,(_0x4e758b,_0x4f2a58)=>{distribution[_0x2283ec['gid']]['status']['get']('nid',(_0x3c9859,_0x464236)=>{let _0xfbb01a=Object['values'](_0x464236),_0x2f589b=Object['values'](_0x2ae122)['map'](_0x260bab=>util['id']['getNID'](_0x260bab)),_0x2cdc74=0xeb7*0x1+0x1*0x18ac+-0x2763*0x1;const _0x5113ba=()=>{_0x2cdc74===_0x4f2a58['length']&&_0x2ec210();};if(_0x4f2a58['length']===0x1f5f+-0x1*-0x49f+-0x23fe){_0x2ec210();return;}for(let _0x1e74de of _0x4f2a58){let _0x3a2d06=util['id']['getID'](_0x1e74de),_0x55df9c=_0x2283ec['hash'](_0x3a2d06,_0x2f589b),_0x545ae9=_0x2283ec['hash'](_0x3a2d06,_0xfbb01a);if(_0x55df9c===_0x545ae9){_0x2cdc74++,_0x5113ba();continue;}let _0x4853c1=_0x2ae122[_0x55df9c['substring'](-0xb5c*0x1+-0x691+0x11ed,-0x2037+-0x1fcc+0x4008)],_0x1ffaf1=[{'key':_0x1e74de,'gid':_0x2283ec['gid']}],_0x1b81a2={'service':'mem','method':'del','node':_0x4853c1};distribution['local']['comm']['send'](_0x1ffaf1,_0x1b81a2,(_0x4e42af,_0x394b89)=>{distribution[_0x2283ec['gid']]['mem']['put'](_0x394b89,_0x1e74de,(_0xe183fd,_0x27f8da)=>{_0x2cdc74++,_0x5113ba();});});}});});}};};module['exports']=mem;
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;
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'],mr=function(_0x2c5607={'gid':'all'}){const _0x44318e={};return _0x44318e['gid']=_0x2c5607['gid'],{'exec':(_0x5a012f,_0x1b3ad7)=>{const _0x1d87ed=id['getSID'](_0x5a012f);mrSvc={'mapper':_0x5a012f['map'],'reducer':_0x5a012f['reduce'],'map':function(_0x485fa0,_0x89ec28,_0x2372a3,_0x19556e=function(){}){if(_0x485fa0['length']==0x34a+0x34c+-0x34b*0x2)_0x19556e(null,{});else{let _0x180e3a=[],_0x56344a=-0x699*-0x5+-0x1aef*-0x1+0x1a*-0x24e;_0x485fa0['forEach'](_0x3052fe=>{distribution[_0x89ec28]['store']['get'](_0x3052fe,(_0x9c0d8b,_0x39b495)=>{_0x56344a++;const _0x387897=this['mapper'](_0x3052fe,_0x39b495);Array['isArray'](_0x387897)?_0x180e3a['push'](..._0x387897):_0x180e3a['push'](_0x387897),_0x56344a==_0x485fa0['length']&&distribution['local']['store']['put'](_0x180e3a,_0x2372a3+'_map',(_0x58d765,_0x31d8da)=>{_0x19556e(_0x58d765,_0x180e3a);});});});}},'shuffle':function(_0x3a589f,_0x565717,_0x11c047=function(){}){distribution['local']['store']['get'](_0x565717+'_map',(_0x6ffd8a,_0x5f5728)=>{!_0x6ffd8a?(cnt=0x1a23+0xf*-0x255+0x2*0x46c,_0x5f5728['forEach'](_0x407239=>{const [_0x27d837]=Object['keys'](_0x407239);distribution[_0x3a589f]['mem']['put'](_0x407239[_0x27d837],{'key':_0x27d837,'action':'append'},(_0x125dc6,_0x5053ca)=>{cnt++,cnt==_0x5f5728['length']&&_0x11c047(null,_0x5f5728);});})):_0x11c047(_0x6ffd8a,{});});},'reduce':function(_0x2c8a31,_0x57a7e9,_0x57afe9){distribution['local']['mem']['get']({'key':null,'gid':_0x2c8a31},(_0xc3ab37,_0x4c717d)=>{let _0x16ae98=[],_0x13f74d=-0x170b+-0x13*0x12a+-0xb*-0x41b;_0x4c717d['length']==0x54a*0x5+-0xaf5+-0xf7d&&_0x57afe9(null,null),_0x4c717d['forEach'](_0x56ef42=>distribution['local']['mem']['get']({'key':_0x56ef42,'gid':_0x2c8a31},(_0xec6e23,_0x574eda)=>{let _0x5ccbbb=this['reducer'](_0x56ef42,_0x574eda);_0x16ae98=_0x16ae98['concat'](_0x5ccbbb),_0x13f74d++,_0x13f74d==_0x4c717d['length']&&_0x57afe9(null,_0x16ae98);}));});}};const _0x57a91c=function(_0x3b4078,_0x25bc80){let _0x5e656f={};return Object['keys'](_0x25bc80)['forEach'](_0x549d25=>{_0x5e656f[_0x549d25]=[];}),_0x3b4078['forEach'](_0x57ae52=>{let _0x3898a1=id['getID'](_0x57ae52),_0x1366b4=id['naiveHash'](_0x3898a1,Object['keys'](_0x25bc80));_0x5e656f[_0x1366b4]['push'](_0x57ae52);}),_0x5e656f;};distribution[_0x44318e['gid']]['routes']['put'](mrSvc,'mr-'+_0x1d87ed,(_0x5515f6,_0x3b0c98)=>{distribution['local']['groups']['get'](_0x44318e['gid'],(_0x3bc002,_0x1ede33)=>{let _0x1c35c6=_0x57a91c(_0x5a012f['keys'],_0x1ede33),_0x1c51f9=0x21d2+-0x1449+-0x2b5*0x5;const _0x28d92c=Object['keys'](_0x1ede33)['length'];let _0x49eb71={'service':'mr-'+_0x1d87ed,'method':'map'};for(let _0xb25b00 in _0x1ede33){if(!![]){_0x49eb71['node']=_0x1ede33[_0xb25b00];let _0x17678b=[_0x1c35c6[_0xb25b00],_0x44318e['gid'],_0x1d87ed];distribution['local']['comm']['send'](_0x17678b,_0x49eb71,(_0x470936,_0x6e7838)=>{++_0x1c51f9;if(_0x1c51f9==_0x28d92c){let _0x3b5efb={'service':'mr-'+_0x1d87ed,'method':'shuffle'};distribution[_0x44318e['gid']]['comm']['send']([_0x44318e['gid'],_0x1d87ed],_0x3b5efb,(_0x30fa7a,_0x426326)=>{let _0x350928={'service':'mr-'+_0x1d87ed,'method':'reduce'};distribution[_0x44318e['gid']]['comm']['send']([_0x44318e['gid'],_0x1d87ed],_0x350928,(_0x10098c,_0x21fe13)=>{let _0x1eed2a=[];for(let _0x3d0951 of Object['values'](_0x21fe13)){_0x3d0951!==null&&(_0x1eed2a=_0x1eed2a['concat'](_0x3d0951));}_0x1b3ad7(_0x10098c,_0x1eed2a);return;distribution[_0x44318e['gid']]['routes']['rem']('mr-'+_0x1d87ed,(_0x1dbdd0,_0x2feafd)=>{_0x1b3ad7(null,_0x1eed2a);});});});}});}}});});}};};module['exports']=mr;
9
+ const distribution=require('../../dist'+'ribution'),id=distribution['util']['id'];function mr(_0x268e55={'gid':'all'}){const _0x6c6004={};_0x6c6004['gid']=_0x268e55['gid'];function _0x2bd47b(_0x2aa17d,_0x28f51e){const _0x45fd82=id['getSID'](_0x2aa17d),_0x5b2961={'mapper':_0x2aa17d['map'],'reducer':_0x2aa17d['reduce'],'map':function(_0x49f03e,_0x3f8333,_0x447526,_0x1577ba=()=>{}){if(_0x49f03e['length']==0x3c0+0x1546+-0x1906)_0x1577ba(null,{});else{const _0x2a713a=[];let _0x722c0e=0xb20*-0x1+0x1*0x1a26+-0xf06*0x1;_0x49f03e['forEach'](_0x8babd8=>{distribution[_0x3f8333]['store']['get'](_0x8babd8,(_0x3e9aa5,_0x1b0aa8)=>{_0x722c0e++;const _0x1b5fe4=this['mapper'](_0x8babd8,_0x1b0aa8);Array['isArray'](_0x1b5fe4)?_0x2a713a['push'](..._0x1b5fe4):_0x2a713a['push'](_0x1b5fe4),_0x722c0e==_0x49f03e['length']&&distribution['local']['store']['put'](_0x2a713a,_0x447526+'_map',(_0x36b568,_0x44ebfb)=>{_0x1577ba(_0x36b568,_0x2a713a);});});});}},'shuffle':function(_0x4a816f,_0x47c33c,_0x1b5f4d=function(){}){distribution['local']['store']['get'](_0x47c33c+'_map',(_0x59319a,_0x14ddd6)=>{if(!_0x59319a){let _0x4c3680=0x5fe+-0x2603+0x2005;_0x14ddd6['forEach'](_0x14a7c5=>{const [_0x22412e]=Object['keys'](_0x14a7c5);distribution[_0x4a816f]['mem']['put'](_0x14a7c5[_0x22412e],{'key':_0x22412e,'action':'append'},(_0x9c6a9b,_0x3afd32)=>{_0x4c3680++,_0x4c3680==_0x14ddd6['length']&&_0x1b5f4d(null,_0x14ddd6);});});}else _0x1b5f4d(_0x59319a,{});});},'reduce':function(_0xeeee1f,_0x17c32a,_0x21d61e){distribution['local']['mem']['get']({'key':null,'gid':_0xeeee1f},(_0x5677ed,_0x2057e4)=>{let _0x3e95cc=[],_0x4ca1b2=0x250*0xc+-0x24b5+0x8f5;_0x2057e4['length']==0x136*-0xd+-0xd62+0x1d20&&_0x21d61e(null,null),_0x2057e4['forEach'](_0x1e3bc0=>distribution['local']['mem']['get']({'key':_0x1e3bc0,'gid':_0xeeee1f},(_0x5a2fad,_0x17234d)=>{const _0x24272a=this['reducer'](_0x1e3bc0,_0x17234d);_0x3e95cc=_0x3e95cc['concat'](_0x24272a),_0x4ca1b2++,_0x4ca1b2==_0x2057e4['length']&&_0x21d61e(null,_0x3e95cc);}));});}},_0x20bb11=function(_0x1842ed,_0x37d2d4){const _0x36b480={};return Object['keys'](_0x37d2d4)['forEach'](_0x571a84=>{_0x36b480[_0x571a84]=[];}),_0x1842ed['forEach'](_0x169228=>{const _0x30d5c5=id['getID'](_0x169228),_0x53b5b2=id['naiveHash'](_0x30d5c5,Object['keys'](_0x37d2d4));_0x36b480[_0x53b5b2]['push'](_0x169228);}),_0x36b480;};distribution[_0x6c6004['gid']]['routes']['put'](_0x5b2961,'mr-'+_0x45fd82,(_0x2eaba0,_0x28a5c1)=>{distribution['local']['groups']['get'](_0x6c6004['gid'],(_0x2c64b3,_0x4092af)=>{const _0x45cdf2=_0x20bb11(_0x2aa17d['keys'],_0x4092af);let _0xe9489d=0x2634+-0xe78*0x1+-0x17bc;const _0x12d003=Object['keys'](_0x4092af)['length'],_0x3d12e5={'service':'mr-'+_0x45fd82,'method':'map'};for(const _0x3e246e in _0x4092af){_0x3d12e5['node']=_0x4092af[_0x3e246e];const _0xaccd98=[_0x45cdf2[_0x3e246e],_0x6c6004['gid'],_0x45fd82];distribution['local']['comm']['send'](_0xaccd98,_0x3d12e5,(_0x5f1fb4,_0x5d0dcb)=>{++_0xe9489d;if(_0xe9489d==_0x12d003){const _0x5a34c1={'service':'mr-'+_0x45fd82,'method':'shuffle'};distribution[_0x6c6004['gid']]['comm']['send']([_0x6c6004['gid'],_0x45fd82],_0x5a34c1,(_0x17e26c,_0x3f0000)=>{const _0x190e39={'service':'mr-'+_0x45fd82,'method':'reduce'};distribution[_0x6c6004['gid']]['comm']['send']([_0x6c6004['gid'],_0x45fd82],_0x190e39,(_0x35af5e,_0x112f24)=>{let _0xbdc3cf=[];for(const _0x434cc6 of Object['values'](_0x112f24)){_0x434cc6!==null&&(_0xbdc3cf=_0xbdc3cf['concat'](_0x434cc6));}_0x28f51e(null,_0xbdc3cf);return;distribution[_0x6c6004['gid']]['routes']['rem']('mr-'+_0x45fd82,(_0xa9864,_0x37a160)=>{});});});}});}});});}return{'exec':_0x2bd47b};};module['exports']=mr;
10
10
  /* eslint-enable */
@@ -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 routes=function(_0x4a10d6){let _0x1ec543={};return _0x1ec543['gid']=_0x4a10d6['gid']||'global',{'put':(_0x5e9850,_0x2d0889,_0x2bec70)=>{global['distributi'+'on'][_0x1ec543['gid']]['comm']['send']([_0x5e9850,_0x2d0889],{'service':'routes','method':'put'},_0x2bec70);},'rem':(_0x153c49,_0x5e95e8)=>{global['distributi'+'on'][_0x1ec543['gid']]['comm']['send']([_0x153c49],{'service':'routes','method':'rem'},_0x5e95e8);}};};module['exports']=routes;
9
+ function routes(_0x31dc7b){const _0x2cf96f={};_0x2cf96f['gid']=_0x31dc7b['gid']||'global';function _0x19bf63(_0x4531dd,_0x25452c,_0x350fc7=()=>{}){global['distributi'+'on'][_0x2cf96f['gid']]['comm']['send']([_0x4531dd,_0x25452c],{'service':'routes','method':'put'},_0x350fc7);}function _0x5185d1(_0x475546,_0x2cc92a,_0x42a3a6=()=>{}){global['distributi'+'on'][_0x2cf96f['gid']]['comm']['send']([_0x2cc92a],{'service':'routes','method':'rem'},_0x42a3a6);}return{'put':_0x19bf63,'rem':_0x5185d1};}module['exports']=routes;
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 status=function(_0x10e916){let _0x1a9d7f={};return _0x1a9d7f['gid']=_0x10e916['gid']||'global',{'get':(_0x19080f,_0xa09c20)=>{let _0x37276a=[_0x19080f],_0x24351b={'service':'status','method':'get'};global['distributi'+'on'][_0x1a9d7f['gid']]['comm']['send'](_0x37276a,_0x24351b,(_0x5ee7a3,_0x2fc89d)=>{switch(_0x19080f){case'heapTotal':let _0x476534=Object['values'](_0x2fc89d)['reduce']((_0x2bb271,_0x1c6692)=>{return _0x2bb271+_0x1c6692;},-0x1*0x240a+-0x1400+-0x957*-0x6);_0xa09c20(_0x5ee7a3,_0x476534);break;case'nid':let _0xac85e6=Object['values'](_0x2fc89d)['reduce']((_0x1d7179,_0x2cf423)=>{return _0x1d7179['concat'](_0x2cf423);},[]);_0xa09c20(_0x5ee7a3,_0xac85e6);break;default:_0xa09c20(_0x5ee7a3,_0x2fc89d);break;}});},'spawn':(_0x4dd9f2,_0x3fa0ed)=>{_0x3fa0ed=_0x3fa0ed||function(){},global['distributi'+'on']['local']['status']['spawn'](_0x4dd9f2,(_0x4a0fe6,_0x519888)=>{_0x4a0fe6?_0x3fa0ed(_0x4a0fe6):global['distributi'+'on']['local']['groups']['add'](_0x1a9d7f['gid'],_0x4dd9f2,()=>{_0x3fa0ed(null,_0x519888);}),distribution[_0x1a9d7f['gid']]['comm']['send']([_0x1a9d7f['gid'],_0x4dd9f2],{'service':'groups','method':'add'},()=>{});});},'stop':_0x431cb2=>{distribution[_0x1a9d7f['gid']]['comm']['send']([],{'service':'status','method':'stop'},_0x431cb2);}};};module['exports']=status;
9
+ const status=function(_0x2f9f6d){const _0x595f09={};return _0x595f09['gid']=_0x2f9f6d['gid']||'global',{'get':(_0x4db342,_0x50138c)=>{const _0x30e3b8=[_0x4db342],_0x417d50={'service':'status','method':'get'};global['distributi'+'on'][_0x595f09['gid']]['comm']['send'](_0x30e3b8,_0x417d50,(_0x3022e2,_0x1e2350)=>{switch(_0x4db342){case'heapTotal':const _0x5897f9=Object['values'](_0x1e2350)['reduce']((_0x29a1fd,_0x3f5cbb)=>{return _0x29a1fd+_0x3f5cbb;},-0xb0*-0x30+0x14d2+-0x35d2);_0x50138c(_0x3022e2,_0x5897f9);break;case'nid':const _0x319283=Object['values'](_0x1e2350)['reduce']((_0x2e3ed9,_0x337889)=>{return _0x2e3ed9['concat'](_0x337889);},[]);_0x50138c(_0x3022e2,_0x319283);break;default:_0x50138c(_0x3022e2,_0x1e2350);break;}});},'spawn':(_0x59acb8,_0x4e1380)=>{_0x4e1380=_0x4e1380||function(){},global['distributi'+'on']['local']['status']['spawn'](_0x59acb8,(_0x346449,_0x2ea56c)=>{_0x346449?_0x4e1380(_0x346449):global['distributi'+'on']['local']['groups']['add'](_0x595f09['gid'],_0x59acb8,()=>{_0x4e1380(null,_0x2ea56c);}),global['distributi'+'on'][_0x595f09['gid']]['comm']['send']([_0x595f09['gid'],_0x59acb8],{'service':'groups','method':'add'},()=>{});});},'stop':_0x2f11b1=>{global['distributi'+'on'][_0x595f09['gid']]['comm']['send']([],{'service':'status','method':'stop'},_0x2f11b1);}};};module['exports']=status;
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(_0xa0467f,_0x510f83,_0x2e2cbb){distribution[_0xa0467f['gid']]['status']['get']('nid',(_0x551d07,_0xb8508b)=>{let _0x576d79=Object['values'](_0xb8508b),_0x45deb4=util['id']['getID'](_0x510f83),_0x2bf5e4=_0xa0467f['hash'](_0x45deb4,_0x576d79),_0x1e0eb2=_0x2bf5e4['substring'](-0x3d*0x43+0x26b1+0x16ba*-0x1,-0x143*-0x1b+-0x2fd*0x2+-0x1c12);distribution['local']['groups']['get'](_0xa0467f['gid'],(_0x41d762,_0x5d0f54)=>{let _0x1ca477=_0x5d0f54[_0x1e0eb2];_0x2e2cbb(_0x1ca477);});});}const store=function(_0xee17b3){let _0x292db5={};return _0x292db5['gid']=_0xee17b3['gid']||'all',_0x292db5['hash']=_0xee17b3['hash']||util['id']['naiveHash'],{'get':(_0x3d7c00,_0x491ab9)=>{if(!_0x3d7c00){let _0x32bfe7=[{'key':null,'gid':_0x292db5['gid']}];distribution[_0x292db5['gid']]['comm']['send'](_0x32bfe7,{'service':'store','method':'get'},(_0x318e62,_0x192e66)=>{log('[all.store'+'.get\x20null\x20'+'given\x20as\x20k'+'ey.\x20keys:\x20'+JSON['stringify'](_0x192e66)+'\x20errors:\x20'+JSON['stringify'](_0x318e62));let _0x5e896b=Object['values'](_0x192e66)['reduce']((_0x4a725c,_0x1a85e2)=>_0x4a725c['concat'](_0x1a85e2),[]);_0x491ab9(_0x318e62,_0x5e896b);});return;}getNode(_0x292db5,_0x3d7c00,_0x72f87a=>{let _0x5e4b16=[{'key':_0x3d7c00,'gid':_0x292db5['gid']}],_0x539a83={'service':'store','method':'get','node':_0x72f87a};distribution['local']['comm']['send'](_0x5e4b16,_0x539a83,_0x491ab9);});},'put':(_0x3e40a2,_0x19844d,_0x3424ac)=>{_0x19844d=_0x19844d||util['id']['getID'](_0x3e40a2),getNode(_0x292db5,_0x19844d,_0x57bfb3=>{let _0x418353=[_0x3e40a2,{'key':_0x19844d,'gid':_0x292db5['gid']}],_0xbb8976={'service':'store','method':'put','node':_0x57bfb3};log('[all.store'+'.put]:\x20(gi'+'d:\x20'+_0x292db5['gid']+')\x20'+JSON['stringify'](_0x3e40a2)+'\x20'+JSON['stringify'](_0x19844d)+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x57bfb3)),distribution['local']['comm']['send'](_0x418353,_0xbb8976,_0x3424ac);});},'del':(_0x111e0b,_0x54f463)=>{getNode(_0x292db5,_0x111e0b,_0x5f298d=>{let _0x341abd=[{'key':_0x111e0b,'gid':_0x292db5['gid']}],_0x4ce73e={'service':'store','method':'del','node':_0x5f298d};distribution['local']['comm']['send'](_0x341abd,_0x4ce73e,_0x54f463);});},'reconf':(_0x386745,_0x23e325)=>{distribution[_0x292db5['gid']]['store']['get'](null,(_0x27f3c1,_0x32c3f0)=>{distribution[_0x292db5['gid']]['status']['get']('nid',(_0x18f2d9,_0x3f1917)=>{let _0x5c076b=Object['values'](_0x3f1917),_0xb6f65b=Object['values'](_0x386745)['map'](_0x2cd4db=>util['id']['getNID'](_0x2cd4db));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x32c3f0['length']+('\x20keys\x20from'+'\x20')+_0x3f1917['length']+'\x20nodes');let _0x2b4776=-0x1*-0x15fd+-0x91f+0xb7*-0x12;const _0x3e2050=()=>{_0x2b4776===_0x32c3f0['length']&&_0x23e325();};if(_0x32c3f0['length']===0xd9*-0x2d+0x1aff*-0x1+-0x16*-0x2f6){_0x23e325();return;}for(let _0x8a4c69 of _0x32c3f0){let _0x1dfe7e=util['id']['getID'](_0x8a4c69),_0x290ab5=_0x292db5['hash'](_0x1dfe7e,_0xb6f65b),_0x5b0c41=_0x292db5['hash'](_0x1dfe7e,_0x5c076b);log('[store.rec'+'onf\x20old\x20ni'+'d:\x20'+_0x290ab5+'\x20new\x20nid:\x20'+_0x5b0c41);if(_0x290ab5===_0x5b0c41){_0x2b4776++,_0x3e2050();continue;}let _0x3e1594=_0x386745[_0x290ab5['substring'](-0x12ce+0x14b*0x1d+0x57*-0x37,-0x119*0x9+0x25e2+0x954*-0x3)],_0x2f153d=[{'key':_0x8a4c69,'gid':_0x292db5['gid']}],_0x2a4c14={'service':'store','method':'del','node':_0x3e1594};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x8a4c69+'\x20from\x20'+JSON['stringify'](_0x2a4c14)),distribution['local']['comm']['send'](_0x2f153d,_0x2a4c14,(_0x25f526,_0x197d13)=>{distribution[_0x292db5['gid']]['store']['put'](_0x197d13,_0x8a4c69,(_0x21ecb9,_0x228777)=>{_0x2b4776++,_0x3e2050();});});}});});}};};module['exports']=store;
9
+ const distribution=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0x53648e,_0x3b2bb8,_0x41ef09){distribution[_0x53648e['gid']]['status']['get']('nid',(_0x1c1059,_0x3edfa4)=>{const _0x4ea753=Object['values'](_0x3edfa4),_0x187076=util['id']['getID'](_0x3b2bb8),_0x3a3c2b=_0x53648e['hash'](_0x187076,_0x4ea753),_0x407c8a=_0x3a3c2b['substring'](0x12b7+-0x14e9*-0x1+0x13d0*-0x2,0x8a9+-0x253f+-0x989*-0x3);distribution['local']['groups']['get'](_0x53648e['gid'],(_0x3e3f75,_0x2b5e51)=>{const _0x4f5cc1=_0x2b5e51[_0x407c8a];_0x41ef09(_0x4f5cc1);});});}const store=function(_0x4e4ec0){const _0x197a1a={};return _0x197a1a['gid']=_0x4e4ec0['gid']||'all',_0x197a1a['hash']=_0x4e4ec0['hash']||util['id']['naiveHash'],{'get':(_0xa906dd,_0x3ca1d3)=>{if(!_0xa906dd){const _0x2d2a59=[{'key':null,'gid':_0x197a1a['gid']}];distribution[_0x197a1a['gid']]['comm']['send'](_0x2d2a59,{'service':'store','method':'get'},(_0x2ed589,_0x375d9d)=>{log('[all.store'+'.get\x20null\x20'+'given\x20as\x20k'+'ey.\x20keys:\x20'+JSON['stringify'](_0x375d9d)+'\x20errors:\x20'+JSON['stringify'](_0x2ed589));const _0x1012e9=Object['values'](_0x375d9d)['reduce']((_0x243e88,_0x26ac89)=>_0x243e88['concat'](_0x26ac89),[]);_0x3ca1d3(_0x2ed589,_0x1012e9);});return;}getNode(_0x197a1a,_0xa906dd,_0x133f90=>{const _0x5ebaee=[{'key':_0xa906dd,'gid':_0x197a1a['gid']}],_0x3eeb9b={'service':'store','method':'get','node':_0x133f90};distribution['local']['comm']['send'](_0x5ebaee,_0x3eeb9b,_0x3ca1d3);});},'put':(_0x4d3563,_0x3b6ade,_0x505a1d)=>{_0x3b6ade=_0x3b6ade||util['id']['getID'](_0x4d3563),getNode(_0x197a1a,_0x3b6ade,_0x2affd0=>{const _0x56d97c=[_0x4d3563,{'key':_0x3b6ade,'gid':_0x197a1a['gid']}],_0x2bd4d5={'service':'store','method':'put','node':_0x2affd0};log('[all.store'+'.put]:\x20(gi'+'d:\x20'+_0x197a1a['gid']+')\x20'+JSON['stringify'](_0x4d3563)+'\x20'+JSON['stringify'](_0x3b6ade)+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x2affd0)),distribution['local']['comm']['send'](_0x56d97c,_0x2bd4d5,_0x505a1d);});},'del':(_0x3f51e6,_0x43084e)=>{getNode(_0x197a1a,_0x3f51e6,_0x74d061=>{const _0x413627=[{'key':_0x3f51e6,'gid':_0x197a1a['gid']}],_0x4e7f92={'service':'store','method':'del','node':_0x74d061};distribution['local']['comm']['send'](_0x413627,_0x4e7f92,_0x43084e);});},'reconf':(_0x46e3ce,_0xb743e2)=>{distribution[_0x197a1a['gid']]['store']['get'](null,(_0xc413ea,_0x227b58)=>{distribution[_0x197a1a['gid']]['status']['get']('nid',(_0x21701d,_0x330ed8)=>{const _0x3225c9=Object['values'](_0x330ed8),_0x4ba48a=Object['values'](_0x46e3ce)['map'](_0xfef2bd=>util['id']['getNID'](_0xfef2bd));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x227b58['length']+('\x20keys\x20from'+'\x20')+_0x330ed8['length']+'\x20nodes');let _0x32a5fa=0xb59+0x257f+-0xc*0x412;const _0xd8eced=()=>{_0x32a5fa===_0x227b58['length']&&_0xb743e2();};if(_0x227b58['length']===0x1d7d*0x1+-0x5ca+-0x17b3){_0xb743e2();return;}for(const _0x3ee72f of _0x227b58){const _0x4758c5=util['id']['getID'](_0x3ee72f),_0x3e2114=_0x197a1a['hash'](_0x4758c5,_0x4ba48a),_0x517751=_0x197a1a['hash'](_0x4758c5,_0x3225c9);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x3e2114+'\x20new\x20nid:\x20'+_0x517751);if(_0x3e2114===_0x517751){_0x32a5fa++,_0xd8eced();continue;}const _0x57e5ec=_0x46e3ce[_0x3e2114['substring'](0x15ff+-0x8e0*0x3+0x4a1,-0x1*0x170c+0x144e+0x2c3)],_0x461227=[{'key':_0x3ee72f,'gid':_0x197a1a['gid']}],_0x1eefb6={'service':'store','method':'del','node':_0x57e5ec};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x3ee72f+'\x20from\x20'+JSON['stringify'](_0x1eefb6)),distribution['local']['comm']['send'](_0x461227,_0x1eefb6,(_0x552827,_0x4f086f)=>{distribution[_0x197a1a['gid']]['store']['put'](_0x4f086f,_0x3ee72f,(_0x3b5bc3,_0x9ef8f5)=>{_0x32a5fa++,_0xd8eced();});});}});});}};};module['exports']=store;
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'),comm={};comm['send']=function(_0x20222e,_0x178670,_0x1f7971){log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x20222e)+'to\x20'+_0x178670['service']+':'+_0x178670['method']+'\x20on\x20'+_0x178670['node']['ip']+':'+_0x178670['node']['port']);if(!_0x20222e instanceof Array)throw new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray');let _0x2fbeb0=_0x178670['node'],_0xce7333=_0x178670['service'],_0x4c1e21=_0x178670['method'],_0x52546a=serialization['serialize'](_0x20222e);const _0x2e4d0a={'hostname':_0x2fbeb0['ip'],'port':_0x2fbeb0['port'],'path':'/'+_0xce7333+'/'+_0x4c1e21,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0x52546a)}},_0x3ec78a=http['request'](_0x2e4d0a,_0x5d18a5=>{let _0x152634='';_0x5d18a5['on']('data',function(_0x259772){_0x152634+=_0x259772;}),_0x5d18a5['on']('end',function(){_0x1f7971&&_0x1f7971(...serialization['deserializ'+'e'](_0x152634));}),_0x5d18a5['on']('error',function(_0x14ec87){_0x1f7971&&_0x1f7971(new Error('Error\x20on\x20r'+'esponse'));});});_0x3ec78a['on']('error',function(_0x3199f8){_0x1f7971&&_0x1f7971(new Error(_0x3199f8));}),_0x3ec78a['write'](_0x52546a),_0x3ec78a['end']();},module['exports']=comm;
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};
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 gossip={},messageStore={'messages':[],'push':function(_0x26d071){N=0x230a+0x55d+-0x285d,messageStore['messages']['push'](_0x26d071),messageStore['messages']['length']>N&&messageStore['messages']['shift']();},'has':function(_0x33111a){return messageStore['messages']['includes'](_0x33111a);}};gossip['recv']=function(_0x8be91c,_0x50c4b2){_0x50c4b2=_0x50c4b2||function(){};let _0x2356f6=_0x8be91c['message'],_0x5839c3=_0x8be91c['remote'],_0x3748be=_0x8be91c['mid'],_0x48d124=_0x8be91c['gid'];if(messageStore['has'](_0x3748be)){_0x50c4b2(new Error('Message\x20al'+'ready\x20rece'+'ived'));return;}global['distributi'+'on'][_0x48d124]['gossip']['send'](_0x8be91c,_0x5839c3),messageStore['push'](_0x3748be),_0x5839c3['node']={'ip':global['nodeConfig']['ip'],'port':global['nodeConfig']['port']},global['distributi'+'on']['local']['comm']['send'](_0x2356f6,_0x5839c3,(_0x38725f,_0x51ae4f)=>{_0x50c4b2(_0x38725f,_0x51ae4f);});},module['exports']=gossip;
9
+ const gossip={},messageStore={'messages':[],'push':function(_0x1e4a08){const _0x4131d1=0x1424+-0x1*0xb75+0x8a5*-0x1;messageStore['messages']['push'](_0x1e4a08),messageStore['messages']['length']>_0x4131d1&&messageStore['messages']['shift']();},'has':function(_0x4e4e3d){return messageStore['messages']['includes'](_0x4e4e3d);}};gossip['recv']=function(_0x3c47a2,_0x1564eb){_0x1564eb=_0x1564eb||function(){};const _0x5b434c=_0x3c47a2['message'],_0x47c1b9=_0x3c47a2['remote'],_0x2de7ac=_0x3c47a2['mid'],_0x239dc2=_0x3c47a2['gid'];if(messageStore['has'](_0x2de7ac)){_0x1564eb(new Error('Message\x20al'+'ready\x20rece'+'ived'));return;}global['distributi'+'on'][_0x239dc2]['gossip']['send'](_0x3c47a2,_0x47c1b9),messageStore['push'](_0x2de7ac),_0x47c1b9['node']={'ip':global['nodeConfig']['ip'],'port':global['nodeConfig']['port']},global['distributi'+'on']['local']['comm']['send'](_0x5b434c,_0x47c1b9,(_0xe1360c,_0x59c2c0)=>{_0x1564eb(_0xe1360c,_0x59c2c0);});},module['exports']=gossip;
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');let groupsStore=new Map();groupsStore['all']={};const groups={};groups['get']=function(_0x548145,_0x553b6a){_0x553b6a=_0x553b6a||function(){},_0x548145 in groupsStore?_0x553b6a(null,groupsStore[_0x548145]):_0x553b6a(new Error('Group\x20'+_0x548145+'\x20not\x20found'));},groups['put']=function(_0x222237,_0x403eb1,_0x5f19f1){_0x403eb1=_0x403eb1||{},typeof _0x222237==='string'&&(_0x222237={'gid':_0x222237}),groupsStore[_0x222237['gid']]=_0x403eb1,Object['keys'](_0x403eb1)['forEach'](_0xf06562=>{groupsStore['all'][id['getSID'](_0x403eb1[_0xf06562])]=_0x403eb1[_0xf06562];}),global['distributi'+'on'][_0x222237['gid']]={},global['distributi'+'on'][_0x222237['gid']]['status']=require('../all/sta'+'tus')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['comm']=require('../all/com'+'m')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['gossip']=require('../all/gos'+'sip')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['groups']=require('../all/gro'+'ups')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['routes']=require('../all/rou'+'tes')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['mem']=require('../all/mem')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['store']=require('../all/sto'+'re')(_0x222237),global['distributi'+'on'][_0x222237['gid']]['mr']=require('../all/mr')(_0x222237),_0x5f19f1(null,_0x403eb1);},groups['del']=function(_0x4a05ae,_0xe732f5){if(_0x4a05ae in groupsStore){let _0x15cebb=groupsStore[_0x4a05ae];delete groupsStore[_0x4a05ae],_0xe732f5(null,_0x15cebb);}else _0xe732f5(new Error('Group\x20'+_0x4a05ae+'\x20not\x20found'));},groups['add']=function(_0x3cd98c,_0x17f119,_0x1be392){_0x1be392=_0x1be392||function(){},_0x3cd98c in groupsStore?(!groupsStore[_0x3cd98c]&&(groupsStore[_0x3cd98c]={}),groupsStore[_0x3cd98c][id['getSID'](_0x17f119)]=_0x17f119,groupsStore['all'][id['getSID'](_0x17f119)]=_0x17f119,_0x1be392&&_0x1be392(null,groupsStore[_0x3cd98c])):_0x1be392&&_0x1be392(new Error('Group\x20'+_0x3cd98c+'\x20not\x20found'));},groups['rem']=function(_0x249426,_0x43fc84,_0x1d472e){_0x1d472e=_0x1d472e||function(){},_0x249426 in groupsStore?(delete groupsStore[_0x249426][_0x43fc84],delete groupsStore['all'][_0x43fc84],_0x1d472e(null,groupsStore[_0x249426])):_0x1d472e(new Error('Group\x20'+_0x249426+'\x20not\x20found'));},module['exports']=groups;
9
+ const id=require('../util/id'),groupsStore=new Map();groupsStore['all']={};const groups={};groups['get']=function(_0x4f24b4,_0x46442a){_0x46442a=_0x46442a||function(){},_0x4f24b4 in groupsStore?_0x46442a(null,groupsStore[_0x4f24b4]):_0x46442a(new Error('Group\x20'+_0x4f24b4+'\x20not\x20found'));},groups['put']=function(_0x5d6a20,_0x5979cf,_0x746bcf){_0x5979cf=_0x5979cf||{},typeof _0x5d6a20==='string'&&(_0x5d6a20={'gid':_0x5d6a20}),groupsStore[_0x5d6a20['gid']]=_0x5979cf,Object['keys'](_0x5979cf)['forEach'](_0x296273=>{groupsStore['all'][id['getSID'](_0x5979cf[_0x296273])]=_0x5979cf[_0x296273];}),global['distributi'+'on'][_0x5d6a20['gid']]={},global['distributi'+'on'][_0x5d6a20['gid']]['status']=require('../all/sta'+'tus')(_0x5d6a20),global['distributi'+'on'][_0x5d6a20['gid']]['comm']=require('../all/com'+'m')(_0x5d6a20),global['distributi'+'on'][_0x5d6a20['gid']]['gossip']=require('../all/gos'+'sip')(_0x5d6a20),global['distributi'+'on'][_0x5d6a20['gid']]['groups']=require('../all/gro'+'ups')(_0x5d6a20),global['distributi'+'on'][_0x5d6a20['gid']]['routes']=require('../all/rou'+'tes')(_0x5d6a20),global['distributi'+'on'][_0x5d6a20['gid']]['mem']=require('../all/mem')(_0x5d6a20),global['distributi'+'on'][_0x5d6a20['gid']]['store']=require('../all/sto'+'re')(_0x5d6a20),global['distributi'+'on'][_0x5d6a20['gid']]['mr']=require('../all/mr')(_0x5d6a20),_0x746bcf(null,_0x5979cf);},groups['del']=function(_0x14cfb8,_0x54cfe0){if(_0x14cfb8 in groupsStore){const _0x592791=groupsStore[_0x14cfb8];delete groupsStore[_0x14cfb8],_0x54cfe0(null,_0x592791);}else _0x54cfe0(new Error('Group\x20'+_0x14cfb8+'\x20not\x20found'));},groups['add']=function(_0x4c06d6,_0x2ac800,_0x256fa4){_0x256fa4=_0x256fa4||function(){},_0x4c06d6 in groupsStore?(!groupsStore[_0x4c06d6]&&(groupsStore[_0x4c06d6]={}),groupsStore[_0x4c06d6][id['getSID'](_0x2ac800)]=_0x2ac800,groupsStore['all'][id['getSID'](_0x2ac800)]=_0x2ac800,_0x256fa4&&_0x256fa4(null,groupsStore[_0x4c06d6])):_0x256fa4&&_0x256fa4(new Error('Group\x20'+_0x4c06d6+'\x20not\x20found'));},groups['rem']=function(_0x40e393,_0x3f6d29,_0x4ba908){_0x4ba908=_0x4ba908||function(){},_0x40e393 in groupsStore?(delete groupsStore[_0x40e393][_0x3f6d29],delete groupsStore['all'][_0x3f6d29],_0x4ba908(null,groupsStore[_0x40e393])):_0x4ba908(new Error('Group\x20'+_0x40e393+'\x20not\x20found'));},module['exports']=groups;
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'(_0x47199d){if(!this['store'][_0x47199d['gid']])return undefined;return this['store'][_0x47199d['gid']][_0x47199d['key']];},'put'(_0x3e896e,_0x29b433){!this['store'][_0x3e896e['gid']]&&(this['store'][_0x3e896e['gid']]=new Map()),this['store'][_0x3e896e['gid']][_0x3e896e['key']]=_0x29b433;},'append'(_0x1e74e1,_0x3f1af2){!this['get'](_0x1e74e1)&&this['put'](_0x1e74e1,[]),!Array['isArray'](this['get'](_0x1e74e1))&&this['put'](_0x1e74e1,[this['get'](_0x1e74e1)]),Array['isArray'](_0x3f1af2)?this['put'](_0x1e74e1,this['get'](_0x1e74e1)['concat'](_0x3f1af2)):this['store'][_0x1e74e1['gid']][_0x1e74e1['key']]['push'](_0x3f1af2);},'del'(_0x48426f){if(!this['store'][_0x48426f['gid']])return undefined;let _0x3feeed=this['store'][_0x48426f['gid']][_0x48426f['key']];return delete this['store'][_0x48426f['gid']][_0x48426f['key']],_0x3feeed;},'toString'(){let _0x46d2ee='';for(let _0x28bf17 in this['store']){_0x46d2ee+=_0x28bf17+':\x20'+JSON['stringify'](this['store'][_0x28bf17]);}return _0x46d2ee;}};function normalize(_0x2fc7d0){let _0x40af61={};_0x2fc7d0===null&&(_0x2fc7d0={});if(typeof _0x2fc7d0==='string')_0x40af61['key']=_0x2fc7d0,_0x40af61['gid']='local',_0x40af61['action']='put';else typeof _0x2fc7d0==='object'&&(_0x40af61['key']=_0x2fc7d0['key'],_0x40af61['gid']=_0x2fc7d0['gid'],_0x40af61['action']=_0x2fc7d0['action']);return _0x40af61;};const mem={};mem['put']=function(_0x365c29,_0x1eecc4,_0x5758ad){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x1eecc4)+'state:\x20'+JSON['stringify'](_0x365c29)+'\x20store:\x20'+kvStore['toString']()),_0x5758ad=_0x5758ad||function(){},_0x1eecc4=normalize(_0x1eecc4),_0x1eecc4['key']=_0x1eecc4['key']||id['getID'](_0x365c29),_0x1eecc4['gid']=_0x1eecc4['gid']||'local',_0x1eecc4['action']=_0x1eecc4['action']||'put',kvStore[_0x1eecc4['action']](_0x1eecc4,_0x365c29),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x5758ad&&_0x5758ad(null,_0x365c29);},mem['get']=function(_0x3fae4f,_0x481bad){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x3fae4f)+'\x20store:\x20'+kvStore['toString']()),_0x481bad=_0x481bad||function(){},_0x3fae4f=normalize(_0x3fae4f),_0x3fae4f['gid']=_0x3fae4f['gid']||'local';if(!_0x3fae4f['key']){let _0x447c41=kvStore['store'][_0x3fae4f['gid']]||{};_0x447c41=Object['keys'](_0x447c41),_0x481bad(null,_0x447c41);return;}let _0x4edd56=kvStore['get'](_0x3fae4f);_0x4edd56?_0x481bad(null,_0x4edd56):_0x481bad(new Error('Memory\x20key'+'\x20\x22'+_0x3fae4f['key']+('\x22\x20\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20not\x20found'+'\x20for\x20')+_0x3fae4f['gid']+'\x27s\x20store'));},mem['del']=function(_0x471de6,_0x176fba){_0x176fba=_0x176fba||function(){},_0x471de6=normalize(_0x471de6);let _0x1cda6d=kvStore['del'](_0x471de6);_0x1cda6d?_0x176fba(null,_0x1cda6d):_0x176fba(new Error('Memory\x20key'+'\x20\x22'+_0x471de6['key']+('\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'not\x20found\x20'+'for\x20')+_0x471de6['gid']+'\x27s\x20store'));},module['exports']=mem;
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;
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(_0x3c90ba){error=undefined;if(_0x3c90ba['length']===0x1e00+0x45*0x79+-0x3e9d)return new Error('No\x20body');try{_0x3c90ba=JSON['parse'](_0x3c90ba);}catch(_0x143a6d){return _0x143a6d;}return error;}function endRequest(_0x278750,_0x4a1a1c){_0x278750['end'](serialization['serialize']([_0x4a1a1c]));}const start=function(_0x4f1000){const _0x594358=http['createServ'+'er']((_0x152767,_0x371f1d)=>{if(_0x152767['method']!=='PUT'){_0x371f1d['end'](serialization['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const _0x5a24fd=url['parse'](_0x152767['url'])['pathname'],[,_0x26b13c,_0x2bd55b]=_0x5a24fd['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x26b13c+':'+_0x2bd55b);let _0x5a5a2a=[];_0x152767['on']('data',_0x36ab9e=>{_0x5a5a2a['push'](_0x36ab9e);}),_0x152767['on']('end',()=>{_0x5a5a2a=Buffer['concat'](_0x5a5a2a)['toString']();let _0x397d30;if(_0x397d30=isValidBody(_0x5a5a2a)){endRequest(_0x371f1d,_0x397d30);return;}_0x5a5a2a=JSON['parse'](_0x5a5a2a),_0x5a5a2a=serialization['deserializ'+'e'](_0x5a5a2a);let _0x381627=_0x5a5a2a;!Array['isArray'](_0x381627)&&endRequest(_0x371f1d,new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x381627));let _0x4805d4=_0x26b13c;global['distributi'+'on']['local']['routes']['get'](_0x4805d4,(_0x251e82,_0x4dbc9e)=>{const _0x1c8904=(_0x41cbed,_0x4b0d9c)=>{_0x371f1d['end'](serialization['serialize']([_0x41cbed,_0x4b0d9c]));};if(_0x251e82){_0x1c8904(_0x251e82);return;}if(!_0x4dbc9e[_0x2bd55b]){_0x1c8904(new Error('Method\x20'+_0x2bd55b+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x4805d4));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x4805d4+':'+_0x2bd55b+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x381627));_0x381627['length']===0x7d6+0x263*0x1+0x28e*-0x4&&_0x4dbc9e[_0x2bd55b]['length']===0x661+-0xf20+0x8c2&&_0x381627['push'](undefined);try{_0x4dbc9e[_0x2bd55b](..._0x381627,_0x1c8904);}catch(_0x2e8cd2){_0x1c8904(_0x2e8cd2);}});});});_0x594358['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']=_0x594358,_0x4f1000(_0x594358);}),_0x594358['on']('error',_0x2fe70b=>{log('Server\x20err'+'or:\x20'+_0x2fe70b);throw _0x2fe70b;});};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(_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};
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(),routes={};routes['get']=function(_0x54cf11,_0x9f8b89){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+_0x54cf11);if(!_0x9f8b89)return;if(_0x54cf11 in routesStore){log('[routes.ge'+'t]\x20Found\x20s'+'ervice:\x20'+_0x54cf11);let _0x496928=routesStore[_0x54cf11];_0x9f8b89(null,_0x496928);}else{const _0x47bcb1=global['toLocal']['get'](_0x54cf11);_0x47bcb1?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x54cf11),_0x9f8b89(null,{'call':_0x47bcb1})):_0x9f8b89(new Error('Service\x20'+_0x54cf11+('\x20not\x20found'+'\x20in\x20routes')));}},routes['put']=function(_0x2a8029,_0x44cb25,_0x27e418){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x44cb25),routesStore[_0x44cb25]=_0x2a8029;_0x27e418&&_0x27e418(null,_0x44cb25);;},routes['rem']=function(_0x384448,_0x7a207b){const _0x491714=routesStore[_0x384448];delete routesStore[_0x384448],_0x7a207b(null,_0x491714);},module['exports']=routes;
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};
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'),status={};global['moreStatus']={'sid':id['getSID'](global['nodeConfig']),'nid':id['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(_0x7619b7,_0x473632){_0x473632=_0x473632||function(){};if(_0x7619b7 in global['nodeConfig'])_0x473632(null,global['nodeConfig'][_0x7619b7]);else{if(_0x7619b7 in moreStatus)_0x473632(null,moreStatus[_0x7619b7]);else{if(_0x7619b7==='heapTotal')_0x473632(null,process['memoryUsag'+'e']()['heapTotal']);else _0x7619b7==='heapUsed'?_0x473632(null,process['memoryUsag'+'e']()['heapUsed']):_0x473632(new Error('Status\x20key'+'\x20not\x20found'));}}};const path=require('path'),{spawn}=require('child_proc'+'ess'),wire=require('../util/wi'+'re'),createSpawnedCb=function(_0x557908,_0x2e82f0){let _0x6ce769='\x0a\x20\x20\x20\x20let\x20o'+'nStart\x20=\x20'+_0x557908['toString']()+(';\x0a\x0a\x20\x20\x20\x20let'+'\x20callbackR'+'PC\x20=\x20')+wire['createRPC'](wire['toAsync'](_0x2e82f0))['toString']()+(';\x0a\x0a\x20\x20\x20\x20try'+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20onStart()'+';\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'callbackRP'+'C(null,\x20gl'+'obal.nodeC'+'onfig,\x20()\x20'+'=>\x20{});\x0a\x20\x20'+'\x20\x20}\x0a\x20\x20\x20\x20ca'+'tch\x20(e)\x20{\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20ca'+'llbackRPC('+'e,\x20null,\x20('+')\x20=>\x20{});\x0a'+'\x20\x20\x20\x20}\x0a\x20\x20\x20\x20');return new Function(_0x6ce769);};status['spawn']=function(_0x572632,_0xb8c0e){const _0x189c6d=_0x572632;_0x189c6d['onStart']=_0x189c6d['onStart']||function(){};if(!_0x189c6d['port']||!_0x189c6d['ip']){_0xb8c0e(new Error('Port\x20and\x20I'+'P\x20are\x20requ'+'ired\x20in\x20th'+'e\x20configur'+'ation'));return;}log('[status.sp'+'awn]\x20Spawn'+'ing\x20node\x20w'+'ith\x20config'+'uration:\x20'+JSON['stringify'](_0x189c6d)),_0x189c6d['onStart']=createSpawnedCb(_0x189c6d['onStart'],_0xb8c0e);const _0x548ee3=path['join'](__dirname,'../../dist'+'ribution.j'+'s');let _0x24e7f3=spawn('node',[_0x548ee3,'--config',global['distributi'+'on']['util']['serialize'](_0x189c6d)],{'detached':!![],'stdio':'inherit'});_0x24e7f3;},status['stop']=function(_0x3569c7){_0x3569c7=_0x3569c7||function(){},_0x3569c7(null,global['nodeConfig']),log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),global['distributi'+'on']['node']['server']['close'](),process['exit'](-0xcb5*0x3+0x115f+0x14c0);},module['exports']=status;
9
+ const id=require('../util/id'),log=require('../util/lo'+'g'),status={};global['moreStatus']={'sid':id['getSID'](global['nodeConfig']),'nid':id['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(_0x1be8dc,_0x4c0a93){_0x4c0a93=_0x4c0a93||function(){};if(_0x1be8dc in global['nodeConfig']){_0x4c0a93(null,global['nodeConfig'][_0x1be8dc]);return;}if(_0x1be8dc in global['moreStatus']){_0x4c0a93(null,global['moreStatus'][_0x1be8dc]);return;}if(_0x1be8dc==='heapTotal'){_0x4c0a93(null,process['memoryUsag'+'e']()['heapTotal']);return;}if(_0x1be8dc==='heapUsed'){_0x4c0a93(null,process['memoryUsag'+'e']()['heapUsed']);return;}_0x4c0a93(new Error('Status\x20key'+'\x20not\x20found'));};const path=require('path'),{spawn}=require('child_proc'+'ess'),wire=require('../util/wi'+'re'),createSpawnedCb=function(_0x2879fd,_0x27dd3e){const _0x14c6a3='\x0a\x20\x20\x20\x20let\x20o'+'nStart\x20=\x20'+_0x2879fd['toString']()+(';\x0a\x0a\x20\x20\x20\x20let'+'\x20callbackR'+'PC\x20=\x20')+wire['createRPC'](wire['toAsync'](_0x27dd3e))['toString']()+(';\x0a\x0a\x20\x20\x20\x20try'+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20onStart()'+';\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'callbackRP'+'C(null,\x20gl'+'obal.nodeC'+'onfig,\x20()\x20'+'=>\x20{});\x0a\x20\x20'+'\x20\x20}\x0a\x20\x20\x20\x20ca'+'tch\x20(e)\x20{\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20ca'+'llbackRPC('+'e,\x20null,\x20('+')\x20=>\x20{});\x0a'+'\x20\x20\x20\x20}\x0a\x20\x20\x20\x20');return new Function(_0x14c6a3);};status['spawn']=function(_0x20a828,_0x1e970c){const _0x428b72=_0x20a828;_0x428b72['onStart']=_0x428b72['onStart']||function(){};if(!_0x428b72['port']||!_0x428b72['ip']){_0x1e970c(new Error('Port\x20and\x20I'+'P\x20are\x20requ'+'ired\x20in\x20th'+'e\x20configur'+'ation'));return;}log('[status.sp'+'awn]\x20Spawn'+'ing\x20node\x20w'+'ith\x20config'+'uration:\x20'+JSON['stringify'](_0x428b72)),_0x428b72['onStart']=createSpawnedCb(_0x428b72['onStart'],_0x1e970c);const _0x50ef78=path['join'](__dirname,'../../dist'+'ribution.j'+'s'),_0x4b345b=spawn('node',[_0x50ef78,'--config',global['distributi'+'on']['util']['serialize'](_0x428b72)],{'detached':!![],'stdio':'inherit'});_0x4b345b;},status['stop']=function(_0x1c7ed2){_0x1c7ed2=_0x1c7ed2||function(){},_0x1c7ed2(null,global['nodeConfig']),log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),global['distributi'+'on']['node']['server']['close'](),process['exit'](0x11*0x10b+-0x1*-0x2335+-0x34f0);},module['exports']=status;
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(_0x2649f8){let _0x332f66={};_0x2649f8===null&&(_0x2649f8={});if(typeof _0x2649f8==='string')_0x332f66['key']=_0x2649f8,_0x332f66['gid']='local';else typeof _0x2649f8==='object'&&(_0x332f66['key']=_0x2649f8['key'],_0x332f66['gid']=_0x2649f8['gid']);return _0x332f66;};const store={};store['put']=function(_0x4f6c88,_0x5e215c,_0x525bcf){_0x525bcf=_0x525bcf||function(){},_0x5e215c=normalize(_0x5e215c),_0x5e215c['key']=_0x5e215c['key']||id['getID'](_0x4f6c88),_0x5e215c['gid']=_0x5e215c['gid']||'local';let _0x14fdde=serialization['serialize'](_0x4f6c88),_0x1c82d9=Buffer['from'](_0x5e215c['key'])['toString']('base64');_0x1c82d9=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x5e215c['gid']+'-'+_0x1c82d9,log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x5e215c)+'\x20state:\x20'+JSON['stringify'](_0x4f6c88)+('\x20filename:'+'\x20')+_0x1c82d9),fs['writeFile'](_0x1c82d9,_0x14fdde,_0x29afdb=>{_0x29afdb?_0x525bcf(_0x29afdb):_0x525bcf(null,_0x4f6c88);});},store['get']=function(_0x9cf68f,_0x5d4053){_0x5d4053=_0x5d4053||function(){},_0x9cf68f=normalize(_0x9cf68f),_0x9cf68f['gid']=_0x9cf68f['gid']||'local';if(!_0x9cf68f['key']){fs['readdir'](baseFolder+'/s-'+global['moreStatus']['sid'],(_0x20edbf,_0x145336)=>{if(_0x20edbf)_0x5d4053(_0x20edbf);else{let _0x34823c=[];for(let _0x4ead2d=-0x10*-0x15b+-0x3*-0x8e7+-0x3065;_0x4ead2d<_0x145336['length'];_0x4ead2d++){let _0x339642=_0x145336[_0x4ead2d]['split']('-'),_0x231ca0=_0x339642[-0x5*-0x595+-0x1*0x471+-0x1778];if(_0x231ca0!==_0x9cf68f['gid'])continue;_0x339642=_0x339642[_0x339642['length']-(0x1f06+0x2*0xe5+-0x20cf)],_0x34823c['push'](Buffer['from'](_0x339642,'base64')['toString']());}_0x5d4053(null,_0x34823c);}});return;}let _0x2730b9=Buffer['from'](_0x9cf68f['key'])['toString']('base64');_0x2730b9=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x9cf68f['gid']+'-'+_0x2730b9,log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x9cf68f)+('\x20filename:'+'\x20')+_0x2730b9),fs['exists'](_0x2730b9,_0x463fe9=>{if(!_0x463fe9){_0x5d4053(new Error('File\x20'+_0x2730b9+('\x20(from\x20key'+'\x20\x27')+_0x9cf68f['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x9cf68f['gid']));return;}fs['readFile'](_0x2730b9,(_0x1c1fa6,_0x515946)=>{if(!_0x5d4053)return;_0x1c1fa6?_0x5d4053(_0x1c1fa6):(_0x515946=_0x515946['toString'](),_0x5d4053(null,serialization['deserializ'+'e'](_0x515946)));});});},store['del']=function(_0x21915c,_0x5d2562){_0x5d2562=_0x5d2562||function(){},_0x21915c=normalize(_0x21915c);let _0x56e6d4=Buffer['from'](_0x21915c['key'])['toString']('base64');_0x56e6d4=baseFolder+'/s-'+global['moreStatus']['sid']+'/'+_0x21915c['gid']+'-'+_0x56e6d4,fs['exists'](_0x56e6d4,_0x3cebe4=>{if(!_0x3cebe4){_0x5d2562(new Error('File\x20'+_0x56e6d4+('\x20not\x20found'+'\x20for\x20group'+'\x0a')+_0x21915c['gid']));return;}store['get'](_0x21915c,(_0x210eca,_0x3f35d3)=>{fs['rm'](_0x56e6d4,function(_0x5121b8){_0x5121b8?_0x5d2562(_0x5121b8):_0x5d2562(null,_0x3f35d3);});});});},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(_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;
10
10
  /* eslint-enable */
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+
3
+ /*
4
+ ATTENTION: This is an obfuscated file. You do not need to understand it.
5
+ Do NOT edit this file directly. Use it as a black box.
6
+
7
+ If you notice any issues with using this file, please contact the TAs.
8
+ */
9
+ module['exports']={};
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 assert=require('assert');let crypto=require('crypto');function getID(_0x5f31f2){const _0x53d207=crypto['createHash']('sha256');return _0x53d207['update'](JSON['stringify'](_0x5f31f2)),_0x53d207['digest']('hex');}function getNID(_0x28fe04){return _0x28fe04={'ip':_0x28fe04['ip'],'port':_0x28fe04['port']},getID(_0x28fe04);}function getSID(_0x21c20a){return getNID(_0x21c20a)['substring'](-0x1dd9+0x6d*0x34+0x7b5*0x1,0x98*0x12+0x1c7e+-0x2729);}function getMID(_0x33aab6){let _0x3e1b97={};return _0x3e1b97['date']=new Date()['getTime'](),_0x3e1b97['mss']=_0x33aab6,getID(_0x3e1b97);}function idToNum(_0x15d192){let _0x1d34f5=parseInt(_0x15d192,0x2*-0xfe5+0x7a8*0x1+-0x13*-0x146);return assert(!isNaN(_0x1d34f5),'idToNum:\x20i'+'d\x20is\x20not\x20i'+'n\x20KID\x20form'+'!'),_0x1d34f5;}function naiveHash(_0x1d5cb4,_0x3f1012){return _0x3f1012['sort'](),_0x3f1012[idToNum(_0x1d5cb4)%_0x3f1012['length']];}function consistentHash(_0x4e5f45,_0x5746ab){const _0x538c24=idToNum(_0x4e5f45),_0x3c7afa=_0x5746ab['map'](_0x1c1f69=>({'id':_0x1c1f69,'hash':idToNum(_0x1c1f69)}));_0x3c7afa['sort']((_0x21fce7,_0x48bc19)=>_0x21fce7['hash']-_0x48bc19['hash']);for(let _0x49d72d of _0x3c7afa){if(_0x538c24<=_0x49d72d['hash'])return _0x49d72d['id'];}return _0x3c7afa[-0x212c+0xdd8*-0x2+0x5*0xc2c]['id'];}function rendezvousHash(_0x453121,_0x15d6f4){let _0x173513=-0x42b+-0x1*0x2425+-0x35c*-0xc,_0x42d640=null;for(let _0x57f925 of _0x15d6f4){let _0x358aec=getID(_0x453121+_0x57f925),_0x49e5b3=idToNum(_0x358aec);_0x49e5b3>_0x173513&&(_0x173513=_0x49e5b3,_0x42d640=_0x57f925);}return _0x42d640;}module['exports']={'getID':getID,'getNID':getNID,'getSID':getSID,'getMID':getMID,'naiveHash':naiveHash,'consistentHash':consistentHash,'rendezvousHash':rendezvousHash};
9
+ const assert=require('assert'),crypto=require('crypto');function getID(_0x52341b){const _0x59b66f=crypto['createHash']('sha256');return _0x59b66f['update'](JSON['stringify'](_0x52341b)),_0x59b66f['digest']('hex');}function getNID(_0x2ae07f){return _0x2ae07f={'ip':_0x2ae07f['ip'],'port':_0x2ae07f['port']},getID(_0x2ae07f);}function getSID(_0x2e1ad9){return getNID(_0x2e1ad9)['substring'](0x54*-0xb+-0x22fa+0x2696,-0xf72+0x65*0x4c+-0x3b*0x3f);}function getMID(_0x3840d9){const _0x3aa0ea={};return _0x3aa0ea['date']=new Date()['getTime'](),_0x3aa0ea['mss']=_0x3840d9,getID(_0x3aa0ea);}function idToNum(_0x139ae0){const _0x4fb52d=parseInt(_0x139ae0,0x1be8+0x299+-0x1e71);return assert(!isNaN(_0x4fb52d),'idToNum:\x20i'+'d\x20is\x20not\x20i'+'n\x20KID\x20form'+'!'),_0x4fb52d;}function naiveHash(_0x4a2873,_0x2e7f55){return _0x2e7f55['sort'](),_0x2e7f55[idToNum(_0x4a2873)%_0x2e7f55['length']];}function consistentHash(_0xf1a8b2,_0xf51d33){const _0x1f47ab=idToNum(_0xf1a8b2),_0x40f0eb=_0xf51d33['map'](_0x227427=>({'id':_0x227427,'hash':idToNum(_0x227427)}));_0x40f0eb['sort']((_0x27a4b4,_0x2d2fe3)=>_0x27a4b4['hash']-_0x2d2fe3['hash']);for(const _0x6d5287 of _0x40f0eb){if(_0x1f47ab<=_0x6d5287['hash'])return _0x6d5287['id'];}return _0x40f0eb[-0xa*-0x10d+0xf0d*-0x2+-0x1a2*-0xc]['id'];}function rendezvousHash(_0x5e6bfd,_0xb7706b){let _0x2c278b=0x230b+-0x2*-0x95b+0x5f9*-0x9,_0x36b636=null;for(const _0x36340a of _0xb7706b){const _0x4088b9=getID(_0x5e6bfd+_0x36340a),_0x51b44b=idToNum(_0x4088b9);_0x51b44b>_0x2c278b&&(_0x2c278b=_0x51b44b,_0x36b636=_0x36340a);}return _0x36b636;}module['exports']={'getID':getID,'getNID':getNID,'getSID':getSID,'getMID':getMID,'naiveHash':naiveHash,'consistentHash':consistentHash,'rendezvousHash':rendezvousHash};
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
- let nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){let _0x78886f=[];function _0x481640(_0x494534,_0x55e734){if(_0x55e734===null||_0x55e734===undefined)return;if(_0x78886f['indexOf'](_0x55e734)!==-(-0x14ce+-0x2018+0x34e7))return;_0x78886f['push'](_0x55e734),Object['getOwnProp'+'ertyNames'](_0x55e734)['forEach'](_0x34f75a=>{if(typeof _0x55e734[_0x34f75a]==='function'){nativeFunctions['forward']['set'](_0x55e734[_0x34f75a],_0x494534+'.'+_0x34f75a),nativeFunctions['reverse']['set'](_0x494534+'.'+_0x34f75a,_0x55e734[_0x34f75a]);return;}typeof _0x55e734[_0x34f75a]==='object'&&_0x78886f['indexOf'](_0x55e734[_0x34f75a])===-(0x1690+-0x726+-0xf69)&&_0x481640(_0x494534+'.'+_0x34f75a,_0x55e734[_0x34f75a]);});}const _0x236e46=require('fs'),_0xc96ba7=require('http'),_0x545d58=require('https'),_0x174b38=require('url'),_0x491993=require('path'),_0x52753b=require('os'),_0x5c6551=require('events'),_0xe98b43=require('stream'),_0x50fa70=require('util'),_0x26706c=require('querystrin'+'g'),_0x30af04=require('zlib'),_0x546c76=require('buffer'),_0x1b3074=require('child_proc'+'ess'),_0x2582fa=require('cluster'),_0xdc8b37=require('dgram'),_0x5895c4=require('dns'),_0x1c3420=require('http2'),_0x456a17=require('v8');_0x481640('globalThis',globalThis),_0x481640('fs',_0x236e46),_0x481640('http',_0xc96ba7),_0x481640('https',_0x545d58),_0x481640('url',_0x174b38),_0x481640('path',_0x491993),_0x481640('os',_0x52753b),_0x481640('events',_0x5c6551),_0x481640('stream',_0xe98b43),_0x481640('util',_0x50fa70),_0x481640('querystrin'+'g',_0x26706c),_0x481640('zlib',_0x30af04),_0x481640('buffer',_0x546c76),_0x481640('child_proc'+'ess',_0x1b3074),_0x481640('cluster',_0x2582fa),_0x481640('dgram',_0xdc8b37),_0x481640('dns',_0x5895c4),_0x481640('http2',_0x1c3420),_0x481640('v8',_0x456a17);}createNativeMap();function decycleObject(_0x5806cb){if(_0x5806cb===null||_0x5806cb===undefined)return _0x5806cb;let _0x41e355=new WeakMap();function _0x13f3f4(_0x2379a7,_0x3a393c){let _0x47d5e2,_0x51c566;if(!(typeof _0x2379a7==='object'&&!(_0x2379a7 instanceof Error)&&!(_0x2379a7 instanceof Date)&&!(_0x2379a7 instanceof Boolean)&&_0x2379a7!==null))return _0x2379a7;_0x47d5e2=_0x41e355['get'](_0x2379a7);if(_0x47d5e2!==undefined)return{'$reference':_0x47d5e2};return _0x41e355['set'](_0x2379a7,_0x3a393c),Array['isArray'](_0x2379a7)?(_0x51c566=[],_0x2379a7['forEach'](function(_0x285e8a,_0x52d14d){let _0x529d34=[..._0x3a393c,_0x52d14d];_0x51c566[_0x52d14d]=_0x13f3f4(_0x285e8a,_0x529d34);})):(_0x51c566={},Object['keys'](_0x2379a7)['forEach'](_0x1286a9=>{let _0xcfe30b=[..._0x3a393c,JSON['stringify'](_0x1286a9)];_0x51c566[_0x1286a9]=_0x13f3f4(_0x2379a7[_0x1286a9],_0xcfe30b);})),_0x51c566;}return _0x13f3f4(_0x5806cb,[]);};function serializeBaseStructure(_0x87c286){return{'type':typeof _0x87c286,'value':_0x87c286['toString']()};}function serializeUndefined(_0x24c99e){return{'type':'undefined','value':''};}function getObjectSubType(_0xe8693d){if(_0xe8693d instanceof Array)return'array';if(_0xe8693d instanceof Date)return'date';if(_0xe8693d instanceof Error)return'error';if(_0xe8693d===null)return'null';return'object';}function serializeObject(_0x20b4da){let _0x4af325=getObjectSubType(_0x20b4da);if(_0x4af325==='null')return{'type':_0x4af325,'value':''};if(_0x4af325==='date')return{'type':_0x4af325,'value':_0x20b4da['toJSON']()};if(_0x4af325==='error')return{'type':_0x4af325,'value':serializeObject({'name':_0x20b4da['name'],'message':_0x20b4da['message'],'cause':_0x20b4da['cause']})};function _0x316e73(_0x6e80b8){return Object['keys'](_0x6e80b8)['length']==-0xb*0x92+0x2287+-0x1c40&&Object['keys'](_0x6e80b8)[-0x13a0+-0xf11+0x22b1]=='$reference';}if(_0x316e73(_0x20b4da))return{'type':'reference','value':_0x20b4da['$reference']};let _0x25922f={};for(const [_0x775ec8,_0x55cc6d]of Object['entries'](_0x20b4da)){_0x25922f[_0x775ec8]=serialize(_0x55cc6d);}return{'type':_0x4af325,'value':_0x25922f};}function serializeFunction(_0x4ec2f8){if(nativeFunctions['forward']['has'](_0x4ec2f8))return{'type':'native','value':nativeFunctions['forward']['get'](_0x4ec2f8)};return{'type':'function','value':_0x4ec2f8['toString']()};}function serialize(_0x4204f2){_0x4204f2=decycleObject(_0x4204f2);let _0x1132d7;switch(typeof _0x4204f2){case'object':_0x1132d7=serializeObject(_0x4204f2);break;case'function':_0x1132d7=serializeFunction(_0x4204f2);break;case'undefined':_0x1132d7=serializeUndefined(_0x4204f2);break;case'number':case'string':case'boolean':_0x1132d7=serializeBaseStructure(_0x4204f2);break;}return JSON['stringify'](_0x1132d7);}function deserializeObject(_0x40faab,_0xc7aa51){for(const [_0xcf3fee,_0x342c6d]of Object['entries'](_0x40faab)){_0xc7aa51[_0xcf3fee]=doSerialize(_0x342c6d,_0xc7aa51);}return _0xc7aa51;}function deserializeArray(_0x29b8ce,_0xfcfd8f){for(const [_0x38d3ae,_0x17951f]of Object['entries'](_0x29b8ce)){_0xfcfd8f[_0x38d3ae]=doSerialize(_0x17951f,_0xfcfd8f);}return _0xfcfd8f;}function deserializeString(_0x3255af){return _0x3255af;}function deserializeNumber(_0x20ef42){return Number(_0x20ef42);}function deserializeFunction(_0x4fdb27){return new Function('return\x20'+_0x4fdb27)();}function deserializeError(_0x5932a0){let _0x41c977=doSerialize(_0x5932a0),_0x2d6377=new Error(_0x41c977['message'],_0x41c977['cause']);return _0x2d6377;}function deserializeReference(_0xae71a9,_0x304212){let _0xb1d769=_0x304212;for(let _0x50fc4e of _0xae71a9){_0x50fc4e=JSON['parse'](_0x50fc4e),_0xb1d769=_0xb1d769[_0x50fc4e];}return _0xb1d769;}function deserializeNative(_0x3f3709){return nativeFunctions['reverse']['get'](_0x3f3709);}function doSerialize(_0x369282,_0x1d6b52=null){let _0x5e7893;if(typeof _0x369282==='object')_0x5e7893=_0x369282;else{if(typeof _0x369282==='string')_0x5e7893=JSON['parse'](_0x369282);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x369282+'.');}_0x1d6b52===null&&(_0x1d6b52={});switch(_0x5e7893['type']){case'object':_0x1d6b52=deserializeObject(_0x5e7893['value'],{});break;case'array':_0x1d6b52=deserializeArray(_0x5e7893['value'],[]);break;case'function':_0x1d6b52=deserializeFunction(_0x5e7893['value']);break;case'native':_0x1d6b52=deserializeNative(_0x5e7893['value']);break;case'reference':_0x1d6b52=deserializeReference(_0x5e7893['value'],_0x1d6b52);break;case'number':_0x1d6b52=deserializeNumber(_0x5e7893['value']);break;case'string':_0x1d6b52=deserializeString(_0x5e7893['value']);break;case'boolean':_0x1d6b52=_0x5e7893['value']==='true';break;case'date':_0x1d6b52=new Date(_0x5e7893['value']);break;case'error':_0x1d6b52=deserializeError(_0x5e7893['value']);break;case'null':_0x1d6b52=null;break;case'undefined':_0x1d6b52=undefined;break;}return _0x1d6b52;}function deserialize(_0x489291){return doSerialize(_0x489291);}module['exports']={'serialize':serialize,'deserialize':deserialize};
9
+ const nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){const _0xc6d8f=[];function _0x2fb7ce(_0x11977c,_0x5de529){if(_0x5de529===null||_0x5de529===undefined)return;if(_0xc6d8f['indexOf'](_0x5de529)!==-(0xbef+-0xa3f+-0x1*0x1af))return;_0xc6d8f['push'](_0x5de529),Object['getOwnProp'+'ertyNames'](_0x5de529)['forEach'](_0x295632=>{if(typeof _0x5de529[_0x295632]==='function'){nativeFunctions['forward']['set'](_0x5de529[_0x295632],_0x11977c+'.'+_0x295632),nativeFunctions['reverse']['set'](_0x11977c+'.'+_0x295632,_0x5de529[_0x295632]);return;}typeof _0x5de529[_0x295632]==='object'&&_0xc6d8f['indexOf'](_0x5de529[_0x295632])===-(-0x21f0+0x128f*-0x1+-0x18*-0x230)&&_0x2fb7ce(_0x11977c+'.'+_0x295632,_0x5de529[_0x295632]);});}const _0x54302c=require('fs'),_0x2600b2=require('http'),_0x57e596=require('https'),_0x56d74f=require('url'),_0x1fb2b2=require('path'),_0x50ed0a=require('os'),_0x558728=require('events'),_0x1dadfd=require('stream'),_0x4e7b48=require('util'),_0x4f7dd6=require('querystrin'+'g'),_0x37aa3e=require('zlib'),_0x3b507b=require('buffer'),_0x1bc678=require('child_proc'+'ess'),_0x1b2558=require('cluster'),_0x5452cf=require('dgram'),_0x2b307c=require('dns'),_0x25a2a9=require('http2'),_0x4eb107=require('v8');_0x2fb7ce('globalThis',global['globalThis']),_0x2fb7ce('fs',_0x54302c),_0x2fb7ce('http',_0x2600b2),_0x2fb7ce('https',_0x57e596),_0x2fb7ce('url',_0x56d74f),_0x2fb7ce('path',_0x1fb2b2),_0x2fb7ce('os',_0x50ed0a),_0x2fb7ce('events',_0x558728),_0x2fb7ce('stream',_0x1dadfd),_0x2fb7ce('util',_0x4e7b48),_0x2fb7ce('querystrin'+'g',_0x4f7dd6),_0x2fb7ce('zlib',_0x37aa3e),_0x2fb7ce('buffer',_0x3b507b),_0x2fb7ce('child_proc'+'ess',_0x1bc678),_0x2fb7ce('cluster',_0x1b2558),_0x2fb7ce('dgram',_0x5452cf),_0x2fb7ce('dns',_0x2b307c),_0x2fb7ce('http2',_0x25a2a9),_0x2fb7ce('v8',_0x4eb107);}createNativeMap();function decycleObject(_0x1157f4){if(_0x1157f4===null||_0x1157f4===undefined)return _0x1157f4;const _0x3a1ee0=new WeakMap();function _0x11a17a(_0x31b5b1,_0x3ef205){let _0xa7393f;if(!(typeof _0x31b5b1==='object'&&!(_0x31b5b1 instanceof Error)&&!(_0x31b5b1 instanceof Date)&&!(_0x31b5b1 instanceof Boolean)&&_0x31b5b1!==null))return _0x31b5b1;const _0x3f8b9b=_0x3a1ee0['get'](_0x31b5b1);if(_0x3f8b9b!==undefined)return{'$reference':_0x3f8b9b};return _0x3a1ee0['set'](_0x31b5b1,_0x3ef205),Array['isArray'](_0x31b5b1)?(_0xa7393f=[],_0x31b5b1['forEach'](function(_0x38034f,_0x4469cc){const _0x112129=[..._0x3ef205,_0x4469cc];_0xa7393f[_0x4469cc]=_0x11a17a(_0x38034f,_0x112129);})):(_0xa7393f={},Object['keys'](_0x31b5b1)['forEach'](_0x3b360a=>{const _0x1a3045=[..._0x3ef205,JSON['stringify'](_0x3b360a)];_0xa7393f[_0x3b360a]=_0x11a17a(_0x31b5b1[_0x3b360a],_0x1a3045);})),_0xa7393f;}return _0x11a17a(_0x1157f4,[]);};function serializeBaseStructure(_0x52c553){return{'type':typeof _0x52c553,'value':_0x52c553['toString']()};}function serializeUndefined(_0x3466ec){return{'type':'undefined','value':''};}function getObjectSubType(_0x914276){if(_0x914276 instanceof Array)return'array';if(_0x914276 instanceof Date)return'date';if(_0x914276 instanceof Error)return'error';if(_0x914276===null)return'null';return'object';}function serializeObject(_0x596dbe){const _0x2edff4=getObjectSubType(_0x596dbe);if(_0x2edff4==='null')return{'type':_0x2edff4,'value':''};if(_0x2edff4==='date')return{'type':_0x2edff4,'value':_0x596dbe['toJSON']()};if(_0x2edff4==='error')return{'type':_0x2edff4,'value':serializeObject({'name':_0x596dbe['name'],'message':_0x596dbe['message'],'cause':_0x596dbe['cause']})};function _0xec9fcd(_0x346d1e){return Object['keys'](_0x346d1e)['length']==0x1c22+0x6a*-0x35+0x1*-0x62f&&Object['keys'](_0x346d1e)[-0x4ff+0x48e*-0x8+0x296f]=='$reference';}if(_0xec9fcd(_0x596dbe))return{'type':'reference','value':_0x596dbe['$reference']};const _0x14a448={};for(const [_0x251b82,_0x296244]of Object['entries'](_0x596dbe)){_0x14a448[_0x251b82]=serialize(_0x296244);}return{'type':_0x2edff4,'value':_0x14a448};}function serializeFunction(_0x514058){if(nativeFunctions['forward']['has'](_0x514058))return{'type':'native','value':nativeFunctions['forward']['get'](_0x514058)};return{'type':'function','value':_0x514058['toString']()};}function serialize(_0x4950fb){_0x4950fb=decycleObject(_0x4950fb);let _0xfb1c0f;switch(typeof _0x4950fb){case'object':_0xfb1c0f=serializeObject(_0x4950fb);break;case'function':_0xfb1c0f=serializeFunction(_0x4950fb);break;case'undefined':_0xfb1c0f=serializeUndefined(_0x4950fb);break;case'number':case'string':case'boolean':_0xfb1c0f=serializeBaseStructure(_0x4950fb);break;}return JSON['stringify'](_0xfb1c0f);}function deserializeObject(_0x1f7b43,_0xec1817){for(const [_0x35812e,_0x336a3c]of Object['entries'](_0x1f7b43)){_0xec1817[_0x35812e]=doSerialize(_0x336a3c,_0xec1817);}return _0xec1817;}function deserializeArray(_0x3a6a51,_0x549fd1){for(const [_0x5046cd,_0x2c5037]of Object['entries'](_0x3a6a51)){_0x549fd1[_0x5046cd]=doSerialize(_0x2c5037,_0x549fd1);}return _0x549fd1;}function deserializeString(_0xf8e884){return _0xf8e884;}function deserializeNumber(_0x1898ec){return Number(_0x1898ec);}function deserializeFunction(_0x1a63b1){return new Function('return\x20'+_0x1a63b1)();}function deserializeError(_0x52f2e3){const _0x41c220=doSerialize(_0x52f2e3),_0x5389ad=new Error(_0x41c220['message'],_0x41c220['cause']);return _0x5389ad;}function deserializeReference(_0xa9cbc5,_0x3208d6){let _0x495475=_0x3208d6;for(let _0xffa868 of _0xa9cbc5){_0xffa868=JSON['parse'](_0xffa868),_0x495475=_0x495475[_0xffa868];}return _0x495475;}function deserializeNative(_0x1c691c){return nativeFunctions['reverse']['get'](_0x1c691c);}function doSerialize(_0x58bc8a,_0x4085a3=null){let _0x421f14;if(typeof _0x58bc8a==='object')_0x421f14=_0x58bc8a;else{if(typeof _0x58bc8a==='string')_0x421f14=JSON['parse'](_0x58bc8a);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x58bc8a+'.');}_0x4085a3===null&&(_0x4085a3={});switch(_0x421f14['type']){case'object':_0x4085a3=deserializeObject(_0x421f14['value'],{});break;case'array':_0x4085a3=deserializeArray(_0x421f14['value'],[]);break;case'function':_0x4085a3=deserializeFunction(_0x421f14['value']);break;case'native':_0x4085a3=deserializeNative(_0x421f14['value']);break;case'reference':_0x4085a3=deserializeReference(_0x421f14['value'],_0x4085a3);break;case'number':_0x4085a3=deserializeNumber(_0x421f14['value']);break;case'string':_0x4085a3=deserializeString(_0x421f14['value']);break;case'boolean':_0x4085a3=_0x421f14['value']==='true';break;case'date':_0x4085a3=new Date(_0x421f14['value']);break;case'error':_0x4085a3=deserializeError(_0x421f14['value']);break;case'null':_0x4085a3=null;break;case'undefined':_0x4085a3=undefined;break;}return _0x4085a3;}function deserialize(_0x109993){return doSerialize(_0x109993);}module['exports']={'serialize':serialize,'deserialize':deserialize};
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'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n');global['toLocal']=new Map();function createRPC(_0x3fc100){let _0x569f9d=id['getID'](serialization['serialize'](_0x3fc100));global['toLocal']['set'](_0x569f9d,_0x3fc100);let _0x26b8d3='\x0a\x20\x20\x20\x20const'+'\x20callback\x20'+'=\x20args.pop'+'();\x0a\x0a\x20\x20\x20\x20l'+'et\x20remote\x20'+'=\x20{node:\x20'+JSON['stringify'](global['nodeConfig'])+(',\x20service:'+'\x20\x27')+_0x569f9d+('\x27,\x20method:'+'\x20\x27call\x27};\x0a'+'\x20\x20\x20\x20let\x20me'+'ssage\x20=\x20ar'+'gs;\x0a\x0a\x20\x20\x20\x20d'+'istributio'+'n.local.co'+'mm.send(me'+'ssage,\x20rem'+'ote,\x20(erro'+'r,\x20respons'+'e)\x20=>\x20{\x0a\x20\x20'+'\x20\x20\x20\x20if\x20(er'+'ror)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(error)'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'else\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(null,\x20'+'response);'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20});\x0a\x20\x20');return log('Created\x20RP'+'C\x20with\x20id:'+'\x20'+_0x569f9d),new Function('...args',_0x26b8d3);}function toAsync(_0x3514dc){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x3514dc['name']+':\x20'+_0x3514dc['toString']()['replace'](/\n/g,'|'));const _0x51cb4e=(..._0x41d44d)=>{const _0x10d035=_0x41d44d['pop']();try{const _0x4b6b5c=_0x3514dc(..._0x41d44d);_0x10d035(null,_0x4b6b5c);}catch(_0x3e3ac5){_0x10d035(_0x3e3ac5);}};return _0x51cb4e['toString']=()=>_0x3514dc['toString'](),_0x51cb4e;}module['exports']={'createRPC':createRPC,'toAsync':toAsync};
9
+ const log=require('../util/lo'+'g'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n');global['toLocal']=new Map();function createRPC(_0x521b25){const _0x3d33fc=id['getID'](serialization['serialize'](_0x521b25));global['toLocal']['set'](_0x3d33fc,_0x521b25);let _0x493fc9='\x0a\x20\x20\x20\x20const'+'\x20callback\x20'+'=\x20args.pop'+'();\x0a\x0a\x20\x20\x20\x20l'+'et\x20remote\x20'+'=\x20{node:\x20'+JSON['stringify'](global['nodeConfig'])+(',\x20service:'+'\x20\x27')+_0x3d33fc+('\x27,\x20method:'+'\x20\x27call\x27};\x0a'+'\x20\x20\x20\x20let\x20me'+'ssage\x20=\x20ar'+'gs;\x0a\x0a\x20\x20\x20\x20d'+'istributio'+'n.local.co'+'mm.send(me'+'ssage,\x20rem'+'ote,\x20(erro'+'r,\x20respons'+'e)\x20=>\x20{\x0a\x20\x20'+'\x20\x20\x20\x20if\x20(er'+'ror)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(error)'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'else\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(null,\x20'+'response);'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20});\x0a\x20\x20');return log('Created\x20RP'+'C\x20with\x20id:'+'\x20'+_0x3d33fc),new Function('...args',_0x493fc9);}function toAsync(_0x925086){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x925086['name']+':\x20'+_0x925086['toString']()['replace'](/\n/g,'|'));const _0x2b1f62=(..._0x418dea)=>{const _0x242eb0=_0x418dea['pop']();try{const _0x3858f6=_0x925086(..._0x418dea);_0x242eb0(null,_0x3858f6);}catch(_0x5aaed4){_0x242eb0(_0x5aaed4);}};return _0x2b1f62['toString']=()=>_0x925086['toString'](),_0x2b1f62;}module['exports']={'createRPC':createRPC,'toAsync':toAsync};
10
10
  /* eslint-enable */
package/distribution.js CHANGED
@@ -29,7 +29,7 @@ if (args.port) {
29
29
  }
30
30
 
31
31
  if (args.config) {
32
- let nodeConfig = util.deserialize(args.config);
32
+ const nodeConfig = util.deserialize(args.config);
33
33
  global.nodeConfig.ip = nodeConfig.ip ? nodeConfig.ip : global.nodeConfig.ip;
34
34
  global.nodeConfig.port = nodeConfig.port ?
35
35
  nodeConfig.port : global.nodeConfig.port;
@@ -51,7 +51,7 @@ distribution.util = require('./distribution/util/util.js');
51
51
  distribution.local = require('./distribution/local/local.js');
52
52
  distribution.node = require('./distribution/local/node.js');
53
53
 
54
- for (let key in distribution.local) {
54
+ for (const key in distribution.local) {
55
55
  distribution.local.routes.put(distribution.local[key], key);
56
56
  }
57
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "scripts": {
17
17
  "pretest": "./scripts/pretest.sh",
18
- "test": "jest --maxWorkers=1",
18
+ "test": "./scripts/test.sh",
19
19
  "build": "./scripts/publish.sh",
20
20
  "lint": "eslint --ignore-path .gitignore --config .eslintrc . --fix"
21
21
  },