@brown-ds/distribution 0.2.26 → 0.2.27

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.js');function normalize(_0x13affd,_0x76bd10){if(_0x13affd===null)return{'key':null,'gid':_0x76bd10,'action':'put'};else return typeof _0x13affd==='string'?{'key':_0x13affd,'gid':_0x76bd10,'action':'put'}:_0x13affd;}function mem(_0x1024b5){const _0x4f5929={};_0x4f5929['gid']=_0x1024b5['gid']||'all',_0x4f5929['hash']=_0x1024b5['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'];function _0x392d50(_0xf82396,_0x435aa6){log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0xf82396)+'\x20context:\x20'+JSON['stringify'](_0x4f5929)),_0xf82396=normalize(_0xf82396,_0x4f5929['gid']),_0xf82396['gid']=_0xf82396['gid']||_0x4f5929['gid'];const _0x2beeb9={'service':'mem','method':'get'},_0x472a67=[_0xf82396];if(!_0xf82396['key']){globalThis['distributi'+'on'][_0x4f5929['gid']]['comm']['send'](_0x472a67,_0x2beeb9,(_0x4c4b39,_0xcc78f3)=>{const _0x4b25de=Object['values'](_0xcc78f3)['reduce']((_0x31bcd7,_0x4023ad)=>_0x31bcd7['concat'](_0x4023ad),[]);_0x435aa6(_0x4c4b39,_0x4b25de);});return;}const _0x143d73=_0xf82396['key'];if(_0x143d73===null){_0x435aa6(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x472a67,_0x2beeb9,{'key':_0x143d73},_0x4f5929,_0x435aa6);return;return _0x435aa6(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function _0x3039da(_0x2ebf20,_0x59fc6d,_0x1ab067){log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x2ebf20)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x59fc6d)),_0x59fc6d=_0x59fc6d||globalThis['distributi'+'on']['util']['id']['getID'](_0x2ebf20),_0x59fc6d=normalize(_0x59fc6d,_0x4f5929['gid']),_0x59fc6d['gid']=_0x59fc6d['gid']||_0x4f5929['gid'];const _0x91dcde={'service':'mem','method':'put'},_0x2c698e=[_0x2ebf20,_0x59fc6d],_0x3eb079=_0x59fc6d['key'];if(_0x3eb079===null){_0x1ab067(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x2c698e,_0x91dcde,{'key':_0x3eb079},_0x4f5929,_0x1ab067);return;return _0x1ab067(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));}function _0x551bbe(_0x1ebde5,_0x2cd4b9){log('[all.mem.d'+'el]\x20config'+'uration:\x20'+JSON['stringify'](_0x1ebde5)),_0x1ebde5=normalize(_0x1ebde5,_0x4f5929['gid']),_0x1ebde5['gid']=_0x1ebde5['gid']||_0x4f5929['gid'];const _0x5318ba={'service':'mem','method':'del'},_0x429048=[_0x1ebde5],_0xe59d5a=_0x1ebde5['key'];if(_0xe59d5a===null){_0x2cd4b9(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x429048,_0x5318ba,{'key':_0xe59d5a},_0x4f5929,_0x2cd4b9);return;return _0x2cd4b9(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));}function _0x3b6520(_0x4a2e20,_0x12aca9){log('[mem.recon'+'f]\x20configu'+'ration:\x20'+JSON['stringify'](_0x4a2e20)+'\x20gid:\x20'+_0x4f5929['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x4f5929['gid'],(_0x384dc1,_0x2fb2b1)=>{if(!_0x2fb2b1){_0x12aca9(_0x384dc1);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x4f5929['gid'],_0x4a2e20,(_0x1e18f9,_0x614b96)=>{globalThis['distributi'+'on'][_0x4f5929['gid']]['mem']['get'](null,(_0xd487e9,_0x4887fa)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x4f5929['gid'],_0x2fb2b1,(_0x35b12a,_0x55d9ff)=>{globalThis['distributi'+'on'][_0x4f5929['gid']]['status']['get']('nid',(_0x54a0e1,_0x116ebb)=>{const _0x37158c=Object['values'](_0x116ebb),_0x5bb94d=Object['values'](_0x4a2e20)['map'](_0x2024f8=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x2024f8));log('[mem.recon'+'f\x20received'+'\x20'+_0x4887fa['length']+('\x20keys\x20from'+'\x20')+_0x116ebb['length']+'\x20nodes');let _0x34e63f=0x1511+-0x1fb0+0xa9f;const _0x1636ec=()=>{if(_0x34e63f===_0x4887fa['length'])return _0x12aca9(null);};if(_0x4887fa['length']===0x1292+0x17c+-0x140e)return _0x12aca9(null);for(const _0x16b1d3 of _0x4887fa){const _0x5c23ce=globalThis['distributi'+'on']['util']['id']['getID'](_0x16b1d3),_0x25777d=_0x4f5929['hash'](_0x5c23ce,_0x5bb94d),_0x43d56e=_0x4f5929['hash'](_0x5c23ce,_0x37158c);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x25777d+'\x20new\x20nid:\x20'+_0x43d56e);if(_0x25777d===_0x43d56e){_0x34e63f++,_0x1636ec();continue;}const _0x3774b9=_0x4a2e20[_0x25777d['substring'](0x17b*-0x11+0x1682+0x2a9*0x1,-0x5db*0x3+-0x23+0xd*0x15d)],_0x1c033e=[{'key':_0x16b1d3,'gid':_0x4f5929['gid']}],_0x56647e={'service':'mem','method':'del','node':_0x3774b9};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x16b1d3+'\x20from\x20'+JSON['stringify'](_0x56647e)),globalThis['distributi'+'on']['local']['comm']['send'](_0x1c033e,_0x56647e,(_0x5a6b59,_0x4742a3)=>{globalThis['distributi'+'on'][_0x4f5929['gid']]['mem']['put'](_0x4742a3,_0x16b1d3,(_0x508f81,_0x29859e)=>{_0x34e63f++,_0x1636ec();});});}});});});});});return;return _0x12aca9(new Error('mem.reconf'+'\x20not\x20imple'+'mented'));}return{'get':_0x392d50,'put':_0x3039da,'del':_0x551bbe,'reconf':_0x3b6520};}module['exports']=mem;
9
+ const log=require('../util/lo'+'g.js');function normalize(_0x32024c,_0x453b57){if(_0x32024c===null)return{'key':null,'gid':_0x453b57,'action':'put'};else return typeof _0x32024c==='string'?{'key':_0x32024c,'gid':_0x453b57,'action':'put'}:_0x32024c;}function mem(_0x596c5f){const _0x49e839={};_0x49e839['gid']=_0x596c5f['gid']||'all',_0x49e839['hash']=_0x596c5f['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'];function _0x371c08(_0x21a52e,_0x2c108d){log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x21a52e)+'\x20context:\x20'+JSON['stringify'](_0x49e839)),_0x21a52e=normalize(_0x21a52e,_0x49e839['gid']),_0x21a52e['gid']=_0x21a52e['gid']||_0x49e839['gid'];const _0x1fa5ac={'service':'mem','method':'get'},_0x326650=[_0x21a52e];if(!_0x21a52e['key']){globalThis['distributi'+'on'][_0x49e839['gid']]['comm']['send'](_0x326650,_0x1fa5ac,(_0x2b3bc6,_0x352974)=>{const _0x4dbc3e=Object['values'](_0x352974)['reduce']((_0x3f3d3a,_0x278732)=>_0x3f3d3a['concat'](_0x278732),[]);_0x2c108d(_0x2b3bc6,_0x4dbc3e);});return;}const _0xeffa28=_0x21a52e['key'];if(_0xeffa28===null){_0x2c108d(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x326650,_0x1fa5ac,{'key':_0xeffa28},_0x49e839,_0x2c108d);return;return _0x2c108d(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function _0x23a5a1(_0x502045,_0x348891,_0x3f229b){log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x502045)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x348891)),_0x348891=_0x348891||globalThis['distributi'+'on']['util']['id']['getID'](_0x502045),_0x348891=normalize(_0x348891,_0x49e839['gid']),_0x348891['gid']=_0x348891['gid']||_0x49e839['gid'];const _0x17052e={'service':'mem','method':'put'},_0x41961f=[_0x502045,_0x348891],_0x3380b1=_0x348891['key'];if(_0x3380b1===null){_0x3f229b(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x41961f,_0x17052e,{'key':_0x3380b1},_0x49e839,_0x3f229b);return;return _0x3f229b(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));}function _0x3a2765(_0x31c931,_0xb9548a){log('[all.mem.d'+'el]\x20config'+'uration:\x20'+JSON['stringify'](_0x31c931)),_0x31c931=normalize(_0x31c931,_0x49e839['gid']),_0x31c931['gid']=_0x31c931['gid']||_0x49e839['gid'];const _0xee4669={'service':'mem','method':'del'},_0x22c96a=[_0x31c931],_0x2c602f=_0x31c931['key'];if(_0x2c602f===null){_0xb9548a(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x22c96a,_0xee4669,{'key':_0x2c602f},_0x49e839,_0xb9548a);return;return _0xb9548a(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));}function _0x1b7e3a(_0x15a049,_0x2f5b91){log('[mem.recon'+'f]\x20configu'+'ration:\x20'+JSON['stringify'](_0x15a049)+'\x20gid:\x20'+_0x49e839['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x49e839['gid'],(_0x446233,_0x360998)=>{if(!_0x360998){_0x2f5b91(_0x446233);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x49e839['gid'],_0x15a049,(_0x54d5da,_0x2a007b)=>{globalThis['distributi'+'on'][_0x49e839['gid']]['mem']['get'](null,(_0x753d8c,_0x4cdb76)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x49e839['gid'],_0x360998,(_0x484939,_0x5a11c7)=>{globalThis['distributi'+'on'][_0x49e839['gid']]['status']['get']('nid',(_0x1096d9,_0x3d4957)=>{const _0x795cc4=Object['values'](_0x3d4957),_0x55ac29=Object['values'](_0x15a049)['map'](_0x2910d4=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x2910d4));log('[mem.recon'+'f\x20received'+'\x20'+_0x4cdb76['length']+('\x20keys\x20from'+'\x20')+_0x3d4957['length']+'\x20nodes');let _0x36b9c7=-0x6*0x4a+-0x805+-0x1*-0x9c1;const _0xbf6699=()=>{if(_0x36b9c7===_0x4cdb76['length'])return _0x2f5b91(null);};if(_0x4cdb76['length']===-0x3e*-0x78+0x182b+-0x353b)return _0x2f5b91(null);for(const _0x531f23 of _0x4cdb76){const _0x20623b=globalThis['distributi'+'on']['util']['id']['getID'](_0x531f23),_0xdcce56=_0x49e839['hash'](_0x20623b,_0x55ac29),_0x25e240=_0x49e839['hash'](_0x20623b,_0x795cc4);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0xdcce56+'\x20new\x20nid:\x20'+_0x25e240);if(_0xdcce56===_0x25e240){_0x36b9c7++,_0xbf6699();continue;}const _0x4855bc=_0x15a049[_0xdcce56['substring'](0x19f1+-0xaed*0x2+-0x417,-0xc*0x20a+-0x1943+0x18e*0x20)],_0xf96b0c=[{'key':_0x531f23,'gid':_0x49e839['gid']}],_0x491d0b={'service':'mem','method':'del','node':_0x4855bc};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x531f23+'\x20from\x20'+JSON['stringify'](_0x491d0b)),globalThis['distributi'+'on']['local']['comm']['send'](_0xf96b0c,_0x491d0b,(_0x8c4449,_0x52687f)=>{globalThis['distributi'+'on'][_0x49e839['gid']]['mem']['put'](_0x52687f,_0x531f23,(_0x457f0c,_0x2ac296)=>{_0x36b9c7++,_0xbf6699();});});}});});});});});return;return _0x2f5b91(new Error('mem.reconf'+'\x20not\x20imple'+'mented'));}return{'get':_0x371c08,'put':_0x23a5a1,'del':_0x3a2765,'reconf':_0x1b7e3a};}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 log=require('../util/lo'+'g.js');function getNode(_0x1de661,_0x24d5f0,_0x28af9d){const _0x15363d=_0x24d5f0&&typeof _0x24d5f0==='object'?_0x24d5f0['key']:_0x24d5f0;globalThis['distributi'+'on'][_0x1de661['gid']]['status']['get']('nid',(_0x3dd193,_0x1b7cfb)=>{const _0x285dc5=Object['values'](_0x1b7cfb),_0x453505=globalThis['distributi'+'on']['util']['id']['getID'](_0x15363d),_0x1d2a3f=_0x1de661['hash'](_0x453505,_0x285dc5),_0x1a412c=_0x1d2a3f['substring'](0x46*-0xe+-0xa*-0xc4+-0x3d4,-0x1ef7+-0x1fd5+-0x3ed1*-0x1);globalThis['distributi'+'on']['local']['groups']['get'](_0x1de661['gid'],(_0x187315,_0x580f04)=>{if(!_0x580f04)return _0x28af9d(_0x187315);else{const _0x5e76ae=_0x580f04[_0x1a412c];return log('[store\x20(ge'+'tNode)]\x20co'+'nfiguratio'+'n:\x20'+JSON['stringify'](_0x24d5f0)+'group:\x20'+JSON['stringify'](_0x580f04)+'\x20node:\x20'+JSON['stringify'](_0x5e76ae)+'nid:\x20'+JSON['stringify'](_0x1d2a3f)+'\x20sid:\x20'+JSON['stringify'](_0x1a412c)),_0x28af9d(null,_0x5e76ae);}});});}function normalize(_0x163895,_0x3c4f62){if(_0x163895===null)return{'key':null,'gid':_0x3c4f62,'action':'put'};else return typeof _0x163895==='string'?{'key':_0x163895,'gid':_0x3c4f62,'action':'put'}:_0x163895;}function store(_0x167984){const _0x16f33e={'gid':_0x167984['gid']||'all','hash':_0x167984['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'],'subset':_0x167984['subset']};function _0x10eab0(_0x2ef6b7,_0x38ef93){if(!_0x2ef6b7){const _0x17ea1c=[{'key':null,'gid':_0x16f33e['gid']}];globalThis['distributi'+'on'][_0x16f33e['gid']]['comm']['send'](_0x17ea1c,{'service':'store','method':'get'},(_0x4a2e4d,_0x178482)=>{const _0x29f2dc=Object['values'](_0x178482)['reduce']((_0x24e18b,_0x2b1ab4)=>_0x24e18b['concat'](_0x2b1ab4),[]);_0x38ef93(_0x4a2e4d,_0x29f2dc);});return;}_0x2ef6b7=normalize(_0x2ef6b7,_0x16f33e['gid']),getNode(_0x16f33e,_0x2ef6b7,(_0x2fa49e,_0x175203)=>{if(!_0x175203){_0x38ef93(_0x2fa49e);return;}const _0x307ff0=[_0x2ef6b7],_0x39c751={'service':'store','method':'get','node':_0x175203};log('[all.store'+'.get]confi'+'guration:\x20'+JSON['stringify'](_0x2ef6b7)+'node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x175203)),globalThis['distributi'+'on']['local']['comm']['send'](_0x307ff0,_0x39c751,_0x38ef93);});return;return _0x38ef93(new Error('store.get\x20'+'not\x20implem'+'ented'));}function _0xb8a2c2(_0x46c1d8,_0x3db568,_0x2fc7d4){_0x3db568=_0x3db568||globalThis['distributi'+'on']['util']['id']['getID'](_0x46c1d8),_0x3db568=normalize(_0x3db568,_0x16f33e['gid']),getNode(_0x16f33e,_0x3db568,(_0x57a329,_0x4cfaf5)=>{if(!_0x4cfaf5){_0x2fc7d4(_0x57a329);return;}const _0x36a221=[_0x46c1d8,_0x3db568],_0x27fa35={'service':'store','method':'put','node':_0x4cfaf5};log('[all.store'+'.put]\x20stat'+'e:\x20'+JSON['stringify'](_0x46c1d8)+('configurat'+'ion:\x20')+JSON['stringify'](_0x3db568)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x4cfaf5)),globalThis['distributi'+'on']['local']['comm']['send'](_0x36a221,_0x27fa35,_0x2fc7d4);});return;return _0x2fc7d4(new Error('store.put\x20'+'not\x20implem'+'ented'));}function _0x35f63d(_0x251e9e,_0x310679){getNode(_0x16f33e,_0x251e9e,(_0x100c81,_0x2bfec2)=>{if(!_0x2bfec2){_0x310679(_0x100c81);return;}const _0x3b78c7=[{'key':_0x251e9e,'gid':_0x16f33e['gid']}],_0x59b50f={'service':'store','method':'del','node':_0x2bfec2};globalThis['distributi'+'on']['local']['comm']['send'](_0x3b78c7,_0x59b50f,_0x310679);});return;return _0x310679(new Error('store.del\x20'+'not\x20implem'+'ented'));}function _0x319cf7(_0x3b9ecb,_0x38b6e8){log('[store.rec'+'onf]\x20confi'+'guration:\x20'+JSON['stringify'](_0x3b9ecb)+'\x20gid:\x20'+_0x16f33e['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x16f33e['gid'],(_0xb5991f,_0x31995e)=>{if(!_0x31995e){_0x38b6e8(_0xb5991f);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x16f33e['gid'],_0x3b9ecb,(_0xa9fad1,_0x359f20)=>{globalThis['distributi'+'on'][_0x16f33e['gid']]['store']['get'](null,(_0x59ad7f,_0x461adf)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x16f33e['gid'],_0x31995e,(_0x3a7608,_0x392309)=>{globalThis['distributi'+'on'][_0x16f33e['gid']]['status']['get']('nid',(_0x413fe7,_0x1b3c9d)=>{const _0x4c3b12=Object['values'](_0x1b3c9d),_0x43ddad=Object['values'](_0x3b9ecb)['map'](_0x34d599=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x34d599));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x461adf['length']+('\x20keys\x20from'+'\x20')+_0x1b3c9d['length']+'\x20nodes');let _0x5a990f=-0x35e+0x53*-0x17+0xad3;const _0xfcd7de=()=>{if(_0x5a990f===_0x461adf['length'])return _0x38b6e8(null);};if(_0x461adf['length']===-0x1f29+-0x8*-0x11f+0x1631)return _0x38b6e8(null);for(const _0x2e69f4 of _0x461adf){const _0x2c2a50=globalThis['distributi'+'on']['util']['id']['getID'](_0x2e69f4),_0x543052=_0x16f33e['hash'](_0x2c2a50,_0x43ddad),_0x268cd0=_0x16f33e['hash'](_0x2c2a50,_0x4c3b12);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x543052+'\x20new\x20nid:\x20'+_0x268cd0);if(_0x543052===_0x268cd0){_0x5a990f++,_0xfcd7de();continue;}const _0x23d5c7=_0x3b9ecb[_0x543052['substring'](-0x1*-0xa7b+-0xf53*-0x1+-0xce7*0x2,0x2083+0x16f7+0x1*-0x3775)],_0x21600b=[{'key':_0x2e69f4,'gid':_0x16f33e['gid']}],_0x6f378e={'service':'store','method':'del','node':_0x23d5c7};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x2e69f4+'\x20from\x20'+JSON['stringify'](_0x6f378e)),globalThis['distributi'+'on']['local']['comm']['send'](_0x21600b,_0x6f378e,(_0x4f778a,_0x11da82)=>{globalThis['distributi'+'on'][_0x16f33e['gid']]['store']['put'](_0x11da82,_0x2e69f4,(_0x23ad1a,_0x12dab4)=>{_0x5a990f++,_0xfcd7de();});});}});});});});});return;return _0x38b6e8(new Error('store.reco'+'nf\x20not\x20imp'+'lemented'));}return{'get':_0x10eab0,'put':_0xb8a2c2,'del':_0x35f63d,'reconf':_0x319cf7};}module['exports']=store;
9
+ const log=require('../util/lo'+'g.js');function getNode(_0x56df33,_0xd97253,_0x3ad8f8){const _0x19cc0d=_0xd97253&&typeof _0xd97253==='object'?_0xd97253['key']:_0xd97253;globalThis['distributi'+'on'][_0x56df33['gid']]['status']['get']('nid',(_0x167305,_0x541898)=>{const _0x268f87=Object['values'](_0x541898),_0x3a1cdd=globalThis['distributi'+'on']['util']['id']['getID'](_0x19cc0d),_0x4a8379=_0x56df33['hash'](_0x3a1cdd,_0x268f87),_0x2f2141=_0x4a8379['substring'](-0x4*0x35b+-0x1434+0x21a*0x10,0x12b3+-0x1e11+-0x37*-0x35);globalThis['distributi'+'on']['local']['groups']['get'](_0x56df33['gid'],(_0x400922,_0x8bcfb2)=>{if(!_0x8bcfb2)return _0x3ad8f8(_0x400922);else{const _0x5870d2=_0x8bcfb2[_0x2f2141];return log('[store\x20(ge'+'tNode)]\x20co'+'nfiguratio'+'n:\x20'+JSON['stringify'](_0xd97253)+'group:\x20'+JSON['stringify'](_0x8bcfb2)+'\x20node:\x20'+JSON['stringify'](_0x5870d2)+'nid:\x20'+JSON['stringify'](_0x4a8379)+'\x20sid:\x20'+JSON['stringify'](_0x2f2141)),_0x3ad8f8(null,_0x5870d2);}});});}function normalize(_0x38566b,_0x5b7ebe){if(_0x38566b===null)return{'key':null,'gid':_0x5b7ebe,'action':'put'};else return typeof _0x38566b==='string'?{'key':_0x38566b,'gid':_0x5b7ebe,'action':'put'}:_0x38566b;}function store(_0x59c946){const _0x5dbe89={'gid':_0x59c946['gid']||'all','hash':_0x59c946['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'],'subset':_0x59c946['subset']};function _0x1d0a59(_0x28695e,_0x274138){if(!_0x28695e){const _0x485b58=[{'key':null,'gid':_0x5dbe89['gid']}];globalThis['distributi'+'on'][_0x5dbe89['gid']]['comm']['send'](_0x485b58,{'service':'store','method':'get'},(_0x59d1eb,_0x52aeaf)=>{const _0xd617d7=Object['values'](_0x52aeaf)['reduce']((_0x350b51,_0x14825a)=>_0x350b51['concat'](_0x14825a),[]);_0x274138(_0x59d1eb,_0xd617d7);});return;}_0x28695e=normalize(_0x28695e,_0x5dbe89['gid']),getNode(_0x5dbe89,_0x28695e,(_0x18ccae,_0x35bd7c)=>{if(!_0x35bd7c){_0x274138(_0x18ccae);return;}const _0x549a6e=[_0x28695e],_0x4d7ad1={'service':'store','method':'get','node':_0x35bd7c};log('[all.store'+'.get]confi'+'guration:\x20'+JSON['stringify'](_0x28695e)+'node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x35bd7c)),globalThis['distributi'+'on']['local']['comm']['send'](_0x549a6e,_0x4d7ad1,_0x274138);});return;return _0x274138(new Error('store.get\x20'+'not\x20implem'+'ented'));}function _0x42e18c(_0x2059e6,_0x32c08a,_0x2c652e){_0x32c08a=_0x32c08a||globalThis['distributi'+'on']['util']['id']['getID'](_0x2059e6),_0x32c08a=normalize(_0x32c08a,_0x5dbe89['gid']),getNode(_0x5dbe89,_0x32c08a,(_0x12260d,_0x461835)=>{if(!_0x461835){_0x2c652e(_0x12260d);return;}const _0x5aa60a=[_0x2059e6,_0x32c08a],_0x256fac={'service':'store','method':'put','node':_0x461835};log('[all.store'+'.put]\x20stat'+'e:\x20'+JSON['stringify'](_0x2059e6)+('configurat'+'ion:\x20')+JSON['stringify'](_0x32c08a)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x461835)),globalThis['distributi'+'on']['local']['comm']['send'](_0x5aa60a,_0x256fac,_0x2c652e);});return;return _0x2c652e(new Error('store.put\x20'+'not\x20implem'+'ented'));}function _0x28659f(_0x7bc9bf,_0x19a9fa){getNode(_0x5dbe89,_0x7bc9bf,(_0xc1bf99,_0x186200)=>{if(!_0x186200){_0x19a9fa(_0xc1bf99);return;}const _0x4d706e=[{'key':_0x7bc9bf,'gid':_0x5dbe89['gid']}],_0x3b5f70={'service':'store','method':'del','node':_0x186200};globalThis['distributi'+'on']['local']['comm']['send'](_0x4d706e,_0x3b5f70,_0x19a9fa);});return;return _0x19a9fa(new Error('store.del\x20'+'not\x20implem'+'ented'));}function _0x5863c7(_0x22e783,_0x1d7c88){log('[store.rec'+'onf]\x20confi'+'guration:\x20'+JSON['stringify'](_0x22e783)+'\x20gid:\x20'+_0x5dbe89['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x5dbe89['gid'],(_0x2af156,_0x2b066f)=>{if(!_0x2b066f){_0x1d7c88(_0x2af156);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x5dbe89['gid'],_0x22e783,(_0x4507b1,_0x18023b)=>{globalThis['distributi'+'on'][_0x5dbe89['gid']]['store']['get'](null,(_0x38bea3,_0x3c2836)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x5dbe89['gid'],_0x2b066f,(_0x31010b,_0x3a214f)=>{globalThis['distributi'+'on'][_0x5dbe89['gid']]['status']['get']('nid',(_0x2e730c,_0x2dbb1a)=>{const _0x85a6c7=Object['values'](_0x2dbb1a),_0x438210=Object['values'](_0x22e783)['map'](_0x430426=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x430426));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x3c2836['length']+('\x20keys\x20from'+'\x20')+_0x2dbb1a['length']+'\x20nodes');let _0x3be2b9=-0x5a2*0x2+-0x166c+0x31*0xb0;const _0x28032c=()=>{if(_0x3be2b9===_0x3c2836['length'])return _0x1d7c88(null);};if(_0x3c2836['length']===0x243d*0x1+0x502*0x5+-0x3d47)return _0x1d7c88(null);for(const _0x25e296 of _0x3c2836){const _0x50ef19=globalThis['distributi'+'on']['util']['id']['getID'](_0x25e296),_0x4c7d1=_0x5dbe89['hash'](_0x50ef19,_0x438210),_0x5ef2ca=_0x5dbe89['hash'](_0x50ef19,_0x85a6c7);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x4c7d1+'\x20new\x20nid:\x20'+_0x5ef2ca);if(_0x4c7d1===_0x5ef2ca){_0x3be2b9++,_0x28032c();continue;}const _0x2296a1=_0x22e783[_0x4c7d1['substring'](-0xb34+-0x1ca5*-0x1+-0x5f*0x2f,0xba7+-0x8a0+-0x302)],_0x4c5116=[{'key':_0x25e296,'gid':_0x5dbe89['gid']}],_0x5e757a={'service':'store','method':'del','node':_0x2296a1};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x25e296+'\x20from\x20'+JSON['stringify'](_0x5e757a)),globalThis['distributi'+'on']['local']['comm']['send'](_0x4c5116,_0x5e757a,(_0x56383b,_0x1bf949)=>{globalThis['distributi'+'on'][_0x5dbe89['gid']]['store']['put'](_0x1bf949,_0x25e296,(_0x456d15,_0x3f892c)=>{_0x3be2b9++,_0x28032c();});});}});});});});});return;return _0x1d7c88(new Error('store.reco'+'nf\x20not\x20imp'+'lemented'));}return{'get':_0x1d0a59,'put':_0x42e18c,'del':_0x28659f,'reconf':_0x5863c7};}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 assert=require('assert'),crypto=require('crypto');function getID(_0x4782ce){const _0x201020=crypto['createHash']('sha256');return _0x201020['update'](JSON['stringify'](_0x4782ce)),_0x201020['digest']('hex');}function getNID(_0x2d8636){return _0x2d8636={'ip':_0x2d8636['ip'],'port':_0x2d8636['port']},getID(_0x2d8636);}function getSID(_0x33ed95){return getNID(_0x33ed95)['substring'](-0x2*0xe05+-0x5d4+-0x6*-0x5a5,-0x1cc0+0x1030+-0xc95*-0x1);}function getMID(_0xee8490){const _0x41d748={};return _0x41d748['date']=new Date()['getTime'](),_0x41d748['mss']=_0xee8490,getID(_0x41d748);}function idToNum(_0x359a0e){assert(typeof _0x359a0e==='string','idToNum:\x20i'+'d\x20is\x20not\x20i'+'n\x20KID\x20form'+'!');const _0x521aa2=_0x359a0e['startsWith']('0x')?_0x359a0e['slice'](-0x12fb*-0x2+0x22ad+-0x48a1):_0x359a0e;if(/^[0-9a-fA-F]+$/['test'](_0x521aa2))return BigInt('0x'+_0x521aa2);return BigInt(_0x359a0e);}const naiveHash=(_0x1c8137,_0x28ed80)=>{_0x28ed80['sort']();const _0x148019=Number(idToNum(_0x1c8137)%BigInt(_0x28ed80['length']));return _0x28ed80[_0x148019];},consistentHash=(_0x61260a,_0x2a45c1)=>{const _0x62fa12=idToNum(_0x61260a),_0x575565=_0x2a45c1['map'](_0x48adc3=>({'id':_0x48adc3,'hash':idToNum(_0x48adc3)}));_0x575565['sort']((_0x38f1a1,_0x187a05)=>{if(_0x38f1a1['hash']<_0x187a05['hash'])return-(-0x4*0x4fd+-0x3e*-0x86+-0xc7f*0x1);if(_0x38f1a1['hash']>_0x187a05['hash'])return-0xdab+-0x1ac9+0x2875;return 0x157b+0x2487+-0x3a02;});for(const _0x14855b of _0x575565){if(_0x62fa12<=_0x14855b['hash'])return _0x14855b['id'];}return _0x575565[0x10*0x3b+-0x18d0+0x1520]['id'];},rendezvousHash=(_0x3db221,_0x4b615b)=>{let _0x41b857=null,_0x41639e=null;for(const _0x15b2ca of _0x4b615b){const _0x5e0fce=getID(_0x3db221+_0x15b2ca),_0x584d14=idToNum(_0x5e0fce);(_0x41b857===null||_0x584d14>_0x41b857)&&(_0x41b857=_0x584d14,_0x41639e=_0x15b2ca);}if(_0x41639e===null)throw Error('maxNID\x20is\x20'+'null.\x20nids'+'\x20is\x20likely'+'\x20an\x20empty\x20'+'list');else return _0x41639e;};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(_0xbb9df0){const _0x51967b=crypto['createHash']('sha256');return _0x51967b['update'](JSON['stringify'](_0xbb9df0)),_0x51967b['digest']('hex');}function getNID(_0xe388){return _0xe388={'ip':_0xe388['ip'],'port':_0xe388['port']},getID(_0xe388);}function getSID(_0x2abc00){return getNID(_0x2abc00)['substring'](-0x2247*-0x1+0x8*-0x394+-0x5a7,0x2507+0x250b+-0x4a0d);}function getMID(_0x3ba368){const _0x108b63={};return _0x108b63['date']=new Date()['getTime'](),_0x108b63['mss']=_0x3ba368,getID(_0x108b63);}function idToNum(_0x55bc3c){assert(typeof _0x55bc3c==='string','idToNum:\x20i'+'d\x20is\x20not\x20i'+'n\x20KID\x20form'+'!');const _0x1c5871=_0x55bc3c['startsWith']('0x')?_0x55bc3c['slice'](0x6fd*-0x3+0x2022+-0xb29):_0x55bc3c;if(/^[0-9a-fA-F]+$/['test'](_0x1c5871))return BigInt('0x'+_0x1c5871);return BigInt(_0x55bc3c);}const naiveHash=(_0x2446b8,_0x564e44)=>{const _0x2e26e1=[..._0x564e44]['sort'](),_0x1090fb=Number(idToNum(_0x2446b8)%BigInt(_0x2e26e1['length']));return _0x2e26e1[_0x1090fb];},consistentHash=(_0x2274e3,_0xca9f6d)=>{const _0x5770f1=idToNum(_0x2274e3),_0x5e4464=_0xca9f6d['map'](_0x45e8fd=>({'id':_0x45e8fd,'hash':idToNum(_0x45e8fd)}));_0x5e4464['sort']((_0x4859a5,_0x35260d)=>{if(_0x4859a5['hash']<_0x35260d['hash'])return-(-0x136b+-0xe5b+0x21c7);if(_0x4859a5['hash']>_0x35260d['hash'])return-0x160a+0x146f*-0x1+0x2a7a;return-0xfb*-0x8+0xf71+-0x7c3*0x3;});for(const _0x5853ac of _0x5e4464){if(_0x5770f1<=_0x5853ac['hash'])return _0x5853ac['id'];}return _0x5e4464[-0x20e7*0x1+-0x16f6+-0x129f*-0x3]['id'];},rendezvousHash=(_0x29654e,_0x9f43e3)=>{let _0x108962=null,_0x3eacbc=null;for(const _0x2cc936 of _0x9f43e3){const _0x37ef7c=getID(_0x29654e+_0x2cc936),_0x496bd5=idToNum(_0x37ef7c);(_0x108962===null||_0x496bd5>_0x108962)&&(_0x108962=_0x496bd5,_0x3eacbc=_0x2cc936);}if(_0x3eacbc===null)throw Error('maxNID\x20is\x20'+'null.\x20nids'+'\x20is\x20likely'+'\x20an\x20empty\x20'+'list');else return _0x3eacbc;};module['exports']={'getID':getID,'getNID':getNID,'getSID':getSID,'getMID':getMID,'naiveHash':naiveHash,'consistentHash':consistentHash,'rendezvousHash':rendezvousHash};
10
10
  /* eslint-enable */
package/distribution.js CHANGED
@@ -25,11 +25,6 @@ function bootstrap(config) {
25
25
  globalThis.distribution = distribution;
26
26
  distribution.util = require('./distribution/util/util.js');
27
27
 
28
- /* __start_M3_solution__
29
- distribution.util.serialize = distributionLib.util.serialize;
30
- distribution.util.deserialize = distributionLib.util.deserialize;
31
- __end_M3_solution__ */
32
-
33
28
  // @ts-ignore node.server is lazily initialized.
34
29
  distribution.node = require('./distribution/local/node.js');
35
30
  distribution.local = require('./distribution/local/local.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,