@brown-ds/distribution 0.1.18 → 0.1.19

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 log=require('../util/lo'+'g');function getNode(_0x3ac292,_0x1d2ed4,_0x315152){typeof _0x1d2ed4==='object'&&(_0x1d2ed4=_0x1d2ed4['key']),global['distributi'+'on'][_0x3ac292['gid']]['status']['get']('nid',(_0x158d8a,_0xedcb32)=>{const _0x6f5a63=Object['values'](_0xedcb32),_0x1f7669=global['distributi'+'on']['util']['id']['getID'](_0x1d2ed4),_0x33c989=_0x3ac292['hash'](_0x1f7669,_0x6f5a63),_0x5a973f=_0x33c989['substring'](0x1e82+0x358+-0x4d6*0x7,0xb*-0xb7+0x19c3+0x11e1*-0x1);global['distributi'+'on']['local']['groups']['get'](_0x3ac292['gid'],(_0x2d2fe5,_0x3419ca)=>{const _0x360f11=_0x3419ca[_0x5a973f];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x1d2ed4)+'group:\x20'+JSON['stringify'](_0x3419ca)+'\x20node:\x20'+JSON['stringify'](_0x360f11)+'nid:\x20'+JSON['stringify'](_0x33c989)+'\x20sid:\x20'+JSON['stringify'](_0x5a973f)),_0x315152(_0x360f11);});});}function normalize(_0x17494b,_0x1fedc4){const _0x4a04c7={};_0x17494b===null&&(_0x17494b={});if(typeof _0x17494b==='string')_0x4a04c7['key']=_0x17494b,_0x4a04c7['gid']=_0x1fedc4,_0x4a04c7['action']='put';else typeof _0x17494b==='object'&&(_0x4a04c7['key']=_0x17494b['key'],_0x4a04c7['gid']=_0x17494b['gid']||_0x1fedc4,_0x4a04c7['action']=_0x17494b['action']||'put');return _0x4a04c7;};function mem(_0x43de2f){const _0x56c810={};return _0x56c810['gid']=_0x43de2f['gid']||'all',_0x56c810['hash']=_0x43de2f['hash']||global['distributi'+'on']['util']['id']['naiveHash'],{'get':(_0x1a9046,_0x5bcd16)=>{if(!_0x1a9046){const _0x261fd2=[{'key':null,'gid':_0x56c810['gid']}];global['distributi'+'on'][_0x56c810['gid']]['comm']['send'](_0x261fd2,{'service':'mem','method':'get'},(_0x31534c,_0x5270d0)=>{const _0x8e3144=Object['values'](_0x5270d0)['reduce']((_0x510818,_0xa4bccf)=>_0x510818['concat'](_0xa4bccf),[]);_0x5bcd16(_0x31534c,_0x8e3144);});return;}_0x1a9046=normalize(_0x1a9046,_0x56c810['gid']),getNode(_0x56c810,_0x1a9046,_0x340d90=>{const _0x5468b3=[_0x1a9046],_0x37300e={'service':'mem','method':'get','node':_0x340d90};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x1a9046)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x340d90)),global['distributi'+'on']['local']['comm']['send'](_0x5468b3,_0x37300e,_0x5bcd16);});},'put':(_0x4edcda,_0x13a371,_0x55080f)=>{_0x13a371=_0x13a371||global['distributi'+'on']['util']['id']['getID'](_0x4edcda),_0x13a371=normalize(_0x13a371,_0x56c810['gid']),getNode(_0x56c810,_0x13a371,_0x4d29bf=>{const _0x1c8c89=[_0x4edcda,_0x13a371],_0x399f1d={'service':'mem','method':'put','node':_0x4d29bf};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x4edcda)+('configurat'+'ion:\x20')+JSON['stringify'](_0x13a371)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x4d29bf)),global['distributi'+'on']['local']['comm']['send'](_0x1c8c89,_0x399f1d,_0x55080f);});},'del':(_0x2a9e48,_0x38b525)=>{getNode(_0x56c810,_0x2a9e48,_0x14669d=>{const _0x3c224a=[{'key':_0x2a9e48,'gid':_0x56c810['gid']}],_0x16c9f5={'service':'mem','method':'del','node':_0x14669d};global['distributi'+'on']['local']['comm']['send'](_0x3c224a,_0x16c9f5,_0x38b525);});},'reconf':(_0xf1bd05,_0xb3bc1c)=>{global['distributi'+'on'][_0x56c810['gid']]['mem']['get'](null,(_0x568572,_0x2e9a75)=>{global['distributi'+'on'][_0x56c810['gid']]['status']['get']('nid',(_0x455575,_0x59da2a)=>{const _0x52e00a=Object['values'](_0x59da2a),_0xfb18b0=Object['values'](_0xf1bd05)['map'](_0x183043=>global['distributi'+'on']['util']['id']['getNID'](_0x183043));log('[mem.recon'+'f\x20received'+'\x20'+_0x2e9a75['length']+('\x20keys\x20from'+'\x20')+_0x59da2a['length']+'\x20nodes');let _0x256f9b=-0xffa*-0x1+0x260f+-0x3609;const _0xcd0d46=()=>{_0x256f9b===_0x2e9a75['length']&&_0xb3bc1c();};if(_0x2e9a75['length']===0x4*0x8b1+0x1*-0x1f0c+-0x2*0x1dc){_0xb3bc1c();return;}for(const _0x254dff of _0x2e9a75){const _0x604a18=global['distributi'+'on']['util']['id']['getID'](_0x254dff),_0x5d4fa8=_0x56c810['hash'](_0x604a18,_0xfb18b0),_0x4ec856=_0x56c810['hash'](_0x604a18,_0x52e00a);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x5d4fa8+'\x20new\x20nid:\x20'+_0x4ec856);if(_0x5d4fa8===_0x4ec856){_0x256f9b++,_0xcd0d46();continue;}const _0x41f7eb=_0xf1bd05[_0x5d4fa8['substring'](0xb3+-0x1*0xebb+-0x382*-0x4,-0x6*-0x275+-0x1b4d+0xc94)],_0x4229ee=[{'key':_0x254dff,'gid':_0x56c810['gid']}],_0x1e063b={'service':'mem','method':'del','node':_0x41f7eb};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x254dff+'\x20from\x20'+JSON['stringify'](_0x1e063b)),global['distributi'+'on']['local']['comm']['send'](_0x4229ee,_0x1e063b,(_0x418360,_0x1009ce)=>{global['distributi'+'on'][_0x56c810['gid']]['mem']['put'](_0x1009ce,_0x254dff,(_0x641d25,_0x96fc42)=>{_0x256f9b++,_0xcd0d46();});});}});});}};};module['exports']=mem;
9
+ const log=require('../util/lo'+'g');function getNode(_0x111c3c,_0xa9948c,_0xc3dd54){typeof _0xa9948c==='object'&&(_0xa9948c=_0xa9948c['key']),global['distributi'+'on'][_0x111c3c['gid']]['status']['get']('nid',(_0x18d379,_0x261442)=>{const _0x5e0440=Object['values'](_0x261442),_0x3397dc=global['distributi'+'on']['util']['id']['getID'](_0xa9948c),_0x3c226d=_0x111c3c['hash'](_0x3397dc,_0x5e0440),_0x40c654=_0x3c226d['substring'](0x140b+0x1a7*0x11+0xca*-0x3d,0xab7*0x1+0x447*-0x7+0x133f);global['distributi'+'on']['local']['groups']['get'](_0x111c3c['gid'],(_0x4018df,_0xc7ce06)=>{const _0x39da56=_0xc7ce06[_0x40c654];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0xa9948c)+'group:\x20'+JSON['stringify'](_0xc7ce06)+'\x20node:\x20'+JSON['stringify'](_0x39da56)+'nid:\x20'+JSON['stringify'](_0x3c226d)+'\x20sid:\x20'+JSON['stringify'](_0x40c654)),_0xc3dd54(_0x39da56);});});}function normalize(_0x541312,_0x2bbfc8){const _0x1f1576={};_0x541312===null&&(_0x541312={});if(typeof _0x541312==='string')_0x1f1576['key']=_0x541312,_0x1f1576['gid']=_0x2bbfc8,_0x1f1576['action']='put';else typeof _0x541312==='object'&&(_0x1f1576['key']=_0x541312['key'],_0x1f1576['gid']=_0x541312['gid']||_0x2bbfc8,_0x1f1576['action']=_0x541312['action']||'put');return _0x1f1576;};function mem(_0x2a6eef){const _0x5936df={};return _0x5936df['gid']=_0x2a6eef['gid']||'all',_0x5936df['hash']=_0x2a6eef['hash']||global['distributi'+'on']['util']['id']['naiveHash'],{'get':(_0x2b3a80,_0x2313c9)=>{if(!_0x2b3a80){const _0x55a4bd=[{'key':null,'gid':_0x5936df['gid']}];global['distributi'+'on'][_0x5936df['gid']]['comm']['send'](_0x55a4bd,{'service':'mem','method':'get'},(_0x5210dc,_0x5285f1)=>{const _0x562538=Object['values'](_0x5285f1)['reduce']((_0x1fce90,_0xf5b981)=>_0x1fce90['concat'](_0xf5b981),[]);_0x2313c9(_0x5210dc,_0x562538);});return;}_0x2b3a80=normalize(_0x2b3a80,_0x5936df['gid']),getNode(_0x5936df,_0x2b3a80,_0x88428c=>{const _0x1799a8=[_0x2b3a80],_0x4e40a8={'service':'mem','method':'get','node':_0x88428c};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x2b3a80)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x88428c)),global['distributi'+'on']['local']['comm']['send'](_0x1799a8,_0x4e40a8,_0x2313c9);});},'put':(_0x29f53f,_0x505ad7,_0x47f532)=>{_0x505ad7=_0x505ad7||global['distributi'+'on']['util']['id']['getID'](_0x29f53f),_0x505ad7=normalize(_0x505ad7,_0x5936df['gid']),getNode(_0x5936df,_0x505ad7,_0x59dedd=>{const _0x5c9cad=[_0x29f53f,_0x505ad7],_0x4ff479={'service':'mem','method':'put','node':_0x59dedd};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x29f53f)+('configurat'+'ion:\x20')+JSON['stringify'](_0x505ad7)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x59dedd)),global['distributi'+'on']['local']['comm']['send'](_0x5c9cad,_0x4ff479,_0x47f532);});},'del':(_0x3b333b,_0x71fcd8)=>{getNode(_0x5936df,_0x3b333b,_0x3ed0ca=>{const _0x121508=[{'key':_0x3b333b,'gid':_0x5936df['gid']}],_0x3a2c7f={'service':'mem','method':'del','node':_0x3ed0ca};global['distributi'+'on']['local']['comm']['send'](_0x121508,_0x3a2c7f,_0x71fcd8);});},'reconf':(_0x391133,_0xbbb31e)=>{log('[mem.recon'+'f]\x20configu'+'ration:\x20'+JSON['stringify'](_0x391133)+'\x20gid:\x20'+_0x5936df['gid']),global['distributi'+'on']['local']['groups']['get'](_0x5936df['gid'],(_0x211621,_0x548a2c)=>{global['distributi'+'on']['local']['groups']['put'](_0x5936df['gid'],_0x391133,(_0x37c8f7,_0xbd0007)=>{global['distributi'+'on'][_0x5936df['gid']]['mem']['get'](null,(_0x23848d,_0x43218e)=>{global['distributi'+'on']['local']['groups']['put'](_0x5936df['gid'],_0x548a2c,(_0x59b1cf,_0x38b439)=>{global['distributi'+'on'][_0x5936df['gid']]['status']['get']('nid',(_0x428317,_0x3e436e)=>{const _0x3d6258=Object['values'](_0x3e436e),_0x1c1bfe=Object['values'](_0x391133)['map'](_0x42df17=>global['distributi'+'on']['util']['id']['getNID'](_0x42df17));log('[mem.recon'+'f\x20received'+'\x20'+_0x43218e['length']+('\x20keys\x20from'+'\x20')+_0x3e436e['length']+'\x20nodes');let _0x24186a=0xbd7+0x1ba9+-0x2780;const _0x1af374=()=>{_0x24186a===_0x43218e['length']&&_0xbbb31e();};if(_0x43218e['length']===0xe0b*0x2+-0x3c*-0x31+-0x2792){_0xbbb31e();return;}for(const _0x2c5404 of _0x43218e){const _0x27a536=global['distributi'+'on']['util']['id']['getID'](_0x2c5404),_0x16d7f8=_0x5936df['hash'](_0x27a536,_0x1c1bfe),_0x2a9707=_0x5936df['hash'](_0x27a536,_0x3d6258);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x16d7f8+'\x20new\x20nid:\x20'+_0x2a9707);if(_0x16d7f8===_0x2a9707){_0x24186a++,_0x1af374();continue;}const _0x296cb9=_0x391133[_0x16d7f8['substring'](0xdf5+-0x5*0x607+0x102e,-0x1ca8+0x2*0xee6+-0x11f)],_0x552db6=[{'key':_0x2c5404,'gid':_0x5936df['gid']}],_0x417f4a={'service':'mem','method':'del','node':_0x296cb9};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x2c5404+'\x20from\x20'+JSON['stringify'](_0x417f4a)),global['distributi'+'on']['local']['comm']['send'](_0x552db6,_0x417f4a,(_0x178310,_0x1261fa)=>{global['distributi'+'on'][_0x5936df['gid']]['mem']['put'](_0x1261fa,_0x2c5404,(_0x55017c,_0x2de173)=>{_0x24186a++,_0x1af374();});});}});});});});});}};};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 status=function(_0x361efc){const _0x53485f={};return _0x53485f['gid']=_0x361efc['gid']||'all',{'get':(_0x486e4d,_0x166577)=>{const _0x2202e4=[_0x486e4d],_0x2031b2={'service':'status','method':'get'};global['distributi'+'on'][_0x53485f['gid']]['comm']['send'](_0x2202e4,_0x2031b2,(_0x4bd946,_0x5c9923)=>{switch(_0x486e4d){case'heapTotal':const _0x32b8e5=Object['values'](_0x5c9923)['reduce']((_0x88d14a,_0x19f390)=>{return _0x88d14a+_0x19f390;},-0x1561+0x420+0x1141);_0x166577(_0x4bd946,_0x32b8e5);break;case'nid':const _0x17b9ad=Object['values'](_0x5c9923)['reduce']((_0x4aa102,_0x30d543)=>{return _0x4aa102['concat'](_0x30d543);},[]);_0x166577(_0x4bd946,_0x17b9ad);break;default:_0x166577(_0x4bd946,_0x5c9923);break;}});},'spawn':(_0x1a4792,_0x1807e0)=>{_0x1807e0=_0x1807e0||function(){},global['distributi'+'on']['local']['status']['spawn'](_0x1a4792,(_0x1b39e2,_0x5e57a4)=>{_0x1b39e2?_0x1807e0(_0x1b39e2):global['distributi'+'on']['local']['groups']['add'](_0x53485f['gid'],_0x1a4792,()=>{_0x1807e0(null,_0x5e57a4);}),global['distributi'+'on'][_0x53485f['gid']]['comm']['send']([_0x53485f['gid'],_0x1a4792],{'service':'groups','method':'add'},()=>{});});},'stop':_0x532f5e=>{global['distributi'+'on'][_0x53485f['gid']]['comm']['send']([],{'service':'status','method':'stop'},_0x532f5e);}};};module['exports']=status;
9
+ const status=function(_0x1e3b46){const _0x3b1b54={};return _0x3b1b54['gid']=_0x1e3b46['gid']||'all',{'get':(_0xc7f557,_0x30190d)=>{const _0x3e3351=[_0xc7f557],_0x6d04b1={'service':'status','method':'get'};global['distributi'+'on'][_0x3b1b54['gid']]['comm']['send'](_0x3e3351,_0x6d04b1,(_0x738f8,_0xed0db9)=>{switch(_0xc7f557){case'heapTotal':const _0x349f74=Object['values'](_0xed0db9)['reduce']((_0x36089f,_0x232364)=>{return _0x36089f+_0x232364;},0x8d1*0x1+0x1dbd*0x1+-0x7b6*0x5);_0x30190d(_0x738f8,_0x349f74);break;case'nid':const _0x3b4cf1=Object['values'](_0xed0db9)['reduce']((_0x14780c,_0x32de0a)=>{return _0x14780c['concat'](_0x32de0a);},[]);_0x30190d(_0x738f8,_0x3b4cf1);break;default:_0x30190d(_0x738f8,_0xed0db9);break;}});},'spawn':(_0x528840,_0x1fbc49)=>{_0x1fbc49=_0x1fbc49||function(){},global['distributi'+'on']['local']['status']['spawn'](_0x528840,(_0x19d3d4,_0x39ecdd)=>{_0x19d3d4?_0x1fbc49(_0x19d3d4):global['distributi'+'on']['local']['groups']['add'](_0x3b1b54['gid'],_0x528840,()=>{_0x1fbc49(null,_0x39ecdd);}),global['distributi'+'on'][_0x3b1b54['gid']]['comm']['send']([_0x3b1b54['gid'],_0x528840],{'service':'groups','method':'add'},()=>{});});},'stop':_0x13f4f2=>{global['distributi'+'on'][_0x3b1b54['gid']]['comm']['send']([],{'service':'status','method':'stop'},()=>{global['distributi'+'on']['local']['status']['stop'](_0x13f4f2);});}};};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 log=require('../util/lo'+'g');function getNode(_0x4e17be,_0x36ca18,_0x1a1744){global['distributi'+'on'][_0x4e17be['gid']]['status']['get']('nid',(_0x45715c,_0x4ae44d)=>{const _0x494ad1=Object['values'](_0x4ae44d),_0x3cf102=global['distributi'+'on']['util']['id']['getID'](_0x36ca18),_0x366ec9=_0x4e17be['hash'](_0x3cf102,_0x494ad1),_0x26e338=_0x366ec9['substring'](-0x1061*0x1+0x923+0x2*0x39f,0x1681*-0x1+-0x4c3*-0x1+0x11c3);global['distributi'+'on']['local']['groups']['get'](_0x4e17be['gid'],(_0x5bae1a,_0x26e22a)=>{const _0xecf4fa=_0x26e22a[_0x26e338];_0x1a1744(_0xecf4fa);});});}const store=function(_0x14d3d){const _0x27c5a5={};return _0x27c5a5['gid']=_0x14d3d['gid']||'all',_0x27c5a5['hash']=_0x14d3d['hash']||global['distributi'+'on']['util']['id']['naiveHash'],{'get':(_0x4fc5ef,_0x5a6081)=>{if(!_0x4fc5ef){const _0x487602=[{'key':null,'gid':_0x27c5a5['gid']}];global['distributi'+'on'][_0x27c5a5['gid']]['comm']['send'](_0x487602,{'service':'store','method':'get'},(_0x2c03a2,_0x14dd6a)=>{log('[all.store'+'.get\x20null\x20'+'given\x20as\x20k'+'ey.\x20keys:\x20'+JSON['stringify'](_0x14dd6a)+'\x20errors:\x20'+JSON['stringify'](_0x2c03a2));const _0x1cd07c=Object['values'](_0x14dd6a)['reduce']((_0xe5c384,_0xf23a91)=>_0xe5c384['concat'](_0xf23a91),[]);_0x5a6081(_0x2c03a2,_0x1cd07c);});return;}getNode(_0x27c5a5,_0x4fc5ef,_0x3f8d2b=>{const _0x395cae=[{'key':_0x4fc5ef,'gid':_0x27c5a5['gid']}],_0xab0ccd={'service':'store','method':'get','node':_0x3f8d2b};global['distributi'+'on']['local']['comm']['send'](_0x395cae,_0xab0ccd,_0x5a6081);});},'put':(_0x115347,_0x4c58a6,_0x56c5ba)=>{_0x4c58a6=_0x4c58a6||global['distributi'+'on']['util']['id']['getID'](_0x115347),getNode(_0x27c5a5,_0x4c58a6,_0x180f28=>{const _0x2800ba=[_0x115347,{'key':_0x4c58a6,'gid':_0x27c5a5['gid']}],_0x14613c={'service':'store','method':'put','node':_0x180f28};log('[all.store'+'.put]:\x20(gi'+'d:\x20'+_0x27c5a5['gid']+')\x20'+JSON['stringify'](_0x115347)+'\x20'+JSON['stringify'](_0x4c58a6)+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x180f28)),global['distributi'+'on']['local']['comm']['send'](_0x2800ba,_0x14613c,_0x56c5ba);});},'del':(_0x52bf0d,_0x5b2d40)=>{getNode(_0x27c5a5,_0x52bf0d,_0x58d07f=>{const _0x5a2106=[{'key':_0x52bf0d,'gid':_0x27c5a5['gid']}],_0x29eb0e={'service':'store','method':'del','node':_0x58d07f};global['distributi'+'on']['local']['comm']['send'](_0x5a2106,_0x29eb0e,_0x5b2d40);});},'reconf':(_0x17a4a7,_0x1703e9)=>{global['distributi'+'on'][_0x27c5a5['gid']]['store']['get'](null,(_0x385d5c,_0x3fa5ce)=>{global['distributi'+'on'][_0x27c5a5['gid']]['status']['get']('nid',(_0x444294,_0x4f0c5c)=>{const _0x1fa341=Object['values'](_0x4f0c5c),_0x417ccf=Object['values'](_0x17a4a7)['map'](_0x2a3d6e=>global['distributi'+'on']['util']['id']['getNID'](_0x2a3d6e));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x3fa5ce['length']+('\x20keys\x20from'+'\x20')+_0x4f0c5c['length']+'\x20nodes');let _0x5069d8=-0xc8c+0x1a72+-0xde6;const _0x3b8200=()=>{_0x5069d8===_0x3fa5ce['length']&&_0x1703e9();};if(_0x3fa5ce['length']===-0xd45+0x1*0x1d1b+0x1*-0xfd6){_0x1703e9();return;}for(const _0x1388f5 of _0x3fa5ce){const _0x543d78=global['distributi'+'on']['util']['id']['getID'](_0x1388f5),_0x481aec=_0x27c5a5['hash'](_0x543d78,_0x417ccf),_0x26d790=_0x27c5a5['hash'](_0x543d78,_0x1fa341);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x481aec+'\x20new\x20nid:\x20'+_0x26d790);if(_0x481aec===_0x26d790){_0x5069d8++,_0x3b8200();continue;}const _0x141e21=_0x17a4a7[_0x481aec['substring'](0xe61+0x97e+-0x17df,0x16d*-0x16+-0x7*0x359+0x36d2)],_0x286e99=[{'key':_0x1388f5,'gid':_0x27c5a5['gid']}],_0x5d74e5={'service':'store','method':'del','node':_0x141e21};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x1388f5+'\x20from\x20'+JSON['stringify'](_0x5d74e5)),global['distributi'+'on']['local']['comm']['send'](_0x286e99,_0x5d74e5,(_0x26cbbe,_0x22f106)=>{global['distributi'+'on'][_0x27c5a5['gid']]['store']['put'](_0x22f106,_0x1388f5,(_0x53c3b8,_0x3c4b0b)=>{_0x5069d8++,_0x3b8200();});});}});});}};};module['exports']=store;
9
+ const log=require('../util/lo'+'g');function getNode(_0x21fc30,_0x42c639,_0x1ad957){typeof _0x42c639==='object'&&(_0x42c639=_0x42c639['key']),global['distributi'+'on'][_0x21fc30['gid']]['status']['get']('nid',(_0x55324c,_0x16e6fe)=>{const _0x2d9c65=Object['values'](_0x16e6fe),_0x134bf9=global['distributi'+'on']['util']['id']['getID'](_0x42c639),_0x17dc6e=_0x21fc30['hash'](_0x134bf9,_0x2d9c65),_0x4cae62=_0x17dc6e['substring'](0x135f+-0x26fe+0x139f,0x41f+0x2182+0x259c*-0x1);global['distributi'+'on']['local']['groups']['get'](_0x21fc30['gid'],(_0x121969,_0x3aeb0e)=>{const _0x339dbf=_0x3aeb0e[_0x4cae62];log('[store\x20(ge'+'tNode)]\x20co'+'nfiguratio'+'n:\x20'+JSON['stringify'](_0x42c639)+'group:\x20'+JSON['stringify'](_0x3aeb0e)+'\x20node:\x20'+JSON['stringify'](_0x339dbf)+'nid:\x20'+JSON['stringify'](_0x17dc6e)+'\x20sid:\x20'+JSON['stringify'](_0x4cae62)),_0x1ad957(_0x339dbf);});});}function normalize(_0x10fcce,_0x337439){const _0x28b31b={};_0x10fcce===null&&(_0x10fcce={});if(typeof _0x10fcce==='string')_0x28b31b['key']=_0x10fcce,_0x28b31b['gid']=_0x337439,_0x28b31b['action']='put';else typeof _0x10fcce==='object'&&(_0x28b31b['key']=_0x10fcce['key'],_0x28b31b['gid']=_0x10fcce['gid']||_0x337439,_0x28b31b['action']=_0x10fcce['action']||'put');return _0x28b31b;};function store(_0x5ba65d){const _0x560400={};return _0x560400['gid']=_0x5ba65d['gid']||'all',_0x560400['hash']=_0x5ba65d['hash']||global['distributi'+'on']['util']['id']['naiveHash'],{'get':(_0x5ca58b,_0xb2d2d0)=>{if(!_0x5ca58b){const _0x581c03=[{'key':null,'gid':_0x560400['gid']}];global['distributi'+'on'][_0x560400['gid']]['comm']['send'](_0x581c03,{'service':'store','method':'get'},(_0xd82776,_0x5c34f0)=>{const _0x3b64c9=Object['values'](_0x5c34f0)['reduce']((_0x16afaa,_0x2cc3c9)=>_0x16afaa['concat'](_0x2cc3c9),[]);_0xb2d2d0(_0xd82776,_0x3b64c9);});return;}_0x5ca58b=normalize(_0x5ca58b,_0x560400['gid']),getNode(_0x560400,_0x5ca58b,_0x49a7df=>{const _0x1dc45c=[_0x5ca58b],_0x5b7657={'service':'store','method':'get','node':_0x49a7df};log('[all.store'+'.get]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x5ca58b)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x49a7df)),global['distributi'+'on']['local']['comm']['send'](_0x1dc45c,_0x5b7657,_0xb2d2d0);});},'put':(_0x3c26b,_0x1cd92c,_0x1e0393)=>{_0x1cd92c=_0x1cd92c||global['distributi'+'on']['util']['id']['getID'](_0x3c26b),_0x1cd92c=normalize(_0x1cd92c,_0x560400['gid']),getNode(_0x560400,_0x1cd92c,_0x51df7f=>{const _0x1065b5=[_0x3c26b,_0x1cd92c],_0x3535e0={'service':'store','method':'put','node':_0x51df7f};log('[all.store'+'.put]\x20stat'+'e:\x20'+JSON['stringify'](_0x3c26b)+('configurat'+'ion:\x20')+JSON['stringify'](_0x1cd92c)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x51df7f)),global['distributi'+'on']['local']['comm']['send'](_0x1065b5,_0x3535e0,_0x1e0393);});},'del':(_0x2f5012,_0x169b9c)=>{getNode(_0x560400,_0x2f5012,_0x1cc661=>{const _0x553f84=[{'key':_0x2f5012,'gid':_0x560400['gid']}],_0x143f9d={'service':'store','method':'del','node':_0x1cc661};global['distributi'+'on']['local']['comm']['send'](_0x553f84,_0x143f9d,_0x169b9c);});},'reconf':(_0x226cc9,_0x2a23b1)=>{log('[store.rec'+'onf]\x20confi'+'guration:\x20'+JSON['stringify'](_0x226cc9)+'\x20gid:\x20'+_0x560400['gid']),global['distributi'+'on']['local']['groups']['get'](_0x560400['gid'],(_0x598d36,_0xb4a9a5)=>{global['distributi'+'on']['local']['groups']['put'](_0x560400['gid'],_0x226cc9,(_0x35827c,_0x31855c)=>{global['distributi'+'on'][_0x560400['gid']]['store']['get'](null,(_0x240421,_0xbe9ae6)=>{global['distributi'+'on']['local']['groups']['put'](_0x560400['gid'],_0xb4a9a5,(_0x43d5d9,_0x5f3fae)=>{global['distributi'+'on'][_0x560400['gid']]['status']['get']('nid',(_0x37863f,_0xd6ffea)=>{const _0x433615=Object['values'](_0xd6ffea),_0x584f0f=Object['values'](_0x226cc9)['map'](_0x533edd=>global['distributi'+'on']['util']['id']['getNID'](_0x533edd));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0xbe9ae6['length']+('\x20keys\x20from'+'\x20')+_0xd6ffea['length']+'\x20nodes');let _0x3f9805=-0x1610+0x88c+-0x4*-0x361;const _0x2caf05=()=>{_0x3f9805===_0xbe9ae6['length']&&_0x2a23b1();};if(_0xbe9ae6['length']===-0x2*0x841+0x12a7+-0x225){_0x2a23b1();return;}for(const _0x58ee53 of _0xbe9ae6){const _0x592d54=global['distributi'+'on']['util']['id']['getID'](_0x58ee53),_0x469cf6=_0x560400['hash'](_0x592d54,_0x584f0f),_0x5defc8=_0x560400['hash'](_0x592d54,_0x433615);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x469cf6+'\x20new\x20nid:\x20'+_0x5defc8);if(_0x469cf6===_0x5defc8){_0x3f9805++,_0x2caf05();continue;}const _0x5c63cf=_0x226cc9[_0x469cf6['substring'](0x87d*-0x3+0x1c2a+-0x1*0x2b3,0xbe6*-0x1+0x1*0x1fc5+-0x4d*0x42)],_0x47c76e=[{'key':_0x58ee53,'gid':_0x560400['gid']}],_0x39fa14={'service':'store','method':'del','node':_0x5c63cf};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x58ee53+'\x20from\x20'+JSON['stringify'](_0x39fa14)),global['distributi'+'on']['local']['comm']['send'](_0x47c76e,_0x39fa14,(_0x52f0b8,_0x13bdd2)=>{global['distributi'+'on'][_0x560400['gid']]['store']['put'](_0x13bdd2,_0x58ee53,(_0x316341,_0x4e0d62)=>{_0x3f9805++,_0x2caf05();});});}});});});});});}};};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 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;
9
+ const log=require('../util/lo'+'g'),id=require('../util/id'),groupsStore=new Map();groupsStore['all']={};const groups={};groups['get']=function(_0x1d59bc,_0x545299){_0x545299=_0x545299||function(){},_0x1d59bc in groupsStore?_0x545299(null,groupsStore[_0x1d59bc]):_0x545299(new Error('Group\x20'+_0x1d59bc+'\x20not\x20found'));},groups['put']=function(_0x5992a0,_0x94d645,_0x561bc9){log('groups.put'+':\x20config:\x20'+JSON['stringify'](_0x5992a0)+'\x20group:\x20'+JSON['stringify'](_0x94d645)),_0x94d645=_0x94d645||{},typeof _0x5992a0==='string'&&(_0x5992a0={'gid':_0x5992a0}),groupsStore[_0x5992a0['gid']]=_0x94d645,Object['keys'](_0x94d645)['forEach'](_0x50cd02=>{groupsStore['all'][id['getSID'](_0x94d645[_0x50cd02])]=_0x94d645[_0x50cd02];}),global['distributi'+'on'][_0x5992a0['gid']]={},global['distributi'+'on'][_0x5992a0['gid']]['status']=require('../all/sta'+'tus')(_0x5992a0),global['distributi'+'on'][_0x5992a0['gid']]['comm']=require('../all/com'+'m')(_0x5992a0),global['distributi'+'on'][_0x5992a0['gid']]['gossip']=require('../all/gos'+'sip')(_0x5992a0),global['distributi'+'on'][_0x5992a0['gid']]['groups']=require('../all/gro'+'ups')(_0x5992a0),global['distributi'+'on'][_0x5992a0['gid']]['routes']=require('../all/rou'+'tes')(_0x5992a0),global['distributi'+'on'][_0x5992a0['gid']]['mem']=require('../all/mem')(_0x5992a0),global['distributi'+'on'][_0x5992a0['gid']]['store']=require('../all/sto'+'re')(_0x5992a0),global['distributi'+'on'][_0x5992a0['gid']]['mr']=require('../all/mr')(_0x5992a0),_0x561bc9(null,_0x94d645);},groups['del']=function(_0x21fd60,_0xe4380a){if(_0x21fd60 in groupsStore){const _0x2bd448=groupsStore[_0x21fd60];delete groupsStore[_0x21fd60],_0xe4380a(null,_0x2bd448);}else _0xe4380a(new Error('Group\x20'+_0x21fd60+'\x20not\x20found'));},groups['add']=function(_0x40fa17,_0x358f39,_0x3526ca){log('[all.group'+'s.add]\x20nam'+'e:\x20'+_0x40fa17+'\x20node:\x20'+_0x358f39),_0x3526ca=_0x3526ca||function(){},_0x40fa17 in groupsStore?(!groupsStore[_0x40fa17]&&(groupsStore[_0x40fa17]={}),groupsStore[_0x40fa17][id['getSID'](_0x358f39)]=_0x358f39,groupsStore['all'][id['getSID'](_0x358f39)]=_0x358f39,_0x3526ca&&_0x3526ca(null,groupsStore[_0x40fa17])):_0x3526ca&&_0x3526ca(new Error('Group\x20'+_0x40fa17+'\x20not\x20found'));},groups['rem']=function(_0x595075,_0x2ebd0b,_0x473ec1){log('[all.group'+'s.rem]\x20nam'+'e:\x20'+_0x595075+'\x20node:\x20'+_0x2ebd0b),_0x473ec1=_0x473ec1||function(){},_0x595075 in groupsStore?(delete groupsStore[_0x595075][_0x2ebd0b],delete groupsStore['all'][_0x2ebd0b],_0x473ec1(null,groupsStore[_0x595075])):_0x473ec1(new Error('Group\x20'+_0x595075+'\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 log=require('../util/lo'+'g'),routesStore=new Map();function get(_0x3313fa,_0x95e876){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0x3313fa));if(!_0x95e876)return;typeof _0x3313fa==='string'&&(_0x3313fa={'service':_0x3313fa});const _0x260761=_0x3313fa['service'],_0x54d5f3=_0x3313fa['gid'];if(_0x54d5f3&&_0x54d5f3!=='local')log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x260761),_0x95e876(null,global['distributi'+'on'][_0x54d5f3][_0x260761]);else{if(_0x260761 in routesStore)log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x260761),_0x95e876(null,routesStore[_0x260761]);else{const _0x57d4b5=global['toLocal'][_0x260761];_0x57d4b5?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x260761),_0x95e876(null,{'call':_0x57d4b5})):_0x95e876(new Error('Service\x20'+_0x260761+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x2dd48b,_0x506066,_0xabfbb8){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x506066+'\x20'+JSON['stringify'](_0x2dd48b)),routesStore[_0x506066]=_0x2dd48b;_0xabfbb8&&_0xabfbb8(null,_0x506066);;}function rem(_0x1866c7,_0xee2305){const _0x348046=routesStore[_0x1866c7];delete routesStore[_0x1866c7],_0xee2305(null,_0x348046);};module['exports']={'get':get,'put':put,'rem':rem};
9
+ const log=require('../util/lo'+'g'),routesStore=new Map();function get(_0x3a566f,_0x3ca056){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0x3a566f));if(!_0x3ca056)return;typeof _0x3a566f==='string'&&(_0x3a566f={'service':_0x3a566f});const _0x13fb2e=_0x3a566f['service'],_0x3508a2=_0x3a566f['gid'];if(_0x3508a2&&_0x3508a2!=='local')log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x13fb2e),_0x3ca056(null,global['distributi'+'on'][_0x3508a2][_0x13fb2e]);else{if(_0x13fb2e in routesStore)log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x13fb2e),_0x3ca056(null,routesStore[_0x13fb2e]);else{const _0x5a9481=global['toLocal'][_0x13fb2e];_0x5a9481?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x13fb2e),_0x3ca056(null,{'call':_0x5a9481})):_0x3ca056(new Error('Service\x20'+_0x13fb2e+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x16fcef,_0x18a44a,_0x377faf){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x18a44a),routesStore[_0x18a44a]=_0x16fcef;_0x377faf&&_0x377faf(null,_0x18a44a);;}function rem(_0x46702d,_0x140e54){const _0x563fcf=routesStore[_0x46702d];delete routesStore[_0x46702d],_0x140e54(null,_0x563fcf);};module['exports']={'get':get,'put':put,'rem':rem};
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,