@brown-ds/distribution 0.2.27 → 0.2.28

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=require('./comm.js'),groups=require('./groups.j'+'s'),routes=require('./routes.j'+'s'),status=require('./status.j'+'s'),gossip=require('./gossip.j'+'s'),mem=require('./mem.js'),store=require('./store.js'),mr=require('./mr.js');function setup(_0x7eeca4){return{'comm':comm(_0x7eeca4),'groups':groups(_0x7eeca4),'status':status(_0x7eeca4),'routes':routes(_0x7eeca4),'gossip':gossip(_0x7eeca4),'mem':mem(_0x7eeca4),'store':store(_0x7eeca4),'mr':mr(_0x7eeca4)};}module['exports']={'comm':comm,'groups':groups,'status':status,'routes':routes,'gossip':gossip,'mem':mem,'store':store,'mr':mr,'setup':setup};
9
+ const comm=require('./comm.js'),groups=require('./groups.j'+'s'),routes=require('./routes.j'+'s'),status=require('./status.j'+'s'),gossip=require('./gossip.j'+'s'),mem=require('./mem.js'),store=require('./store.js'),mr=require('./mr.js');function setup(_0x1bc56e){return{'comm':comm(_0x1bc56e),'groups':groups(_0x1bc56e),'status':status(_0x1bc56e),'routes':routes(_0x1bc56e),'gossip':gossip(_0x1bc56e),'mem':mem(_0x1bc56e),'store':store(_0x1bc56e),'mr':mr(_0x1bc56e)};}module['exports']={'comm':comm,'groups':groups,'status':status,'routes':routes,'gossip':gossip,'mem':mem,'store':store,'mr':mr,'setup':setup};
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 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;
9
+ const log=require('../util/lo'+'g.js');function normalize(_0x4437e9,_0xbe3374){if(_0x4437e9===null)return{'key':null,'gid':_0xbe3374};else return typeof _0x4437e9==='string'?{'key':_0x4437e9,'gid':_0xbe3374}:_0x4437e9;}function mem(_0x52687e){const _0x451d69={};_0x451d69['gid']=_0x52687e['gid']||'all',_0x451d69['hash']=_0x52687e['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'];function _0x5b5454(_0xb99429,_0x18cb45){log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0xb99429)+'\x20context:\x20'+JSON['stringify'](_0x451d69)),_0xb99429=normalize(_0xb99429,_0x451d69['gid']),_0xb99429['gid']=_0xb99429['gid']||_0x451d69['gid'];const _0x7fc148={'service':'mem','method':'get'},_0x10e64b=[_0xb99429];if(!_0xb99429['key']){globalThis['distributi'+'on'][_0x451d69['gid']]['comm']['send'](_0x10e64b,_0x7fc148,(_0x43c4af,_0xbed7d5)=>{const _0x20fbad=Object['values'](_0xbed7d5)['reduce']((_0x83f404,_0x2120d3)=>_0x83f404['concat'](_0x2120d3),[]);_0x18cb45(_0x43c4af,_0x20fbad);});return;}const _0x5e1aa3=_0xb99429['key'];if(_0x5e1aa3===null){_0x18cb45(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x10e64b,_0x7fc148,{'key':_0x5e1aa3},_0x451d69,_0x18cb45);return;return _0x18cb45(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function _0x14080e(_0x3382b3,_0x937af6,_0x178af1){log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x3382b3)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x937af6)),_0x937af6=_0x937af6||globalThis['distributi'+'on']['util']['id']['getID'](_0x3382b3),_0x937af6=normalize(_0x937af6,_0x451d69['gid']),_0x937af6['gid']=_0x937af6['gid']||_0x451d69['gid'];const _0x5ae404={'service':'mem','method':'put'},_0x3f59e9=[_0x3382b3,_0x937af6],_0x4be0df=_0x937af6['key'];if(_0x4be0df===null){_0x178af1(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x3f59e9,_0x5ae404,{'key':_0x4be0df},_0x451d69,_0x178af1);return;return _0x178af1(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));}function _0x2dfccf(_0x5b6216,_0x398340,_0x1092a7){log('[all.mem.a'+'ppend]\x20sta'+'te:\x20'+JSON['stringify'](_0x5b6216)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x398340)),_0x398340=_0x398340||globalThis['distributi'+'on']['util']['id']['getID'](_0x5b6216),_0x398340=normalize(_0x398340,_0x451d69['gid']),_0x398340['gid']=_0x398340['gid']||_0x451d69['gid'];const _0x528fd8={'service':'mem','method':'append'},_0x1eb260=[_0x5b6216,_0x398340],_0x26a85c=_0x398340['key'];if(_0x26a85c===null){_0x1092a7(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x1eb260,_0x528fd8,{'key':_0x26a85c},_0x451d69,_0x1092a7);return;return _0x1092a7(new Error('mem.append'+'\x20not\x20imple'+'mented'));}function _0x4cb9a3(_0x2b6242,_0x107b2e){log('[all.mem.d'+'el]\x20config'+'uration:\x20'+JSON['stringify'](_0x2b6242)),_0x2b6242=normalize(_0x2b6242,_0x451d69['gid']),_0x2b6242['gid']=_0x2b6242['gid']||_0x451d69['gid'];const _0x227384={'service':'mem','method':'del'},_0x230988=[_0x2b6242],_0x24b2b4=_0x2b6242['key'];if(_0x24b2b4===null){_0x107b2e(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x230988,_0x227384,{'key':_0x24b2b4},_0x451d69,_0x107b2e);return;return _0x107b2e(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));}function _0x34bd46(_0x291023,_0x495c7b){log('[mem.recon'+'f]\x20configu'+'ration:\x20'+JSON['stringify'](_0x291023)+'\x20gid:\x20'+_0x451d69['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x451d69['gid'],(_0x5bc13b,_0x3b1ade)=>{if(!_0x3b1ade){_0x495c7b(_0x5bc13b);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x451d69['gid'],_0x291023,(_0x1ccccf,_0x1bf0de)=>{globalThis['distributi'+'on'][_0x451d69['gid']]['mem']['get'](null,(_0x3b289c,_0x577a6b)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x451d69['gid'],_0x3b1ade,(_0x55c74f,_0x288c6e)=>{globalThis['distributi'+'on'][_0x451d69['gid']]['status']['get']('nid',(_0xdebfc,_0x327a63)=>{const _0xaa8d4a=Object['values'](_0x327a63),_0x21d5a4=Object['values'](_0x291023)['map'](_0xc7ae0e=>globalThis['distributi'+'on']['util']['id']['getNID'](_0xc7ae0e));log('[mem.recon'+'f\x20received'+'\x20'+_0x577a6b['length']+('\x20keys\x20from'+'\x20')+_0x327a63['length']+'\x20nodes');let _0x2e3f74=0x937+0x1f43+0x3ae*-0xb;const _0x32c236=()=>{if(_0x2e3f74===_0x577a6b['length'])return _0x495c7b(null);};if(_0x577a6b['length']===-0x2*0x521+-0x1*-0x1053+-0x611*0x1)return _0x495c7b(null);for(const _0xe0a89e of _0x577a6b){const _0x1c9b60=globalThis['distributi'+'on']['util']['id']['getID'](_0xe0a89e),_0x3f565a=_0x451d69['hash'](_0x1c9b60,_0x21d5a4),_0x499c3d=_0x451d69['hash'](_0x1c9b60,_0xaa8d4a);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x3f565a+'\x20new\x20nid:\x20'+_0x499c3d);if(_0x3f565a===_0x499c3d){_0x2e3f74++,_0x32c236();continue;}const _0x3c052e=_0x291023[_0x3f565a['substring'](-0x7d1+0x1a56+0x1af*-0xb,-0x16cd+0xdf*0x11+-0x1*-0x803)],_0x37fe40=[{'key':_0xe0a89e,'gid':_0x451d69['gid']}],_0xa73bb4={'service':'mem','method':'del','node':_0x3c052e};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0xe0a89e+'\x20from\x20'+JSON['stringify'](_0xa73bb4)),globalThis['distributi'+'on']['local']['comm']['send'](_0x37fe40,_0xa73bb4,(_0x35e9a5,_0x7d0985)=>{globalThis['distributi'+'on'][_0x451d69['gid']]['mem']['put'](_0x7d0985,_0xe0a89e,(_0x218854,_0x2cf82d)=>{_0x2e3f74++,_0x32c236();});});}});});});});});return;return _0x495c7b(new Error('mem.reconf'+'\x20not\x20imple'+'mented'));}return{'get':_0x5b5454,'put':_0x14080e,'append':_0x2dfccf,'del':_0x4cb9a3,'reconf':_0x34bd46};}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=globalThis['distributi'+'on'],id=distribution['util']['id'];function mr(_0x53fdf5){const _0x2e073b={'gid':_0x53fdf5['gid']||'all'};function _0x375dd2(_0x30fe58,_0x7c6412){const _0x473fd1=id['getID'](_0x30fe58),_0x206bce={'mapper':_0x30fe58['map'],'reducer':_0x30fe58['reduce'],'map':function(_0x3eb462,_0x1415c3,_0x353967,_0x1c23bc){if(_0x3eb462['length']==0x2*-0x9a7+0x24c7*-0x1+0x3815){_0x1c23bc(null,[]);return;}else{const _0x1a43f3=[];let _0xea1278=0x2683+0x121f*0x1+-0x38a2;_0x3eb462['forEach'](_0x3f391b=>{globalThis['distributi'+'on'][_0x1415c3]['store']['get'](_0x3f391b,(_0x50f109,_0x3e0495)=>{_0xea1278++;const _0x487f72=this['mapper'](_0x3f391b,_0x3e0495);Array['isArray'](_0x487f72)?_0x1a43f3['push'](..._0x487f72):_0x1a43f3['push'](_0x487f72),_0xea1278==_0x3eb462['length']&&distribution['local']['store']['put'](_0x1a43f3,_0x353967+'_map',(_0x4f0612,_0x408d9e)=>{_0x1c23bc(_0x4f0612,_0x1a43f3);});});});}},'shuffle':function(_0x5ece1e,_0x5a807d,_0x2c21ec){distribution['local']['store']['get'](_0x5a807d+'_map',(_0x114763,_0x48df1d)=>{if(!_0x114763){let _0x3b9810=0x19d+-0x5*-0x665+-0x599*0x6;_0x48df1d['forEach'](_0x46ed8a=>{const [_0x37e90a]=Object['keys'](_0x46ed8a);distribution[_0x5ece1e]['mem']['put'](_0x46ed8a[_0x37e90a],{'key':_0x37e90a,'action':'append','gid':_0x5ece1e},(_0x90ca69,_0x381c37)=>{_0x3b9810++;if(_0x3b9810==_0x48df1d['length'])return _0x2c21ec(null,_0x48df1d);});});}else return _0x2c21ec(_0x114763,{});});},'reduce':function(_0x182b15,_0x335121,_0x276198){distribution['local']['mem']['get']({'key':null,'gid':_0x182b15},(_0xb17b97,_0x2241f2)=>{let _0x2318d2=[],_0x201040=-0x1*-0x6a2+-0xb6*-0x3+-0xc*0xbb;if(_0x2241f2['length']==0xcd9+0xecf*0x1+-0x1ba8)return _0x276198(null,null);_0x2241f2['forEach'](_0x1b9a85=>distribution['local']['mem']['get']({'key':_0x1b9a85,'gid':_0x182b15},(_0x596ee6,_0x5b2ed0)=>{const _0xa81146=this['reducer'](_0x1b9a85,_0x5b2ed0);_0x2318d2=_0x2318d2['concat'](_0xa81146),_0x201040++;if(_0x201040==_0x2241f2['length'])return _0x276198(null,_0x2318d2);}));});}},_0x27b4a0=function(_0x567508,_0x4cc380){const _0x25d09a={};return Object['keys'](_0x4cc380)['forEach'](_0xd9cab7=>{_0x25d09a[_0xd9cab7]=[];}),_0x567508['forEach'](_0x53bf95=>{const _0xdc1fea=id['getID'](_0x53bf95),_0x3c31aa=id['naiveHash'](_0xdc1fea,Object['keys'](_0x4cc380));_0x25d09a[_0x3c31aa]['push'](_0x53bf95);}),_0x25d09a;};distribution[_0x2e073b['gid']]['routes']['put'](_0x206bce,'mr-'+_0x473fd1,(_0x228736,_0x84eff2)=>{distribution['local']['groups']['get'](_0x2e073b['gid'],(_0x2f9687,_0x50a215)=>{if(!_0x50a215){_0x7c6412(_0x2f9687);return;}const _0x1ea321=_0x27b4a0(_0x30fe58['keys'],_0x50a215);let _0x843e6a=0xc8c+-0xe*-0x14+-0xda4;const _0x13e409=Object['keys'](_0x50a215)['length'],_0x411548={'service':'mr-'+_0x473fd1,'method':'map'};for(const _0x537e81 in _0x50a215){const _0x4193bb=[_0x1ea321[_0x537e81],_0x2e073b['gid'],_0x473fd1];distribution['local']['comm']['send'](_0x4193bb,{'node':_0x50a215[_0x537e81],..._0x411548},(_0x12bf09,_0x2d9be3)=>{++_0x843e6a;if(_0x843e6a==_0x13e409){const _0x56f58c={'service':'mr-'+_0x473fd1,'method':'shuffle'};distribution[_0x2e073b['gid']]['comm']['send']([_0x2e073b['gid'],_0x473fd1],_0x56f58c,(_0x20c2dc,_0x2b7b57)=>{const _0x3cc6ef={'service':'mr-'+_0x473fd1,'method':'reduce'};distribution[_0x2e073b['gid']]['comm']['send']([_0x2e073b['gid'],_0x473fd1],_0x3cc6ef,(_0x5b4cd1,_0x4772d8)=>{let _0x195e5a=[];for(const _0x2bf2eb of Object['values'](_0x4772d8)){_0x2bf2eb!==null&&(_0x195e5a=_0x195e5a['concat'](_0x2bf2eb));}_0x7c6412(null,_0x195e5a);return;});});}});}});});return;return _0x7c6412(new Error('mr.exec\x20no'+'t\x20implemen'+'ted'));}return{'exec':_0x375dd2};}module['exports']=mr;
9
+ const distribution=globalThis['distributi'+'on'],id=distribution['util']['id'];function mr(_0x25f9a5){const _0x16c53a={'gid':_0x25f9a5['gid']||'all'};function _0x160adf(_0x406070,_0x56170f){const _0x41d2b4=id['getID'](_0x406070),_0x29e82b={'mapper':_0x406070['map'],'reducer':_0x406070['reduce'],'map':function(_0xa5e15,_0x55a414,_0x5e9259,_0x192a26){if(_0xa5e15['length']==0x1ad3+-0x7be*0x5+0x1*0xbe3){_0x192a26(null,[]);return;}else{const _0x1abc44=[];let _0x1f1cc2=-0x5f1*-0x2+-0x1ad1+-0x1*-0xeef;_0xa5e15['forEach'](_0x5d84dc=>{globalThis['distributi'+'on'][_0x55a414]['store']['get'](_0x5d84dc,(_0x28e361,_0x543a91)=>{_0x1f1cc2++;const _0x55496c=this['mapper'](_0x5d84dc,_0x543a91);Array['isArray'](_0x55496c)?_0x1abc44['push'](..._0x55496c):_0x1abc44['push'](_0x55496c),_0x1f1cc2==_0xa5e15['length']&&distribution['local']['store']['put'](_0x1abc44,_0x5e9259+'_map',(_0x2e88ed,_0x8e9330)=>{_0x192a26(_0x2e88ed,_0x1abc44);});});});}},'shuffle':function(_0x1de969,_0x349f69,_0x461db2){distribution['local']['store']['get'](_0x349f69+'_map',(_0x4ec934,_0x2cf67a)=>{if(!_0x4ec934){let _0x3aa135=-0x2f3+0x2*0xb7b+0x2f*-0x6d;_0x2cf67a['forEach'](_0x17eb95=>{const [_0x2fbf2d]=Object['keys'](_0x17eb95);distribution[_0x1de969]['mem']['append'](_0x17eb95[_0x2fbf2d],{'key':_0x2fbf2d,'gid':_0x1de969},(_0x35805e,_0x1f9694)=>{_0x3aa135++;if(_0x3aa135==_0x2cf67a['length'])return _0x461db2(null,_0x2cf67a);});});}else return _0x461db2(_0x4ec934,{});});},'reduce':function(_0x59eda8,_0x554392,_0x3f0bb0){distribution['local']['mem']['get']({'key':null,'gid':_0x59eda8},(_0x19667b,_0x352208)=>{let _0x6b156=[],_0x2d10ff=0xc23+-0x1d9f*-0x1+0x29c2*-0x1;if(_0x352208['length']==0x1e5c+0x9*0x3fd+-0x1*0x4241)return _0x3f0bb0(null,null);_0x352208['forEach'](_0x7e2960=>distribution['local']['mem']['get']({'key':_0x7e2960,'gid':_0x59eda8},(_0x2eb699,_0x377d78)=>{const _0x558c4e=this['reducer'](_0x7e2960,_0x377d78);_0x6b156=_0x6b156['concat'](_0x558c4e),_0x2d10ff++;if(_0x2d10ff==_0x352208['length'])return _0x3f0bb0(null,_0x6b156);}));});}},_0x15b668=function(_0x5ece1b,_0x215632){const _0x189e93={};return Object['keys'](_0x215632)['forEach'](_0x483faf=>{_0x189e93[_0x483faf]=[];}),_0x5ece1b['forEach'](_0x562a17=>{const _0xe0f709=id['getID'](_0x562a17),_0x3530a4=id['naiveHash'](_0xe0f709,Object['keys'](_0x215632));_0x189e93[_0x3530a4]['push'](_0x562a17);}),_0x189e93;};distribution[_0x16c53a['gid']]['routes']['put'](_0x29e82b,'mr-'+_0x41d2b4,(_0x36c17a,_0x4f3a40)=>{distribution['local']['groups']['get'](_0x16c53a['gid'],(_0x36e667,_0x2bfc9d)=>{if(!_0x2bfc9d){_0x56170f(_0x36e667);return;}const _0x34d3af=_0x15b668(_0x406070['keys'],_0x2bfc9d);let _0x2878b9=0xdc2+-0x2d9+0xae9*-0x1;const _0x26c7e0=Object['keys'](_0x2bfc9d)['length'],_0x4c77b8={'service':'mr-'+_0x41d2b4,'method':'map'};for(const _0x3b82fb in _0x2bfc9d){const _0x13d664=[_0x34d3af[_0x3b82fb],_0x16c53a['gid'],_0x41d2b4];distribution['local']['comm']['send'](_0x13d664,{'node':_0x2bfc9d[_0x3b82fb],..._0x4c77b8},(_0x43bdb0,_0x277934)=>{++_0x2878b9;if(_0x2878b9==_0x26c7e0){const _0x290af0={'service':'mr-'+_0x41d2b4,'method':'shuffle'};distribution[_0x16c53a['gid']]['comm']['send']([_0x16c53a['gid'],_0x41d2b4],_0x290af0,(_0x2624f3,_0x3c7ed1)=>{const _0x51f770={'service':'mr-'+_0x41d2b4,'method':'reduce'};distribution[_0x16c53a['gid']]['comm']['send']([_0x16c53a['gid'],_0x41d2b4],_0x51f770,(_0x5404f6,_0x51c8fe)=>{let _0x5eacea=[];for(const _0x12fca4 of Object['values'](_0x51c8fe)){_0x12fca4!==null&&(_0x5eacea=_0x5eacea['concat'](_0x12fca4));}_0x56170f(null,_0x5eacea);return;});});}});}});});return;return _0x56170f(new Error('mr.exec\x20no'+'t\x20implemen'+'ted'));}return{'exec':_0x160adf};}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 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;
9
+ const log=require('../util/lo'+'g.js');function getNode(_0x4e8249,_0x45a5d3,_0x412239){const _0x58b897=_0x45a5d3&&typeof _0x45a5d3==='object'?_0x45a5d3['key']:_0x45a5d3;globalThis['distributi'+'on'][_0x4e8249['gid']]['status']['get']('nid',(_0x4699fc,_0x8c6c0e)=>{const _0x39f54a=Object['values'](_0x8c6c0e),_0x55cee8=globalThis['distributi'+'on']['util']['id']['getID'](_0x58b897),_0x3497f6=_0x4e8249['hash'](_0x55cee8,_0x39f54a),_0x15216c=_0x3497f6['substring'](-0x2e*0xe+0x24b+0x39*0x1,-0x2092+0x1a65+0x632);globalThis['distributi'+'on']['local']['groups']['get'](_0x4e8249['gid'],(_0x2b8d28,_0x109948)=>{if(!_0x109948)return _0x412239(_0x2b8d28);else{const _0x24c8a5=_0x109948[_0x15216c];return log('[store\x20(ge'+'tNode)]\x20co'+'nfiguratio'+'n:\x20'+JSON['stringify'](_0x45a5d3)+'group:\x20'+JSON['stringify'](_0x109948)+'\x20node:\x20'+JSON['stringify'](_0x24c8a5)+'nid:\x20'+JSON['stringify'](_0x3497f6)+'\x20sid:\x20'+JSON['stringify'](_0x15216c)),_0x412239(null,_0x24c8a5);}});});}function normalize(_0x14506a,_0xc99f63){if(_0x14506a===null)return{'key':null,'gid':_0xc99f63};else return typeof _0x14506a==='string'?{'key':_0x14506a,'gid':_0xc99f63}:_0x14506a;}function store(_0x587398){const _0x262c29={'gid':_0x587398['gid']||'all','hash':_0x587398['hash']||globalThis['distributi'+'on']['util']['id']['naiveHash'],'subset':_0x587398['subset']};function _0xd35ee(_0x296d2c,_0x583295){if(!_0x296d2c){const _0x43a8d2=[{'key':null,'gid':_0x262c29['gid']}];globalThis['distributi'+'on'][_0x262c29['gid']]['comm']['send'](_0x43a8d2,{'service':'store','method':'get'},(_0x209fbf,_0x59f126)=>{const _0x499f50=Object['values'](_0x59f126)['reduce']((_0x20c333,_0x328dd6)=>_0x20c333['concat'](_0x328dd6),[]);_0x583295(_0x209fbf,_0x499f50);});return;}_0x296d2c=normalize(_0x296d2c,_0x262c29['gid']),getNode(_0x262c29,_0x296d2c,(_0x55e145,_0x16ee7b)=>{if(!_0x16ee7b){_0x583295(_0x55e145);return;}const _0x4d87cf=[_0x296d2c],_0xb01a54={'service':'store','method':'get','node':_0x16ee7b};log('[all.store'+'.get]confi'+'guration:\x20'+JSON['stringify'](_0x296d2c)+'node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x16ee7b)),globalThis['distributi'+'on']['local']['comm']['send'](_0x4d87cf,_0xb01a54,_0x583295);});return;return _0x583295(new Error('store.get\x20'+'not\x20implem'+'ented'));}function _0x2f0e55(_0x519d27,_0x57e991,_0x2df51b){_0x57e991=_0x57e991||globalThis['distributi'+'on']['util']['id']['getID'](_0x519d27),_0x57e991=normalize(_0x57e991,_0x262c29['gid']),getNode(_0x262c29,_0x57e991,(_0x28b335,_0x4f35ba)=>{if(!_0x4f35ba){_0x2df51b(_0x28b335);return;}const _0x2edddd=[_0x519d27,_0x57e991],_0x526514={'service':'store','method':'put','node':_0x4f35ba};log('[all.store'+'.put]\x20stat'+'e:\x20'+JSON['stringify'](_0x519d27)+('configurat'+'ion:\x20')+JSON['stringify'](_0x57e991)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x4f35ba)),globalThis['distributi'+'on']['local']['comm']['send'](_0x2edddd,_0x526514,_0x2df51b);});return;return _0x2df51b(new Error('store.put\x20'+'not\x20implem'+'ented'));}function _0x5cdd05(_0x2f118d,_0x1c3ac3,_0x3ad44b){_0x1c3ac3=_0x1c3ac3||globalThis['distributi'+'on']['util']['id']['getID'](_0x2f118d),_0x1c3ac3=normalize(_0x1c3ac3,_0x262c29['gid']),getNode(_0x262c29,_0x1c3ac3,(_0x2a3a99,_0xe2de4a)=>{if(!_0xe2de4a){_0x3ad44b(_0x2a3a99);return;}const _0x510cc9=[_0x2f118d,_0x1c3ac3],_0x18badd={'service':'store','method':'append','node':_0xe2de4a};log('[all.store'+'.append]\x20s'+'tate:\x20'+JSON['stringify'](_0x2f118d)+('configurat'+'ion:\x20')+JSON['stringify'](_0x1c3ac3)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0xe2de4a)),globalThis['distributi'+'on']['local']['comm']['send'](_0x510cc9,_0x18badd,_0x3ad44b);});return;return _0x3ad44b(new Error('store.appe'+'nd\x20not\x20imp'+'lemented'));}function _0x14ce0c(_0x201c6f,_0x4228c9){getNode(_0x262c29,_0x201c6f,(_0x3a68ef,_0x3f45e2)=>{if(!_0x3f45e2){_0x4228c9(_0x3a68ef);return;}const _0x273cc1=[{'key':_0x201c6f,'gid':_0x262c29['gid']}],_0x18e4a7={'service':'store','method':'del','node':_0x3f45e2};globalThis['distributi'+'on']['local']['comm']['send'](_0x273cc1,_0x18e4a7,_0x4228c9);});return;return _0x4228c9(new Error('store.del\x20'+'not\x20implem'+'ented'));}function _0x522293(_0x259174,_0xb02e11){log('[store.rec'+'onf]\x20confi'+'guration:\x20'+JSON['stringify'](_0x259174)+'\x20gid:\x20'+_0x262c29['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x262c29['gid'],(_0x356dfc,_0x478c78)=>{if(!_0x478c78){_0xb02e11(_0x356dfc);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x262c29['gid'],_0x259174,(_0x35ff4f,_0x2117ff)=>{globalThis['distributi'+'on'][_0x262c29['gid']]['store']['get'](null,(_0x1d69aa,_0x3ed3ac)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x262c29['gid'],_0x478c78,(_0x42e07d,_0x2fde84)=>{globalThis['distributi'+'on'][_0x262c29['gid']]['status']['get']('nid',(_0x3c01e1,_0x5b2e1d)=>{const _0x3aed75=Object['values'](_0x5b2e1d),_0x4b2e88=Object['values'](_0x259174)['map'](_0x4ca6bc=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x4ca6bc));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x3ed3ac['length']+('\x20keys\x20from'+'\x20')+_0x5b2e1d['length']+'\x20nodes');let _0x3047e1=0xd*-0xa3+-0x42c+0xc73;const _0x30884a=()=>{if(_0x3047e1===_0x3ed3ac['length'])return _0xb02e11(null);};if(_0x3ed3ac['length']===-0x1e8+-0x9fd*-0x2+-0x1212)return _0xb02e11(null);for(const _0x359399 of _0x3ed3ac){const _0x542df0=globalThis['distributi'+'on']['util']['id']['getID'](_0x359399),_0x4eb824=_0x262c29['hash'](_0x542df0,_0x4b2e88),_0x470615=_0x262c29['hash'](_0x542df0,_0x3aed75);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x4eb824+'\x20new\x20nid:\x20'+_0x470615);if(_0x4eb824===_0x470615){_0x3047e1++,_0x30884a();continue;}const _0x14eec5=_0x259174[_0x4eb824['substring'](-0x266e*0x1+0x1*-0xdc9+0x1*0x3437,0x16a*0xb+0xe*0xa5+-0x188f)],_0x1449e9=[{'key':_0x359399,'gid':_0x262c29['gid']}],_0x1ce999={'service':'store','method':'del','node':_0x14eec5};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x359399+'\x20from\x20'+JSON['stringify'](_0x1ce999)),globalThis['distributi'+'on']['local']['comm']['send'](_0x1449e9,_0x1ce999,(_0x175068,_0x26d649)=>{globalThis['distributi'+'on'][_0x262c29['gid']]['store']['put'](_0x26d649,_0x359399,(_0x4c0f9c,_0x404df2)=>{_0x3047e1++,_0x30884a();});});}});});});});});return;return _0xb02e11(new Error('store.reco'+'nf\x20not\x20imp'+'lemented'));}return{'get':_0xd35ee,'put':_0x2f0e55,'append':_0x5cdd05,'del':_0x14ce0c,'reconf':_0x522293};}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 log=require('../util/lo'+'g'),kvStore={'store':{},'get'(_0x5aa73a){if(!this['store'][_0x5aa73a['gid']])return undefined;return this['store'][_0x5aa73a['gid']][_0x5aa73a['key']];},'put'(_0xf5d67f,_0x2895ce){!this['store'][_0xf5d67f['gid']]&&(this['store'][_0xf5d67f['gid']]={}),this['store'][_0xf5d67f['gid']][_0xf5d67f['key']]=_0x2895ce;},'append'(_0x32e330,_0x3055e7){!this['get'](_0x32e330)&&this['put'](_0x32e330,[]),!Array['isArray'](this['get'](_0x32e330))&&this['put'](_0x32e330,[this['get'](_0x32e330)]),Array['isArray'](_0x3055e7)?this['put'](_0x32e330,this['get'](_0x32e330)['concat'](_0x3055e7)):this['store'][_0x32e330['gid']][_0x32e330['key']]['push'](_0x3055e7);},'del'(_0x86ae5d){if(!this['store'][_0x86ae5d['gid']])return undefined;const _0x635988=this['store'][_0x86ae5d['gid']][_0x86ae5d['key']];return delete this['store'][_0x86ae5d['gid']][_0x86ae5d['key']],_0x635988;},'toString'(){let _0x4229f4='';for(const _0x5d498c in this['store']){_0x4229f4+=_0x5d498c+':\x20'+JSON['stringify'](this['store'][_0x5d498c]);}return _0x4229f4;}};function normalize(_0x57caaa){if(_0x57caaa===null)return{'key':null,'gid':null,'action':null};else return typeof _0x57caaa==='string'?{'key':_0x57caaa,'gid':null,'action':null}:_0x57caaa;};function put(_0x15cbdd,_0x53d7ff,_0x500cc5){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x53d7ff)+'\x20state:\x20'+JSON['stringify'](_0x15cbdd)+'\x20store:\x20'+kvStore['toString']());let {key:_0x2d9e3a,gid:_0x25df00,action:_0xb8954a}=normalize(_0x53d7ff);_0x2d9e3a=_0x2d9e3a||globalThis['distributi'+'on']['util']['id']['getID'](_0x15cbdd),_0x25df00=_0x25df00||'local',_0xb8954a=_0xb8954a||'put',kvStore[_0xb8954a]({'key':_0x2d9e3a,'gid':_0x25df00},_0x15cbdd),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());if(_0x500cc5)return _0x500cc5(null,_0x15cbdd);return;return _0x500cc5(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));};function get(_0x2355f1,_0x18fbe7){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x2355f1)+'\x20store:\x20'+kvStore['toString']());let {key:_0x40f2d1,gid:_0x2c958b}=normalize(_0x2355f1);_0x2c958b=_0x2c958b||'local';if(_0x40f2d1){const _0x5ba27a=kvStore['get']({'key':_0x40f2d1,'gid':_0x2c958b});return _0x5ba27a?_0x18fbe7(null,_0x5ba27a):_0x18fbe7(new Error('Memory\x20key'+'\x20\x22'+_0x40f2d1+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x2c958b+'\x27s\x20store'));}else{let _0x2d5b05=kvStore['store'][_0x2c958b]||{};return _0x2d5b05=Object['keys'](_0x2d5b05),_0x18fbe7(null,_0x2d5b05);}return;return _0x18fbe7(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function del(_0x29ca8e,_0x33fa07){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x29ca8e)+'\x20store:\x20'+kvStore['toString']());let {key:_0x5dc147,gid:_0x5caab1}=normalize(_0x29ca8e);_0x5caab1=_0x5caab1||'local';const _0x466918=kvStore['del']({'key':_0x5dc147,'gid':_0x5caab1});log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());return _0x466918?_0x33fa07(null,_0x466918):_0x33fa07(new Error('Memory\x20key'+'\x20\x22'+_0x5dc147+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x5caab1+'\x27s\x20store'));return;return _0x33fa07(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));};module['exports']={'put':put,'get':get,'del':del};
9
+ const log=require('../util/lo'+'g'),kvStore={'store':{},'get'(_0xbf1509){if(!this['store'][_0xbf1509['gid']])return undefined;return this['store'][_0xbf1509['gid']][_0xbf1509['key']];},'put'(_0xab28a4,_0x3aba34){!this['store'][_0xab28a4['gid']]&&(this['store'][_0xab28a4['gid']]={}),this['store'][_0xab28a4['gid']][_0xab28a4['key']]=_0x3aba34;},'append'(_0x4362f4,_0x1cb69c){!this['get'](_0x4362f4)&&this['put'](_0x4362f4,[]),!Array['isArray'](this['get'](_0x4362f4))&&this['put'](_0x4362f4,[this['get'](_0x4362f4)]),Array['isArray'](_0x1cb69c)?this['put'](_0x4362f4,this['get'](_0x4362f4)['concat'](_0x1cb69c)):this['store'][_0x4362f4['gid']][_0x4362f4['key']]['push'](_0x1cb69c);},'del'(_0x53be48){if(!this['store'][_0x53be48['gid']])return undefined;const _0x2acd24=this['store'][_0x53be48['gid']][_0x53be48['key']];return delete this['store'][_0x53be48['gid']][_0x53be48['key']],_0x2acd24;},'toString'(){let _0x1a7bdb='';for(const _0x20b178 in this['store']){_0x1a7bdb+=_0x20b178+':\x20'+JSON['stringify'](this['store'][_0x20b178]);}return _0x1a7bdb;}};function normalize(_0x1b1bf1){if(_0x1b1bf1===null)return{'key':null,'gid':null};else return typeof _0x1b1bf1==='string'?{'key':_0x1b1bf1,'gid':null}:_0x1b1bf1;};function put(_0xc76ba7,_0x815c36,_0xd42bbf){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x815c36)+'\x20state:\x20'+JSON['stringify'](_0xc76ba7)+'\x20store:\x20'+kvStore['toString']());let {key:_0x46fc05,gid:_0x58a0a7}=normalize(_0x815c36);_0x46fc05=_0x46fc05||globalThis['distributi'+'on']['util']['id']['getID'](_0xc76ba7),_0x58a0a7=_0x58a0a7||'local',kvStore['put']({'key':_0x46fc05,'gid':_0x58a0a7},_0xc76ba7),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());if(_0xd42bbf)return _0xd42bbf(null,_0xc76ba7);return;return _0xd42bbf(new Error('mem.put\x20no'+'t\x20implemen'+'ted'));};function append(_0x473c00,_0x589a9b,_0x106c41){log('[mem.appen'+'d]\x20configu'+'ration:\x20'+JSON['stringify'](_0x589a9b)+'\x20state:\x20'+JSON['stringify'](_0x473c00)+'\x20store:\x20'+kvStore['toString']());let {key:_0x270d21,gid:_0x518f40}=normalize(_0x589a9b);_0x270d21=_0x270d21||globalThis['distributi'+'on']['util']['id']['getID'](_0x473c00),_0x518f40=_0x518f40||'local';if(!_0x270d21)return _0x106c41(new Error('Configurat'+'ion\x20key\x20is'+'\x20required\x20'+'for\x20append'));kvStore['append']({'key':_0x270d21,'gid':_0x518f40},_0x473c00),log('[mem.appen'+'d]\x20store\x20('+'after):\x20'+kvStore['toString']());const _0x3dded9=kvStore['get']({'key':_0x270d21,'gid':_0x518f40});if(_0x106c41)return _0x106c41(null,_0x3dded9);return;return _0x106c41(new Error('mem.append'+'\x20not\x20imple'+'mented'));};function get(_0x1976f9,_0x544523){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x1976f9)+'\x20store:\x20'+kvStore['toString']());let {key:_0x451d65,gid:_0x42140e}=normalize(_0x1976f9);_0x42140e=_0x42140e||'local';if(_0x451d65){const _0x5d64f0=kvStore['get']({'key':_0x451d65,'gid':_0x42140e});return _0x5d64f0?_0x544523(null,_0x5d64f0):_0x544523(new Error('Memory\x20key'+'\x20\x22'+_0x451d65+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x42140e+'\x27s\x20store'));}else{let _0x453235=kvStore['store'][_0x42140e]||{};return _0x453235=Object['keys'](_0x453235),_0x544523(null,_0x453235);}return;return _0x544523(new Error('mem.get\x20no'+'t\x20implemen'+'ted'));}function del(_0x562e2f,_0x43a87d){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x562e2f)+'\x20store:\x20'+kvStore['toString']());let {key:_0x5c1c6a,gid:_0x57bb89}=normalize(_0x562e2f);_0x57bb89=_0x57bb89||'local';const _0x4ccb01=kvStore['del']({'key':_0x5c1c6a,'gid':_0x57bb89});log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());return _0x4ccb01?_0x43a87d(null,_0x4ccb01):_0x43a87d(new Error('Memory\x20key'+'\x20\x22'+_0x5c1c6a+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x57bb89+'\x27s\x20store'));return;return _0x43a87d(new Error('mem.del\x20no'+'t\x20implemen'+'ted'));};module['exports']={'put':put,'get':get,'del':del,'append':append};
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'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);const nodeFolder=path['join'](baseFolder,'s-'+globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));!fs['existsSync'](nodeFolder)&&fs['mkdirSync'](nodeFolder);function normalize(_0x2e334a){if(_0x2e334a===null)return{'key':null,'gid':null,'action':'put'};else return typeof _0x2e334a==='string'?{'key':_0x2e334a,'gid':null,'action':'put'}:_0x2e334a;}function put(_0x4ec3e5,_0x550b25,_0x4f84e5){log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x550b25)+'\x20state:\x20'+JSON['stringify'](_0x4ec3e5)),_0x550b25=normalize(_0x550b25),_0x550b25['key']=_0x550b25['key']||globalThis['distributi'+'on']['util']['id']['getID'](_0x4ec3e5),_0x550b25['gid']=_0x550b25['gid']||'local';const _0x11c45f=globalThis['distributi'+'on']['util']['serialize'](_0x4ec3e5),_0x5e766c=Buffer['from'](_0x550b25['key'])['toString']('base64'),_0x4f4ec0=path['join'](nodeFolder,_0x550b25['gid']+'-'+_0x5e766c);fs['writeFile'](_0x4f4ec0,_0x11c45f,_0x4f7adb=>{return _0x4f7adb?_0x4f84e5(_0x4f7adb):_0x4f84e5(null,_0x4ec3e5);});return;return _0x4f84e5(new Error('store.put\x20'+'not\x20implem'+'ented'));}function get(_0x1014f3,_0x423047){log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x1014f3)),_0x1014f3=normalize(_0x1014f3),_0x1014f3['gid']=_0x1014f3['gid']||'local';if(!_0x1014f3['key']){fs['readdir'](nodeFolder,(_0x422361,_0x4b570e)=>{if(_0x422361)return _0x423047(_0x422361);const _0x16120c=[];for(let _0x4d414c=0x1f2d*0x1+0x193d+0x6*-0x967;_0x4d414c<_0x4b570e['length'];_0x4d414c++){const _0x5ce055=_0x4b570e[_0x4d414c]['split']('-'),_0x237633=_0x5ce055[-0x1244+0x1f+0x5*0x3a1];if(_0x237633!==_0x1014f3['gid'])continue;const _0x341e7c=_0x5ce055[_0x5ce055['length']-(0x63*-0x23+-0x15e2+0x236c)];_0x16120c['push'](Buffer['from'](_0x341e7c,'base64')['toString']());}return _0x423047(null,_0x16120c);});return;}const _0x50d4d6=Buffer['from'](_0x1014f3['key'])['toString']('base64'),_0x3c02a1=path['join'](nodeFolder,_0x1014f3['gid']+'-'+_0x50d4d6);fs['readFile'](_0x3c02a1,(_0x54785b,_0x529a35)=>{return _0x54785b?_0x54785b['code']==='ENOENT'?_0x423047(new Error('File\x20'+_0x3c02a1+('\x20(from\x20key'+'\x20\x27')+_0x1014f3['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x1014f3['gid'])):_0x423047(_0x54785b):_0x423047(null,globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x529a35['toString']()));});return;return _0x423047(new Error('store.get\x20'+'not\x20implem'+'ented'));}function del(_0x3ba923,_0x45a8ea){log('[store.del'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x3ba923)),_0x3ba923=normalize(_0x3ba923),_0x3ba923['gid']=_0x3ba923['gid']||'local';const _0x2fea1a=Buffer['from'](_0x3ba923['key'])['toString']('base64'),_0x213b6a=path['join'](nodeFolder,_0x3ba923['gid']+'-'+_0x2fea1a);get(_0x3ba923,(_0x220f79,_0x1fb5ce)=>{if(_0x220f79)return _0x45a8ea(_0x220f79);fs['rm'](_0x213b6a,_0x25358d=>{return _0x25358d?_0x45a8ea(_0x25358d):_0x45a8ea(null,_0x1fb5ce);});});return;return _0x45a8ea(new Error('store.del\x20'+'not\x20implem'+'ented'));}module['exports']={'put':put,'get':get,'del':del};
9
+ const fs=require('fs'),path=require('path'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);const nodeFolder=path['join'](baseFolder,'s-'+globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));!fs['existsSync'](nodeFolder)&&fs['mkdirSync'](nodeFolder);function normalize(_0x173895){if(_0x173895===null)return{'key':null,'gid':null};else return typeof _0x173895==='string'?{'key':_0x173895,'gid':null}:_0x173895;}function put(_0x5d8678,_0x3f2b2a,_0x4c7881){log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x3f2b2a)+'\x20state:\x20'+JSON['stringify'](_0x5d8678)),_0x3f2b2a=normalize(_0x3f2b2a),_0x3f2b2a['key']=_0x3f2b2a['key']||globalThis['distributi'+'on']['util']['id']['getID'](_0x5d8678),_0x3f2b2a['gid']=_0x3f2b2a['gid']||'local';const _0x55d57f=globalThis['distributi'+'on']['util']['serialize'](_0x5d8678),_0x413a5c=Buffer['from'](_0x3f2b2a['key'])['toString']('base64'),_0x43d508=path['join'](nodeFolder,_0x3f2b2a['gid']+'-'+_0x413a5c);fs['writeFile'](_0x43d508,_0x55d57f,_0x3d5e4d=>{return _0x3d5e4d?_0x4c7881(_0x3d5e4d):_0x4c7881(null,_0x5d8678);});return;return _0x4c7881(new Error('store.put\x20'+'not\x20implem'+'ented'));}function get(_0x2968d0,_0x5ce40d){log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x2968d0)),_0x2968d0=normalize(_0x2968d0),_0x2968d0['gid']=_0x2968d0['gid']||'local';if(!_0x2968d0['key']){fs['readdir'](nodeFolder,(_0x5e2fe5,_0x47cd19)=>{if(_0x5e2fe5)return _0x5ce40d(_0x5e2fe5);const _0x112293=[];for(let _0x281063=-0x5ad*-0x1+-0x1153+-0x2a*-0x47;_0x281063<_0x47cd19['length'];_0x281063++){const _0x4a391f=_0x47cd19[_0x281063]['split']('-'),_0x540ef8=_0x4a391f[-0xb1b*0x3+-0x474+0x25c5];if(_0x540ef8!==_0x2968d0['gid'])continue;const _0x51f1df=_0x4a391f[_0x4a391f['length']-(-0x1*0x4f9+-0x236f+0x2869)];_0x112293['push'](Buffer['from'](_0x51f1df,'base64')['toString']());}return _0x5ce40d(null,_0x112293);});return;}const _0x26045e=Buffer['from'](_0x2968d0['key'])['toString']('base64'),_0x279361=path['join'](nodeFolder,_0x2968d0['gid']+'-'+_0x26045e);fs['readFile'](_0x279361,(_0x435cba,_0x3f816d)=>{return _0x435cba?_0x435cba['code']==='ENOENT'?_0x5ce40d(new Error('File\x20'+_0x279361+('\x20(from\x20key'+'\x20\x27')+_0x2968d0['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x2968d0['gid'])):_0x5ce40d(_0x435cba):_0x5ce40d(null,globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x3f816d['toString']()));});return;return _0x5ce40d(new Error('store.get\x20'+'not\x20implem'+'ented'));}function del(_0x384bab,_0x1dd0cd){log('[store.del'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x384bab)),_0x384bab=normalize(_0x384bab),_0x384bab['gid']=_0x384bab['gid']||'local';const _0x1e7596=Buffer['from'](_0x384bab['key'])['toString']('base64'),_0x23451e=path['join'](nodeFolder,_0x384bab['gid']+'-'+_0x1e7596);get(_0x384bab,(_0x19fd95,_0x4541dd)=>{if(_0x19fd95)return _0x1dd0cd(_0x19fd95);fs['rm'](_0x23451e,_0x57d804=>{return _0x57d804?_0x1dd0cd(_0x57d804):_0x1dd0cd(null,_0x4541dd);});});return;return _0x1dd0cd(new Error('store.del\x20'+'not\x20implem'+'ented'));}function append(_0x3200de,_0x428db0,_0xc98a04){log('[store.app'+'end]\x20confi'+'guration:\x20'+JSON['stringify'](_0x428db0)+'\x20state:\x20'+JSON['stringify'](_0x3200de)),_0x428db0=normalize(_0x428db0),_0x428db0['key']=_0x428db0['key']||globalThis['distributi'+'on']['util']['id']['getID'](_0x3200de),_0x428db0['gid']=_0x428db0['gid']||'local';const _0x26cb35=Buffer['from'](_0x428db0['key'])['toString']('base64'),_0x324711=path['join'](nodeFolder,_0x428db0['gid']+'-'+_0x26cb35),_0x2608b4=_0xc16035=>{const _0x352de5=globalThis['distributi'+'on']['util']['serialize'](_0xc16035);fs['writeFile'](_0x324711,_0x352de5,_0x5474f2=>{if(_0x5474f2)return _0xc98a04(_0x5474f2);return _0xc98a04(null,_0xc16035);});};return fs['readFile'](_0x324711,(_0x1031a6,_0x2a8851)=>{if(_0x1031a6){if(_0x1031a6['code']==='ENOENT'){const _0x4adc0e=Array['isArray'](_0x3200de)?_0x3200de:[_0x3200de];return _0x2608b4(_0x4adc0e);}return _0xc98a04(_0x1031a6);}let _0x46b091;try{_0x46b091=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x2a8851['toString']());}catch(_0x122b8d){return _0xc98a04(_0x122b8d);}!Array['isArray'](_0x46b091)&&(_0x46b091=[_0x46b091]);const _0x5ee081=Array['isArray'](_0x3200de)?_0x46b091['concat'](_0x3200de):_0x46b091['concat']([_0x3200de]);return _0x2608b4(_0x5ee081);}),_0xc98a04(new Error('store.appe'+'nd\x20not\x20imp'+'lemented'));}module['exports']={'put':put,'get':get,'del':del,'append':append};
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.2.27",
3
+ "version": "0.2.28",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,