@brown-ds/distribution 0.0.34 → 0.0.35

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.
@@ -1,10 +0,0 @@
1
- /* eslint-disable */
2
-
3
- /*
4
- ATTENTION: This is an obfuscated file. You do not need to understand it.
5
- Do NOT edit this file directly. Use it as a black box.
6
-
7
- If you notice any issues with using this file, please contact the TAs.
8
- */
9
- const util=require('../util/ut'+'il'),distribution=global['distributi'+'on'],log=require('../util/lo'+'g');function getNode(_0x3c6c47,_0x4c93a3,_0x39e89e){typeof _0x4c93a3==='object'&&(_0x4c93a3=_0x4c93a3['key']),distribution[_0x3c6c47['gid']]['status']['get']('nid',(_0x2c6ab6,_0x41332a)=>{let _0x131d42=Object['values'](_0x41332a),_0xcbb2ec=util['id']['getID'](_0x4c93a3),_0x24856f=_0x3c6c47['hash'](_0xcbb2ec,_0x131d42),_0x4c17c2=_0x24856f['substring'](-0x11*0x14c+-0x346*0x5+0x266a,-0x1bfe+-0x8a4+0x24a7);distribution['local']['groups']['get'](_0x3c6c47['gid'],(_0x4b2918,_0x4aaa56)=>{let _0x46762c=_0x4aaa56[_0x4c17c2];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x4c93a3)+'group:\x20'+JSON['stringify'](_0x4aaa56)+'\x20node:\x20'+JSON['stringify'](_0x46762c)+'nid:\x20'+JSON['stringify'](_0x24856f)+'\x20sid:\x20'+JSON['stringify'](_0x4c17c2)),_0x39e89e(_0x46762c);});});}function normalize(_0xc02eee,_0x59c255){let _0x5646d4={};_0xc02eee===null&&(_0xc02eee={});if(typeof _0xc02eee==='string')_0x5646d4['key']=_0xc02eee,_0x5646d4['gid']=_0x59c255,_0x5646d4['action']='put';else typeof _0xc02eee==='object'&&(_0x5646d4['key']=_0xc02eee['key'],_0x5646d4['gid']=_0xc02eee['gid']||_0x59c255,_0x5646d4['action']=_0xc02eee['action']||'put');return _0x5646d4;};const mem=function(_0x254f5a){let _0x20c5aa={};return _0x20c5aa['gid']=_0x254f5a['gid']||'all',_0x20c5aa['hash']=_0x254f5a['hash']||util['id']['naiveHash'],{'get':(_0x592f66,_0x43f7cf)=>{if(!_0x592f66){let _0x3a03ac=[{'key':null,'gid':_0x20c5aa['gid']}];distribution[_0x20c5aa['gid']]['comm']['send'](_0x3a03ac,{'service':'mem','method':'get'},(_0x2fa8fb,_0x1a097b)=>{let _0x483f2e=Object['values'](_0x1a097b)['reduce']((_0x228d71,_0x11d9a7)=>_0x228d71['concat'](_0x11d9a7),[]);_0x43f7cf(_0x2fa8fb,_0x483f2e);});return;}_0x592f66=normalize(_0x592f66,_0x20c5aa['gid']),getNode(_0x20c5aa,_0x592f66,_0x328825=>{let _0x27d18e=[_0x592f66],_0x32bffa={'service':'mem','method':'get','node':_0x328825};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x592f66)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x328825)),distribution['local']['comm']['send'](_0x27d18e,_0x32bffa,_0x43f7cf);});},'put':(_0x598893,_0x54a0d7,_0x449d37)=>{_0x54a0d7=_0x54a0d7||util['id']['getID'](_0x598893),_0x54a0d7=normalize(_0x54a0d7,_0x20c5aa['gid']),getNode(_0x20c5aa,_0x54a0d7,_0x273ccc=>{let _0x8db966=[_0x598893,_0x54a0d7],_0x2314c8={'service':'mem','method':'put','node':_0x273ccc};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x598893)+('configurat'+'ion:\x20')+JSON['stringify'](_0x54a0d7)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x273ccc)),distribution['local']['comm']['send'](_0x8db966,_0x2314c8,_0x449d37);});},'del':(_0x4139be,_0x41e39c)=>{getNode(_0x20c5aa,_0x4139be,_0xf21c59=>{let _0x114740=[{'key':_0x4139be,'gid':_0x20c5aa['gid']}],_0x3c4b73={'service':'mem','method':'del','node':_0xf21c59};distribution['local']['comm']['send'](_0x114740,_0x3c4b73,_0x41e39c);});},'reconf':(_0x4dad7f,_0x34dfb1)=>{distribution[_0x20c5aa['gid']]['mem']['get'](null,(_0x1894ad,_0x5aea84)=>{distribution[_0x20c5aa['gid']]['status']['get']('nid',(_0x57509b,_0x3c96cd)=>{let _0x2ff3ad=Object['values'](_0x3c96cd),_0x2da451=Object['values'](_0x4dad7f)['map'](_0x16eefd=>util['id']['getNID'](_0x16eefd)),_0x443fc6=0x5f9*0x3+0xf*0x172+0x147*-0x1f;const _0x300ad2=()=>{_0x443fc6===_0x5aea84['length']&&_0x34dfb1();};if(_0x5aea84['length']===0xb8*0x4+0x14fb+-0x17db){_0x34dfb1();return;}for(let _0x4bbd36 of _0x5aea84){let _0x3cdb4e=util['id']['getID'](_0x4bbd36),_0x3c532c=_0x20c5aa['hash'](_0x3cdb4e,_0x2da451),_0x28d8b5=_0x20c5aa['hash'](_0x3cdb4e,_0x2ff3ad);if(_0x3c532c===_0x28d8b5){_0x443fc6++,_0x300ad2();continue;}let _0x44e68c=_0x4dad7f[_0x3c532c['substring'](0x1ece+-0x236+-0x1c98,0x6d+0xbaf+-0xc17)],_0x3161b0=[{'key':_0x4bbd36,'gid':_0x20c5aa['gid']}],_0x3bbfb7={'service':'mem','method':'del','node':_0x44e68c};distribution['local']['comm']['send'](_0x3161b0,_0x3bbfb7,(_0x3c1541,_0x450b49)=>{distribution[_0x20c5aa['gid']]['mem']['put'](_0x450b49,_0x4bbd36,(_0x1b90c1,_0x4f6879)=>{_0x443fc6++,_0x300ad2();});});}});});}};};module['exports']=mem;
10
- /* eslint-enable */
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
6
6
 
7
7
  If you notice any issues with using this file, please contact the TAs.
8
8
  */
9
- const distribution=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0x3e9e60,_0x4b46f6,_0xe6fefe){distribution[_0x3e9e60['gid']]['status']['get']('nid',(_0x2ae0db,_0x3cfb71)=>{let _0x4fb87d=Object['values'](_0x3cfb71),_0x24b6fd=util['id']['getID'](_0x4b46f6),_0x1e834b=_0x3e9e60['hash'](_0x24b6fd,_0x4fb87d),_0x470dc0=_0x1e834b['substring'](-0x50a*0x3+0x2dd+-0xc41*-0x1,0x6ae*-0x5+-0x1d39+0xfa9*0x4);distribution['local']['groups']['get'](_0x3e9e60['gid'],(_0x21efc1,_0x29fdb0)=>{let _0x2449f7=_0x29fdb0[_0x470dc0];_0xe6fefe(_0x2449f7);});});}const store=function(_0x5dbb60){let _0x57a9ab={};return _0x57a9ab['gid']=_0x5dbb60['gid']||'all',_0x57a9ab['hash']=_0x5dbb60['hash']||util['id']['naiveHash'],{'get':(_0x2e73fd,_0x140ec0)=>{if(!_0x2e73fd){let _0x3a84aa=[{'key':null,'gid':_0x57a9ab['gid']}];distribution[_0x57a9ab['gid']]['comm']['send'](_0x3a84aa,{'service':'store','method':'get'},(_0x2e9aa2,_0x508a89)=>{log('[all.store'+'.get\x20null\x20'+'given\x20as\x20k'+'ey.\x20keys:\x20'+JSON['stringify'](_0x508a89)+'\x20errors:\x20'+JSON['stringify'](_0x2e9aa2));let _0x26371f=Object['values'](_0x508a89)['reduce']((_0xf6566e,_0x50861c)=>_0xf6566e['concat'](_0x50861c),[]);_0x140ec0(_0x2e9aa2,_0x26371f);});return;}getNode(_0x57a9ab,_0x2e73fd,_0x12e128=>{let _0x1bc8e1=[{'key':_0x2e73fd,'gid':_0x57a9ab['gid']}],_0x766431={'service':'store','method':'get','node':_0x12e128};distribution['local']['comm']['send'](_0x1bc8e1,_0x766431,_0x140ec0);});},'put':(_0x2a1326,_0x4b1dfa,_0x43b473)=>{_0x4b1dfa=_0x4b1dfa||util['id']['getID'](_0x2a1326),getNode(_0x57a9ab,_0x4b1dfa,_0x224dfe=>{let _0x50b6dd=[_0x2a1326,{'key':_0x4b1dfa,'gid':_0x57a9ab['gid']}],_0x2ad5bc={'service':'store','method':'put','node':_0x224dfe};log('[all.store'+'.put]:\x20(gi'+'d:\x20'+_0x57a9ab['gid']+')\x20'+JSON['stringify'](_0x2a1326)+'\x20'+JSON['stringify'](_0x4b1dfa)+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x224dfe)),distribution['local']['comm']['send'](_0x50b6dd,_0x2ad5bc,_0x43b473);});},'del':(_0x211b98,_0x1c3adb)=>{getNode(_0x57a9ab,_0x211b98,_0xc10d0f=>{let _0x4086af=[{'key':_0x211b98,'gid':_0x57a9ab['gid']}],_0x4a2517={'service':'store','method':'del','node':_0xc10d0f};distribution['local']['comm']['send'](_0x4086af,_0x4a2517,_0x1c3adb);});},'reconf':(_0x18d2f0,_0x44d2a0)=>{distribution[_0x57a9ab['gid']]['store']['get'](null,(_0x14a159,_0x21891d)=>{distribution[_0x57a9ab['gid']]['status']['get']('nid',(_0x4b179c,_0xf55ddb)=>{let _0x4f2ccd=Object['values'](_0xf55ddb),_0x32968b=Object['values'](_0x18d2f0)['map'](_0x5a8956=>util['id']['getNID'](_0x5a8956));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x21891d['length']+('\x20keys\x20from'+'\x20')+_0xf55ddb['length']+'\x20nodes');let _0x12bedd=0xd77+-0x2*-0x24+-0xdbf;const _0x4a4318=()=>{_0x12bedd===_0x21891d['length']&&_0x44d2a0();};if(_0x21891d['length']===0xed2+0x1496*0x1+-0x2368){_0x44d2a0();return;}for(let _0x4dc3a9 of _0x21891d){let _0x308386=util['id']['getID'](_0x4dc3a9),_0x30ecd0=_0x57a9ab['hash'](_0x308386,_0x32968b),_0x186048=_0x57a9ab['hash'](_0x308386,_0x4f2ccd);log('[store.rec'+'onf\x20old\x20ni'+'d:\x20'+_0x30ecd0+'\x20new\x20nid:\x20'+_0x186048);if(_0x30ecd0===_0x186048){_0x12bedd++,_0x4a4318();continue;}let _0x7c824=_0x18d2f0[_0x30ecd0['substring'](-0x1*-0xee0+0x399+0x1*-0x1279,-0x686+0x590+0x1*0xfb)],_0x23daca=[{'key':_0x4dc3a9,'gid':_0x57a9ab['gid']}],_0x23d0f6={'service':'store','method':'del','node':_0x7c824};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x4dc3a9+'\x20from\x20'+JSON['stringify'](_0x23d0f6)),distribution['local']['comm']['send'](_0x23daca,_0x23d0f6,(_0x178a05,_0x52192f)=>{distribution[_0x57a9ab['gid']]['store']['put'](_0x52192f,_0x4dc3a9,(_0x5b35e7,_0x491613)=>{_0x12bedd++,_0x4a4318();});});}});});}};};module['exports']=store;
9
+ const distribution=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0xa0467f,_0x510f83,_0x2e2cbb){distribution[_0xa0467f['gid']]['status']['get']('nid',(_0x551d07,_0xb8508b)=>{let _0x576d79=Object['values'](_0xb8508b),_0x45deb4=util['id']['getID'](_0x510f83),_0x2bf5e4=_0xa0467f['hash'](_0x45deb4,_0x576d79),_0x1e0eb2=_0x2bf5e4['substring'](-0x3d*0x43+0x26b1+0x16ba*-0x1,-0x143*-0x1b+-0x2fd*0x2+-0x1c12);distribution['local']['groups']['get'](_0xa0467f['gid'],(_0x41d762,_0x5d0f54)=>{let _0x1ca477=_0x5d0f54[_0x1e0eb2];_0x2e2cbb(_0x1ca477);});});}const store=function(_0xee17b3){let _0x292db5={};return _0x292db5['gid']=_0xee17b3['gid']||'all',_0x292db5['hash']=_0xee17b3['hash']||util['id']['naiveHash'],{'get':(_0x3d7c00,_0x491ab9)=>{if(!_0x3d7c00){let _0x32bfe7=[{'key':null,'gid':_0x292db5['gid']}];distribution[_0x292db5['gid']]['comm']['send'](_0x32bfe7,{'service':'store','method':'get'},(_0x318e62,_0x192e66)=>{log('[all.store'+'.get\x20null\x20'+'given\x20as\x20k'+'ey.\x20keys:\x20'+JSON['stringify'](_0x192e66)+'\x20errors:\x20'+JSON['stringify'](_0x318e62));let _0x5e896b=Object['values'](_0x192e66)['reduce']((_0x4a725c,_0x1a85e2)=>_0x4a725c['concat'](_0x1a85e2),[]);_0x491ab9(_0x318e62,_0x5e896b);});return;}getNode(_0x292db5,_0x3d7c00,_0x72f87a=>{let _0x5e4b16=[{'key':_0x3d7c00,'gid':_0x292db5['gid']}],_0x539a83={'service':'store','method':'get','node':_0x72f87a};distribution['local']['comm']['send'](_0x5e4b16,_0x539a83,_0x491ab9);});},'put':(_0x3e40a2,_0x19844d,_0x3424ac)=>{_0x19844d=_0x19844d||util['id']['getID'](_0x3e40a2),getNode(_0x292db5,_0x19844d,_0x57bfb3=>{let _0x418353=[_0x3e40a2,{'key':_0x19844d,'gid':_0x292db5['gid']}],_0xbb8976={'service':'store','method':'put','node':_0x57bfb3};log('[all.store'+'.put]:\x20(gi'+'d:\x20'+_0x292db5['gid']+')\x20'+JSON['stringify'](_0x3e40a2)+'\x20'+JSON['stringify'](_0x19844d)+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x57bfb3)),distribution['local']['comm']['send'](_0x418353,_0xbb8976,_0x3424ac);});},'del':(_0x111e0b,_0x54f463)=>{getNode(_0x292db5,_0x111e0b,_0x5f298d=>{let _0x341abd=[{'key':_0x111e0b,'gid':_0x292db5['gid']}],_0x4ce73e={'service':'store','method':'del','node':_0x5f298d};distribution['local']['comm']['send'](_0x341abd,_0x4ce73e,_0x54f463);});},'reconf':(_0x386745,_0x23e325)=>{distribution[_0x292db5['gid']]['store']['get'](null,(_0x27f3c1,_0x32c3f0)=>{distribution[_0x292db5['gid']]['status']['get']('nid',(_0x18f2d9,_0x3f1917)=>{let _0x5c076b=Object['values'](_0x3f1917),_0xb6f65b=Object['values'](_0x386745)['map'](_0x2cd4db=>util['id']['getNID'](_0x2cd4db));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x32c3f0['length']+('\x20keys\x20from'+'\x20')+_0x3f1917['length']+'\x20nodes');let _0x2b4776=-0x1*-0x15fd+-0x91f+0xb7*-0x12;const _0x3e2050=()=>{_0x2b4776===_0x32c3f0['length']&&_0x23e325();};if(_0x32c3f0['length']===0xd9*-0x2d+0x1aff*-0x1+-0x16*-0x2f6){_0x23e325();return;}for(let _0x8a4c69 of _0x32c3f0){let _0x1dfe7e=util['id']['getID'](_0x8a4c69),_0x290ab5=_0x292db5['hash'](_0x1dfe7e,_0xb6f65b),_0x5b0c41=_0x292db5['hash'](_0x1dfe7e,_0x5c076b);log('[store.rec'+'onf\x20old\x20ni'+'d:\x20'+_0x290ab5+'\x20new\x20nid:\x20'+_0x5b0c41);if(_0x290ab5===_0x5b0c41){_0x2b4776++,_0x3e2050();continue;}let _0x3e1594=_0x386745[_0x290ab5['substring'](-0x12ce+0x14b*0x1d+0x57*-0x37,-0x119*0x9+0x25e2+0x954*-0x3)],_0x2f153d=[{'key':_0x8a4c69,'gid':_0x292db5['gid']}],_0x2a4c14={'service':'store','method':'del','node':_0x3e1594};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x8a4c69+'\x20from\x20'+JSON['stringify'](_0x2a4c14)),distribution['local']['comm']['send'](_0x2f153d,_0x2a4c14,(_0x25f526,_0x197d13)=>{distribution[_0x292db5['gid']]['store']['put'](_0x197d13,_0x8a4c69,(_0x21ecb9,_0x228777)=>{_0x2b4776++,_0x3e2050();});});}});});}};};module['exports']=store;
10
10
  /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,