@brown-ds/distribution 0.1.23 → 0.2.15
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.
- package/distribution/all/all.js +1 -1
- package/distribution/all/comm.js +1 -1
- package/distribution/all/gossip.js +1 -1
- package/distribution/all/groups.js +1 -1
- package/distribution/all/mem.js +1 -1
- package/distribution/all/mr.js +1 -1
- package/distribution/all/routes.js +1 -1
- package/distribution/all/status.js +1 -1
- package/distribution/all/store.js +1 -1
- package/distribution/distribution.d.ts +20 -0
- package/distribution/local/comm.js +1 -1
- package/distribution/local/gossip.js +1 -1
- package/distribution/local/groups.js +1 -1
- package/distribution/local/local.js +1 -1
- package/distribution/local/mem.js +1 -1
- package/distribution/local/node.js +1 -1
- package/distribution/local/routes.js +1 -1
- package/distribution/local/status.js +1 -1
- package/distribution/local/store.js +1 -1
- package/distribution/util/id.js +1 -1
- package/distribution/util/log.js +1 -1
- package/distribution/util/serialization.js +1 -1
- package/distribution/util/util.js +1 -1
- package/distribution/util/wire.js +1 -1
- package/distribution.js +53 -67
- package/package.json +99 -20
package/distribution/all/all.js
CHANGED
|
@@ -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'),groups=require('./groups'),routes=require('./routes'),status=require('./status'),gossip=require('./gossip'),mem=require('./mem'),store=require('./store'),mr=require('./mr');module['exports']={'comm':comm,'groups':groups,'status':status,'routes':routes,'gossip':gossip,'mem':mem,'store':store,'mr':mr};
|
|
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};
|
|
10
10
|
/* eslint-enable */
|
package/distribution/all/comm.js
CHANGED
|
@@ -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
|
-
function comm(
|
|
9
|
+
function comm(_0x2019ba){const _0x285313={};_0x285313['gid']=_0x2019ba['gid']||'all';function _0x577a6a(_0x2056fd,_0x124d3c,_0x1f2069){globalThis['distributi'+'on']['local']['groups']['get'](_0x285313['gid'],(_0x2d1099,_0x592d32)=>{if(!_0x592d32){_0x1f2069(_0x2d1099);return;}const _0x208bd1=Object['keys'](_0x592d32)['length'];if(_0x208bd1===0x1f82+-0x5d*0x6+-0x1d54){_0x1f2069(new Error('No\x20nodes\x20i'+'n\x20group\x20'+_0x285313['gid']+'\x20found!'));return;}let _0x502634=0x1*-0x210e+0xaf2+-0x587*-0x4;const _0x34ae1c={},_0x4e14df={};for(const _0x5d24fd of Object['keys'](_0x592d32)){const _0x3ca66f=_0x592d32[_0x5d24fd],_0x21dcd4={'node':{'ip':_0x3ca66f['ip'],'port':_0x3ca66f['port']},'service':_0x124d3c['service'],'method':_0x124d3c['method'],'gid':_0x124d3c['gid']||'local'};globalThis['distributi'+'on']['local']['comm']['send'](_0x2056fd,_0x21dcd4,(_0x504bd9,_0x213b4a)=>{_0x504bd9?_0x4e14df[_0x5d24fd]=_0x504bd9:_0x34ae1c[_0x5d24fd]=_0x213b4a;_0x502634+=-0xb*0x2+0x31c+-0x305;if(_0x502634===_0x208bd1)return _0x1f2069(_0x4e14df,_0x34ae1c);});}});}return{'send':_0x577a6a};}module['exports']=comm;
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const log=require('../util/lo'+'g.js');function gossip(_0x2e8714){const _0x7e53d4={};_0x7e53d4['gid']=_0x2e8714['gid']||'all',_0x7e53d4['subset']=_0x2e8714['subset']||function(_0x20afd8){return Math['ceil'](Math['log'](_0x20afd8['length']));};function _0xd2ee67(_0x5e6e2c,_0x2583fb,_0x260c70){log('[gossip]\x20s'+'end:\x20'+JSON['stringify'](_0x5e6e2c)+'\x20to\x20'+JSON['stringify'](_0x2583fb)),globalThis['distributi'+'on']['local']['groups']['get'](_0x7e53d4['gid'],(_0x40ec02,_0x254654)=>{if(_0x254654===null){_0x260c70(_0x40ec02);return;}const _0x31f282=_0x7e53d4['subset'](Object['keys'](_0x254654)),_0x35c471=function(_0x24343d){const _0x2c0088={};while(Object['keys'](_0x2c0088)['length']<_0x31f282){const _0x416c36=Math['floor'](Math['random']()*_0x24343d['length']);_0x2c0088[_0x24343d[_0x416c36]]=!![];}return _0x2c0088;},_0x58ba0f=_0x35c471(Object['keys'](_0x254654));log('[gossip]\x20g'+'ossipNodes'+':\x20'+JSON['stringify'](Object['keys'](_0x58ba0f))+'\x20length:\x20'+Object['keys'](_0x58ba0f)['length']);const _0xdb8b6d={},_0x257fd6={};let _0xad14ff=0x11fc+0x1419+-0x2615;if(_0x5e6e2c['mid']&&_0x5e6e2c['gid']){}else _0x5e6e2c={'message':_0x5e6e2c,'remote':_0x2583fb,'mid':globalThis['distributi'+'on']['util']['id']['getMID'](_0x5e6e2c),'gid':_0x7e53d4['gid']};for(const _0x4d1cb2 of Object['keys'](_0x58ba0f)){const _0x3c96d0=_0x254654[_0x4d1cb2];log('[gossip]\x20s'+'end\x20to\x20nod'+'e:\x20'+JSON['stringify'](_0x3c96d0));const _0x2257f8={'node':{'ip':_0x3c96d0['ip'],'port':_0x3c96d0['port']},'service':'gossip','method':'recv'};globalThis['distributi'+'on']['local']['comm']['send']([_0x5e6e2c],_0x2257f8,(_0x22d19f,_0x3a5b9a)=>{_0x22d19f?_0x257fd6[_0x4d1cb2]=_0x22d19f:_0xdb8b6d[_0x4d1cb2]=_0x3a5b9a;_0xad14ff+=-0x574+-0x13*0x13f+0x1d22;if(_0xad14ff===_0x31f282){if(_0x260c70)return _0x260c70(_0x257fd6,_0xdb8b6d);}});}});}function _0x2bbb66(_0xd34712,_0x2b936b,_0x5ed2b4){const _0x59e8c4=setInterval(_0x2b936b,_0xd34712);if(_0x5ed2b4)return _0x5ed2b4(null,_0x59e8c4);}function _0x2abdd4(_0x9fd6bc,_0x4d2bc2){clearInterval(_0x9fd6bc);if(_0x4d2bc2)return _0x4d2bc2(null,_0x9fd6bc);}return{'send':_0xd2ee67,'at':_0x2bbb66,'del':_0x2abdd4};}module['exports']=gossip;
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
function groups(_0x56f623){const _0x1e2557={'gid':_0x56f623['gid']||'all'};function _0x58d492(_0x16d1c7,_0x256730,_0x702a44){globalThis['distributi'+'on'][_0x1e2557['gid']]['comm']['send']([_0x16d1c7,_0x256730],{'service':'groups','method':'put'},_0x702a44);}function _0x217abb(_0x484944,_0x3477a6){globalThis['distributi'+'on'][_0x1e2557['gid']]['comm']['send']([_0x484944],{'service':'groups','method':'del'},_0x3477a6);}function _0x29759b(_0x1a8c92,_0xe15ee){globalThis['distributi'+'on'][_0x1e2557['gid']]['comm']['send']([_0x1a8c92],{'service':'groups','method':'get'},_0xe15ee);}function _0x57983c(_0x4b1b7c,_0x3ad8e7,_0x151be6){globalThis['distributi'+'on'][_0x1e2557['gid']]['comm']['send']([_0x4b1b7c,_0x3ad8e7],{'service':'groups','method':'add'},_0x151be6);}function _0x598c1c(_0x1770db,_0x29cbfe,_0x341c6c){globalThis['distributi'+'on'][_0x1e2557['gid']]['comm']['send']([_0x1770db,_0x29cbfe],{'service':'groups','method':'rem'},_0x341c6c);}return{'put':_0x58d492,'del':_0x217abb,'get':_0x29759b,'add':_0x57983c,'rem':_0x598c1c};}module['exports']=groups;
|
|
10
10
|
/* eslint-enable */
|
package/distribution/all/mem.js
CHANGED
|
@@ -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
|
|
9
|
+
const log=require('../util/lo'+'g.js'),id=require('../util/id'+'.js');function normalize(_0x591c23,_0x20082e){if(_0x591c23===null)return{'key':null,'gid':_0x20082e,'action':'put'};else return typeof _0x591c23==='string'?{'key':_0x591c23,'gid':_0x20082e,'action':'put'}:_0x591c23;}function mem(_0x356653){const _0x196bbd={};_0x196bbd['gid']=_0x356653['gid']||'all',_0x196bbd['hash']=_0x356653['hash']||id['naiveHash'];function _0x5b04f0(_0x23d0a8,_0x4ad4d1){log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0x23d0a8)+'\x20context:\x20'+JSON['stringify'](_0x196bbd)),_0x23d0a8=normalize(_0x23d0a8,_0x196bbd['gid']),_0x23d0a8['gid']=_0x23d0a8['gid']||_0x196bbd['gid'];const _0x119b8a={'service':'mem','method':'get'},_0x577f36=[_0x23d0a8];if(!_0x23d0a8['key']){globalThis['distributi'+'on'][_0x196bbd['gid']]['comm']['send'](_0x577f36,_0x119b8a,(_0x22554e,_0x1f7e60)=>{const _0x1b51ed=Object['values'](_0x1f7e60)['reduce']((_0x1bd2fe,_0x39aa0c)=>_0x1bd2fe['concat'](_0x39aa0c),[]);_0x4ad4d1(_0x22554e,_0x1b51ed);});return;}const _0x288021=_0x23d0a8['key'];if(_0x288021===null){_0x4ad4d1(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x577f36,_0x119b8a,{'key':_0x288021},_0x196bbd,_0x4ad4d1);}function _0x2728a8(_0x254a67,_0x154f9e,_0x33d4d4){log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x254a67)+('\x20configura'+'tion:\x20')+JSON['stringify'](_0x154f9e)),_0x154f9e=_0x154f9e||globalThis['distributi'+'on']['util']['id']['getID'](_0x254a67),_0x154f9e=normalize(_0x154f9e,_0x196bbd['gid']),_0x154f9e['gid']=_0x154f9e['gid']||_0x196bbd['gid'];const _0x3519e7={'service':'mem','method':'put'},_0x415567=[_0x254a67,_0x154f9e],_0x303888=_0x154f9e['key'];if(_0x303888===null){_0x33d4d4(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x415567,_0x3519e7,{'key':_0x303888},_0x196bbd,_0x33d4d4);}function _0x4adf94(_0x2aede1,_0x3c4fb6){log('[all.mem.d'+'el]\x20config'+'uration:\x20'+JSON['stringify'](_0x2aede1)),_0x2aede1=normalize(_0x2aede1,_0x196bbd['gid']),_0x2aede1['gid']=_0x2aede1['gid']||_0x196bbd['gid'];const _0x2bb8f7={'service':'mem','method':'del'},_0x5e54fe=[_0x2aede1],_0x21dee8=_0x2aede1['key'];if(_0x21dee8===null){_0x3c4fb6(new TypeError('Configurat'+'ion\x20is\x20nul'+'l'));return;}globalThis['distributi'+'on']['util']['wire']['dispatchMe'+'ssage'](_0x5e54fe,_0x2bb8f7,{'key':_0x21dee8},_0x196bbd,_0x3c4fb6);}function _0x22bb56(_0x572579,_0x3b7c89){log('[mem.recon'+'f]\x20configu'+'ration:\x20'+JSON['stringify'](_0x572579)+'\x20gid:\x20'+_0x196bbd['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x196bbd['gid'],(_0x4120d2,_0x2bc999)=>{if(!_0x2bc999){_0x3b7c89(_0x4120d2);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x196bbd['gid'],_0x572579,(_0x2194b0,_0x411fcc)=>{globalThis['distributi'+'on'][_0x196bbd['gid']]['mem']['get'](null,(_0x6ee088,_0x24f514)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x196bbd['gid'],_0x2bc999,(_0x3f0344,_0x2d8cf0)=>{globalThis['distributi'+'on'][_0x196bbd['gid']]['status']['get']('nid',(_0xb514ce,_0x96f40f)=>{const _0x2ee36e=Object['values'](_0x96f40f),_0xc4b120=Object['values'](_0x572579)['map'](_0x107508=>globalThis['distributi'+'on']['util']['id']['getNID'](_0x107508));log('[mem.recon'+'f\x20received'+'\x20'+_0x24f514['length']+('\x20keys\x20from'+'\x20')+_0x96f40f['length']+'\x20nodes');let _0x1e85c2=0x2134+0x1701+-0x3835*0x1;const _0x3b61f0=()=>{if(_0x1e85c2===_0x24f514['length'])return _0x3b7c89(null);};if(_0x24f514['length']===0x1878+0x50*-0x5f+0x2*0x29c)return _0x3b7c89(null);for(const _0x250562 of _0x24f514){const _0x25d18a=globalThis['distributi'+'on']['util']['id']['getID'](_0x250562),_0x3514a1=_0x196bbd['hash'](_0x25d18a,_0xc4b120),_0x392cbf=_0x196bbd['hash'](_0x25d18a,_0x2ee36e);log('[mem.recon'+'f]\x20old\x20nid'+':\x20'+_0x3514a1+'\x20new\x20nid:\x20'+_0x392cbf);if(_0x3514a1===_0x392cbf){_0x1e85c2++,_0x3b61f0();continue;}const _0x54967f=_0x572579[_0x3514a1['substring'](-0x1*-0x7a+0x1*0x1861+-0x18db,0x92f+0x13c5+0x9*-0x337)],_0x401ab4=[{'key':_0x250562,'gid':_0x196bbd['gid']}],_0x4a9164={'service':'mem','method':'del','node':_0x54967f};log('[mem.recon'+'f]\x20deletin'+'g\x20key\x20'+_0x250562+'\x20from\x20'+JSON['stringify'](_0x4a9164)),globalThis['distributi'+'on']['local']['comm']['send'](_0x401ab4,_0x4a9164,(_0x3ca5e3,_0x5338c0)=>{globalThis['distributi'+'on'][_0x196bbd['gid']]['mem']['put'](_0x5338c0,_0x250562,(_0x526b36,_0x356fa2)=>{_0x1e85c2++,_0x3b61f0();});});}});});});});});}return{'get':_0x5b04f0,'put':_0x2728a8,'del':_0x4adf94,'reconf':_0x22bb56};}module['exports']=mem;
|
|
10
10
|
/* eslint-enable */
|
package/distribution/all/mr.js
CHANGED
|
@@ -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=
|
|
9
|
+
const distribution=globalThis['distributi'+'on'],id=distribution['util']['id'];function mr(_0xf4cbb9){const _0x707940={'gid':_0xf4cbb9['gid']||'all'};function _0x270ccb(_0x2ad961,_0x56453d){const _0x2358ea=id['getID'](_0x2ad961),_0x302c1f={'mapper':_0x2ad961['map'],'reducer':_0x2ad961['reduce'],'map':function(_0x2c273e,_0x4724c8,_0x15a73e,_0x109504){if(_0x2c273e['length']==0x185b+0xd99+-0x1*0x25f4){_0x109504(null,[]);return;}else{const _0x1df933=[];let _0xef08f0=-0x1*-0x14bf+0x15a6+-0x2a65;_0x2c273e['forEach'](_0x5c82d2=>{globalThis['distributi'+'on'][_0x4724c8]['store']['get'](_0x5c82d2,(_0x344efc,_0x527f89)=>{_0xef08f0++;const _0xe5371e=this['mapper'](_0x5c82d2,_0x527f89);Array['isArray'](_0xe5371e)?_0x1df933['push'](..._0xe5371e):_0x1df933['push'](_0xe5371e),_0xef08f0==_0x2c273e['length']&&distribution['local']['store']['put'](_0x1df933,_0x15a73e+'_map',(_0x1d3f23,_0x2ef5a7)=>{_0x109504(_0x1d3f23,_0x1df933);});});});}},'shuffle':function(_0x52b2b6,_0x30e894,_0x52ec8f){distribution['local']['store']['get'](_0x30e894+'_map',(_0x5bfdcd,_0x1c98c7)=>{if(!_0x5bfdcd){let _0xfa8489=-0x2472*-0x1+0x25c+0x1367*-0x2;_0x1c98c7['forEach'](_0xd51477=>{const [_0x336acc]=Object['keys'](_0xd51477);distribution[_0x52b2b6]['mem']['put'](_0xd51477[_0x336acc],{'key':_0x336acc,'action':'append','gid':_0x52b2b6},(_0x4073b0,_0x159ae0)=>{_0xfa8489++;if(_0xfa8489==_0x1c98c7['length'])return _0x52ec8f(null,_0x1c98c7);});});}else return _0x52ec8f(_0x5bfdcd,{});});},'reduce':function(_0x49655b,_0x34b3ac,_0x3d0b83){distribution['local']['mem']['get']({'key':null,'gid':_0x49655b},(_0x429ace,_0x532376)=>{let _0x20d7dd=[],_0xce52=0x206b*0x1+-0x15c+-0x1f0f;if(_0x532376['length']==-0xc9c+0x1*-0x1107+0x1da3)return _0x3d0b83(null,null);_0x532376['forEach'](_0x269e79=>distribution['local']['mem']['get']({'key':_0x269e79,'gid':_0x49655b},(_0x44780d,_0x2f72cc)=>{const _0x1e3f1f=this['reducer'](_0x269e79,_0x2f72cc);_0x20d7dd=_0x20d7dd['concat'](_0x1e3f1f),_0xce52++;if(_0xce52==_0x532376['length'])return _0x3d0b83(null,_0x20d7dd);}));});}},_0x375723=function(_0x18ac26,_0x228163){const _0x57b67c={};return Object['keys'](_0x228163)['forEach'](_0x37e364=>{_0x57b67c[_0x37e364]=[];}),_0x18ac26['forEach'](_0x278e6c=>{const _0x483b40=id['getID'](_0x278e6c),_0x233b95=id['naiveHash'](_0x483b40,Object['keys'](_0x228163));_0x57b67c[_0x233b95]['push'](_0x278e6c);}),_0x57b67c;};distribution[_0x707940['gid']]['routes']['put'](_0x302c1f,'mr-'+_0x2358ea,(_0x48d608,_0xf9afc9)=>{distribution['local']['groups']['get'](_0x707940['gid'],(_0x283c57,_0x31d1ce)=>{if(!_0x31d1ce){_0x56453d(_0x283c57);return;}const _0x88a35e=_0x375723(_0x2ad961['keys'],_0x31d1ce);let _0x25a06e=-0xeaa+-0x24cb+0x3375*0x1;const _0xdd60e1=Object['keys'](_0x31d1ce)['length'],_0x99ab6e={'service':'mr-'+_0x2358ea,'method':'map'};for(const _0xf9a29e in _0x31d1ce){const _0x58617b=[_0x88a35e[_0xf9a29e],_0x707940['gid'],_0x2358ea];distribution['local']['comm']['send'](_0x58617b,{'node':_0x31d1ce[_0xf9a29e],..._0x99ab6e},(_0xb945ed,_0x4124a2)=>{++_0x25a06e;if(_0x25a06e==_0xdd60e1){const _0x5620b6={'service':'mr-'+_0x2358ea,'method':'shuffle'};distribution[_0x707940['gid']]['comm']['send']([_0x707940['gid'],_0x2358ea],_0x5620b6,(_0x3c6981,_0x546c28)=>{const _0xe0f533={'service':'mr-'+_0x2358ea,'method':'reduce'};distribution[_0x707940['gid']]['comm']['send']([_0x707940['gid'],_0x2358ea],_0xe0f533,(_0x2fd6f4,_0x15805c)=>{let _0x1b85c8=[];for(const _0x247847 of Object['values'](_0x15805c)){_0x247847!==null&&(_0x1b85c8=_0x1b85c8['concat'](_0x247847));}_0x56453d(null,_0x1b85c8);return;});});}});}});});}return{'exec':_0x270ccb};}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
|
-
function routes(
|
|
9
|
+
function routes(_0x513848){const _0x4603d3={};_0x4603d3['gid']=_0x513848['gid']||'all';function _0x2afdbd(_0x109390,_0x50e101,_0x45a542){globalThis['distributi'+'on'][_0x4603d3['gid']]['comm']['send']([_0x109390,_0x50e101],{'service':'routes','method':'put'},_0x45a542);}function _0x22234e(_0x5744d0,_0xc676ed){globalThis['distributi'+'on'][_0x4603d3['gid']]['comm']['send']([_0x5744d0],{'service':'routes','method':'rem'},_0xc676ed);}return{'put':_0x2afdbd,'rem':_0x22234e};}module['exports']=routes;
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
function status(_0x543e8f){const _0x30aea1={};_0x30aea1['gid']=_0x543e8f['gid']||'all';function _0x4657fd(_0x81d5fe,_0x39c5e3){const _0x202a65=[_0x81d5fe],_0x1b1a26={'service':'status','method':'get'};globalThis['distributi'+'on'][_0x30aea1['gid']]['comm']['send'](_0x202a65,_0x1b1a26,(_0xef2e3e,_0x27ae26)=>{switch(_0x81d5fe){case'heapTotal':const _0x53e3d1=Object['values'](_0x27ae26)['reduce']((_0x46c7b4,_0x56cc4b)=>{return _0x46c7b4+_0x56cc4b;},-0x24*-0x68+-0x165c+0x7bc);return _0x39c5e3(_0xef2e3e,_0x53e3d1);break;case'nid':const _0x1bb02d=Object['values'](_0x27ae26)['reduce']((_0x2eff33,_0x5ce96f)=>{return _0x2eff33['concat'](_0x5ce96f);},[]);return _0x39c5e3(_0xef2e3e,_0x1bb02d);break;default:return _0x39c5e3(_0xef2e3e,_0x27ae26);break;}});}function _0x1575b2(_0x1fdcdc,_0x535956){globalThis['distributi'+'on']['local']['status']['spawn'](_0x1fdcdc,(_0x5a2284,_0x89795f)=>{globalThis['distributi'+'on'][_0x30aea1['gid']]['comm']['send']([_0x30aea1['gid'],_0x1fdcdc],{'service':'groups','method':'add'},()=>{});if(_0x5a2284)return _0x535956(_0x5a2284);globalThis['distributi'+'on']['local']['groups']['add'](_0x30aea1['gid'],_0x1fdcdc,()=>{return _0x535956(null,_0x89795f);});});}function _0x5ee009(_0x1354c7){globalThis['distributi'+'on'][_0x30aea1['gid']]['comm']['send']([],{'service':'status','method':'stop'},()=>{globalThis['distributi'+'on']['local']['status']['stop'](_0x1354c7);});}return{'get':_0x4657fd,'stop':_0x5ee009,'spawn':_0x1575b2};}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(
|
|
9
|
+
const log=require('../util/lo'+'g.js'),id=require('../util/id'+'.js');function getNode(_0x54f2ab,_0x104310,_0x417e49){const _0x286a0c=_0x104310&&typeof _0x104310==='object'?_0x104310['key']:_0x104310;globalThis['distributi'+'on'][_0x54f2ab['gid']]['status']['get']('nid',(_0x1bb184,_0x1094d6)=>{const _0x4ce8c6=Object['values'](_0x1094d6),_0x170a06=globalThis['distributi'+'on']['util']['id']['getID'](_0x286a0c),_0x884c49=_0x54f2ab['hash'](_0x170a06,_0x4ce8c6),_0x3b2660=_0x884c49['substring'](0x756+0xf51+0x16a7*-0x1,0x2*-0xe35+0x674+0x15fb);globalThis['distributi'+'on']['local']['groups']['get'](_0x54f2ab['gid'],(_0x417d10,_0x1e541a)=>{if(!_0x1e541a)return _0x417e49(_0x417d10);else{const _0x5a6480=_0x1e541a[_0x3b2660];return log('[store\x20(ge'+'tNode)]\x20co'+'nfiguratio'+'n:\x20'+JSON['stringify'](_0x104310)+'group:\x20'+JSON['stringify'](_0x1e541a)+'\x20node:\x20'+JSON['stringify'](_0x5a6480)+'nid:\x20'+JSON['stringify'](_0x884c49)+'\x20sid:\x20'+JSON['stringify'](_0x3b2660)),_0x417e49(null,_0x5a6480);}});});}function normalize(_0x58ddde,_0x2fc7b5){if(_0x58ddde===null)return{'key':null,'gid':_0x2fc7b5,'action':'put'};else return typeof _0x58ddde==='string'?{'key':_0x58ddde,'gid':_0x2fc7b5,'action':'put'}:_0x58ddde;}function store(_0x4ce0c4){const _0x342ef9={'gid':_0x4ce0c4['gid']||'all','hash':_0x4ce0c4['hash']||id['naiveHash'],'subset':_0x4ce0c4['subset']};function _0x5eee3b(_0x31d5d4,_0x45697f){if(!_0x31d5d4){const _0x4f822c=[{'key':null,'gid':_0x342ef9['gid']}];globalThis['distributi'+'on'][_0x342ef9['gid']]['comm']['send'](_0x4f822c,{'service':'store','method':'get'},(_0x24701d,_0x59d7ae)=>{const _0x27749b=Object['values'](_0x59d7ae)['reduce']((_0x3ffffc,_0x80eed9)=>_0x3ffffc['concat'](_0x80eed9),[]);_0x45697f(_0x24701d,_0x27749b);});return;}_0x31d5d4=normalize(_0x31d5d4,_0x342ef9['gid']),getNode(_0x342ef9,_0x31d5d4,(_0x4b8867,_0x524904)=>{if(!_0x524904){_0x45697f(_0x4b8867);return;}const _0x3578bd=[_0x31d5d4],_0x3061cf={'service':'store','method':'get','node':_0x524904};log('[all.store'+'.get]confi'+'guration:\x20'+JSON['stringify'](_0x31d5d4)+'node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x524904)),globalThis['distributi'+'on']['local']['comm']['send'](_0x3578bd,_0x3061cf,_0x45697f);});}function _0x258e41(_0x2d3ff1,_0x469b5e,_0x41fd2b){_0x469b5e=_0x469b5e||globalThis['distributi'+'on']['util']['id']['getID'](_0x2d3ff1),_0x469b5e=normalize(_0x469b5e,_0x342ef9['gid']),getNode(_0x342ef9,_0x469b5e,(_0x15be48,_0x14b088)=>{if(!_0x14b088){_0x41fd2b(_0x15be48);return;}const _0x2e5ef8=[_0x2d3ff1,_0x469b5e],_0x4a465f={'service':'store','method':'put','node':_0x14b088};log('[all.store'+'.put]\x20stat'+'e:\x20'+JSON['stringify'](_0x2d3ff1)+('configurat'+'ion:\x20')+JSON['stringify'](_0x469b5e)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x14b088)),globalThis['distributi'+'on']['local']['comm']['send'](_0x2e5ef8,_0x4a465f,_0x41fd2b);});}function _0x43d7ee(_0x5e4181,_0x599c54){getNode(_0x342ef9,_0x5e4181,(_0x3e7c40,_0x2e63a2)=>{if(!_0x2e63a2){_0x599c54(_0x3e7c40);return;}const _0x3af5a1=[{'key':_0x5e4181,'gid':_0x342ef9['gid']}],_0x1dc4d1={'service':'store','method':'del','node':_0x2e63a2};globalThis['distributi'+'on']['local']['comm']['send'](_0x3af5a1,_0x1dc4d1,_0x599c54);});}function _0x125e7f(_0x24a30c,_0xa57bbb){log('[store.rec'+'onf]\x20confi'+'guration:\x20'+JSON['stringify'](_0x24a30c)+'\x20gid:\x20'+_0x342ef9['gid']),globalThis['distributi'+'on']['local']['groups']['get'](_0x342ef9['gid'],(_0x3617a4,_0x16ec7c)=>{if(!_0x16ec7c){_0xa57bbb(_0x3617a4);return;}globalThis['distributi'+'on']['local']['groups']['put'](_0x342ef9['gid'],_0x24a30c,(_0x3b0ae4,_0x30e7ab)=>{globalThis['distributi'+'on'][_0x342ef9['gid']]['store']['get'](null,(_0x14b1ba,_0x731a19)=>{globalThis['distributi'+'on']['local']['groups']['put'](_0x342ef9['gid'],_0x16ec7c,(_0x148482,_0xe6899f)=>{globalThis['distributi'+'on'][_0x342ef9['gid']]['status']['get']('nid',(_0xa49683,_0x25087d)=>{const _0x1c4cfb=Object['values'](_0x25087d),_0x47f47e=Object['values'](_0x24a30c)['map'](_0xc416e7=>globalThis['distributi'+'on']['util']['id']['getNID'](_0xc416e7));log('[store.rec'+'onf\x20receiv'+'ed\x20'+_0x731a19['length']+('\x20keys\x20from'+'\x20')+_0x25087d['length']+'\x20nodes');let _0xa392ee=-0x657+-0x26b*0x4+-0x1003*-0x1;const _0x43432d=()=>{if(_0xa392ee===_0x731a19['length'])return _0xa57bbb(null);};if(_0x731a19['length']===-0xb43*-0x1+-0x12da*-0x1+0x1e1d*-0x1)return _0xa57bbb(null);for(const _0x4cda3e of _0x731a19){const _0x18d567=globalThis['distributi'+'on']['util']['id']['getID'](_0x4cda3e),_0x138fb2=_0x342ef9['hash'](_0x18d567,_0x47f47e),_0x9791cf=_0x342ef9['hash'](_0x18d567,_0x1c4cfb);log('[store.rec'+'onf]\x20old\x20n'+'id:\x20'+_0x138fb2+'\x20new\x20nid:\x20'+_0x9791cf);if(_0x138fb2===_0x9791cf){_0xa392ee++,_0x43432d();continue;}const _0x48e3af=_0x24a30c[_0x138fb2['substring'](0x1b5*0x14+-0x17*-0x65+-0x2b37,0x324+-0x1*-0x18c5+0x4*-0x6f9)],_0x2a66f7=[{'key':_0x4cda3e,'gid':_0x342ef9['gid']}],_0x465828={'service':'store','method':'del','node':_0x48e3af};log('[store.rec'+'onf]\x20delet'+'ing\x20key\x20'+_0x4cda3e+'\x20from\x20'+JSON['stringify'](_0x465828)),globalThis['distributi'+'on']['local']['comm']['send'](_0x2a66f7,_0x465828,(_0x4628e6,_0x3ef34a)=>{globalThis['distributi'+'on'][_0x342ef9['gid']]['store']['put'](_0x3ef34a,_0x4cda3e,(_0x2dd16d,_0x53a8b6)=>{_0xa392ee++,_0x43432d();});});}});});});});});}return{'get':_0x5eee3b,'put':_0x258e41,'del':_0x43d7ee,'reconf':_0x125e7f};}module['exports']=store;
|
|
10
10
|
/* eslint-enable */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GroupServices } from "./all/all.js";
|
|
2
|
+
import { Node } from "./types.js";
|
|
3
|
+
import { Server, IncomingMessage, ServerResponse } from "http";
|
|
4
|
+
|
|
5
|
+
export {};
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
var distribution: {
|
|
9
|
+
util: typeof import("./util/util.js"),
|
|
10
|
+
local: typeof import('./local/local.js'),
|
|
11
|
+
all: GroupServices,
|
|
12
|
+
node: {
|
|
13
|
+
start: (server: any) => void
|
|
14
|
+
config: Node
|
|
15
|
+
server: Server<typeof IncomingMessage, typeof ServerResponse>
|
|
16
|
+
},
|
|
17
|
+
[gid: string]: any,
|
|
18
|
+
}
|
|
19
|
+
var toLocal: Map<string, Function>
|
|
20
|
+
}
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const http=require('http'),log=require('../util/lo'+'g');function send(
|
|
9
|
+
const http=require('node:http'),serialization=require('../util/se'+'rializatio'+'n.js'),log=require('../util/lo'+'g.js');function send(_0x224dea,_0x7093a8,_0x5d4715){_0x224dea=_0x224dea||[];if(!_0x7093a8){_0x5d4715(new Error('Remote\x20is\x20'+'required'));return;}const _0x4e2e21=_0x7093a8['node'],_0x56ac91=_0x7093a8['service'],_0x48edf5=_0x7093a8['method'],_0x2e4c6b=_0x7093a8['gid']||'local';if(!(_0x224dea instanceof Array)){_0x5d4715(new Error('Message\x20mu'+'st\x20be\x20an\x20a'+'rray'));return;}if(!_0x4e2e21){_0x5d4715(new Error('Node\x20is\x20re'+'quired'));return;}if(!_0x56ac91){_0x5d4715(new Error('Service\x20is'+'\x20required'));return;}if(!_0x48edf5){_0x5d4715(new Error('Method\x20is\x20'+'required'));return;}log('[comm.send'+']:\x20Sending'+'\x20'+JSON['stringify'](_0x224dea)+'\x20to\x20'+_0x7093a8['service']+':'+_0x7093a8['method']+'\x20on\x20'+_0x7093a8['node']['ip']+':'+_0x7093a8['node']['port']);const _0xa6cadd=serialization['serialize'](_0x224dea),_0xe13459={'hostname':_0x4e2e21['ip'],'port':_0x4e2e21['port'],'path':'/'+_0x2e4c6b+'/'+_0x56ac91+'/'+_0x48edf5,'method':'PUT','headers':{'Content-Type':'applicatio'+'n/json','Content-Length':Buffer['byteLength'](_0xa6cadd)}},_0x5e937b=http['request'](_0xe13459,_0x581cf3=>{let _0x442a8e='';_0x581cf3['on']('data',function(_0x242e2d){_0x442a8e+=_0x242e2d;}),_0x581cf3['on']('end',function(){const [_0x1d6204,_0x55b1e9]=serialization['deserializ'+'e'](_0x442a8e);if(_0x5d4715)return _0x5d4715(_0x1d6204,_0x55b1e9);}),_0x581cf3['on']('error',_0x3a1543=>{if(_0x5d4715)return _0x5d4715(new Error('Error\x20on\x20r'+'esponse'));});});_0x5e937b['on']('error',_0x82e349=>{if(_0x5d4715)return _0x5d4715(new Error(_0x82e349));}),_0x5e937b['write'](_0xa6cadd),_0x5e937b['end']();}module['exports']={'send':send};
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const N=0x2672+-0xcc5+-0x19a3,messageStore={'messages':[],'push'(_0xb574c0){this['messages']['push'](_0xb574c0),this['messages']['length']>N&&this['messages']['shift']();},'has'(_0x491b55){return this['messages']['includes'](_0x491b55);}};function recv(_0x363e49,_0x4b6303){const {message:_0x3d09d8,remote:_0x51ca33,mid:_0x546912,gid:_0x645713}=_0x363e49;if(messageStore['has'](_0x546912)){_0x4b6303(new Error('Message\x20al'+'ready\x20rece'+'ived'));return;}globalThis['distributi'+'on'][_0x645713]['gossip']['send'](_0x363e49,_0x51ca33,()=>{}),messageStore['push'](_0x546912),_0x51ca33['node']={'ip':globalThis['distributi'+'on']['node']['config']['ip'],'port':globalThis['distributi'+'on']['node']['config']['port']},globalThis['distributi'+'on']['local']['comm']['send'](_0x3d09d8,_0x51ca33,(_0x3b9595,_0x41bc38)=>{_0x4b6303(_0x3b9595,_0x41bc38);});}module['exports']={'recv':recv};
|
|
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'),
|
|
9
|
+
const log=require('../util/lo'+'g'),groupsStore={};groupsStore['all']={},groupsStore['all'][globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config'])]=globalThis['distributi'+'on']['node']['config'];function get(_0x3727ef,_0x42b552){return _0x3727ef in groupsStore?_0x42b552(null,groupsStore[_0x3727ef]):_0x42b552(new Error('Group\x20'+_0x3727ef+'\x20not\x20found'),null);}function put(_0x1dc776,_0x14ae76,_0x4990b2){log('groups.put'+':\x20config:\x20'+JSON['stringify'](_0x1dc776)+'\x20group:\x20'+JSON['stringify'](_0x14ae76)),_0x14ae76=_0x14ae76||{};typeof _0x1dc776==='string'&&(_0x1dc776={'gid':_0x1dc776});if(!_0x1dc776['gid'])return _0x4990b2(Error('Config\x20gid'+'\x20was\x20null'),null);groupsStore[_0x1dc776['gid']]=_0x14ae76,Object['values'](_0x14ae76)['forEach'](_0x29e4d3=>{groupsStore['all'][globalThis['distributi'+'on']['util']['id']['getSID'](_0x29e4d3)]=_0x29e4d3;});const {setup:_0x2cac1a}=require('../../dist'+'ribution/a'+'ll/all.js');return globalThis['distributi'+'on'][_0x1dc776['gid']]=_0x2cac1a(_0x1dc776),_0x4990b2(null,_0x14ae76);}function del(_0x5de672,_0x29cc22){if(_0x5de672 in groupsStore){const _0x2d3b80=groupsStore[_0x5de672];return delete groupsStore[_0x5de672],globalThis['distributi'+'on'][_0x5de672]&&delete globalThis['distributi'+'on'][_0x5de672],_0x29cc22(null,_0x2d3b80);}else return _0x29cc22(new Error('Group\x20'+_0x5de672+'\x20not\x20found'));}function add(_0x4c8a17,_0x2f1765,_0x3c843d){log('[all.group'+'s.add]\x20gro'+'up\x20name:\x20'+_0x4c8a17+'\x20node:\x20'+JSON['stringify'](_0x2f1765));if(_0x4c8a17 in groupsStore){!groupsStore[_0x4c8a17]&&(groupsStore[_0x4c8a17]={});groupsStore[_0x4c8a17][globalThis['distributi'+'on']['util']['id']['getSID'](_0x2f1765)]=_0x2f1765,groupsStore['all'][globalThis['distributi'+'on']['util']['id']['getSID'](_0x2f1765)]=_0x2f1765;if(_0x3c843d)return _0x3c843d(null,groupsStore[_0x4c8a17]);}else{if(_0x3c843d)return _0x3c843d(new Error('Group\x20'+_0x4c8a17+'\x20not\x20found'));}};function rem(_0x1c371c,_0xe5da82,_0x19f1ed){return log('[all.group'+'s.rem]\x20nam'+'e:\x20'+_0x1c371c+'\x20node:\x20'+_0xe5da82),_0x1c371c in groupsStore?(delete groupsStore[_0x1c371c][_0xe5da82],delete groupsStore['all'][_0xe5da82],_0x19f1ed(null,groupsStore[_0x1c371c])):_0x19f1ed(new Error('Group\x20'+_0x1c371c+'\x20not\x20found'));};module['exports']={'get':get,'put':put,'del':del,'add':add,'rem':rem};
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const status=require('./status'),groups=require('./groups'),routes=require('./routes'),comm=require('./comm'),gossip=require('./gossip'),mem=require('./mem'),store=require('./store');module['exports']={'status':status,'routes':routes,'comm':comm,'groups':groups,'gossip':gossip,'mem':mem,'store':store};
|
|
9
|
+
const status=require('./status.j'+'s'),groups=require('./groups.j'+'s'),routes=require('./routes.j'+'s'),comm=require('./comm.js'),gossip=require('./gossip.j'+'s'),mem=require('./mem.js'),store=require('./store.js');module['exports']={'status':status,'routes':routes,'comm':comm,'groups':groups,'gossip':gossip,'mem':mem,'store':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':
|
|
9
|
+
const log=require('../util/lo'+'g'),kvStore={'store':{},'get'(_0x31ff7c){if(!this['store'][_0x31ff7c['gid']])return undefined;return this['store'][_0x31ff7c['gid']][_0x31ff7c['key']];},'put'(_0x2669f8,_0x2ae2fb){!this['store'][_0x2669f8['gid']]&&(this['store'][_0x2669f8['gid']]={}),this['store'][_0x2669f8['gid']][_0x2669f8['key']]=_0x2ae2fb;},'append'(_0x86e50c,_0xf3a07f){!this['get'](_0x86e50c)&&this['put'](_0x86e50c,[]),!Array['isArray'](this['get'](_0x86e50c))&&this['put'](_0x86e50c,[this['get'](_0x86e50c)]),Array['isArray'](_0xf3a07f)?this['put'](_0x86e50c,this['get'](_0x86e50c)['concat'](_0xf3a07f)):this['store'][_0x86e50c['gid']][_0x86e50c['key']]['push'](_0xf3a07f);},'del'(_0x260b35){if(!this['store'][_0x260b35['gid']])return undefined;const _0x3ab912=this['store'][_0x260b35['gid']][_0x260b35['key']];return delete this['store'][_0x260b35['gid']][_0x260b35['key']],_0x3ab912;},'toString'(){let _0x55985a='';for(const _0x32d025 in this['store']){_0x55985a+=_0x32d025+':\x20'+JSON['stringify'](this['store'][_0x32d025]);}return _0x55985a;}};function normalize(_0x524e74){if(_0x524e74===null)return{'key':null,'gid':null,'action':null};else return typeof _0x524e74==='string'?{'key':_0x524e74,'gid':null,'action':null}:_0x524e74;};function put(_0x58c889,_0x10fa8e,_0x52de98){log('[mem.put]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x10fa8e)+'\x20state:\x20'+JSON['stringify'](_0x58c889)+'\x20store:\x20'+kvStore['toString']());let {key:_0x5689bc,gid:_0x27cb95,action:_0x2aef1c}=normalize(_0x10fa8e);_0x5689bc=_0x5689bc||globalThis['distributi'+'on']['util']['id']['getID'](_0x58c889),_0x27cb95=_0x27cb95||'local',_0x2aef1c=_0x2aef1c||'put',kvStore[_0x2aef1c]({'key':_0x5689bc,'gid':_0x27cb95},_0x58c889),log('[mem.put]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']());if(_0x52de98)return _0x52de98(null,_0x58c889);};function get(_0x580a28,_0x4b9fa2){log('[mem.get]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x580a28)+'\x20store:\x20'+kvStore['toString']());let {key:_0x54f1bd,gid:_0x469b6d}=normalize(_0x580a28);_0x469b6d=_0x469b6d||'local';if(_0x54f1bd){const _0x46632b=kvStore['get']({'key':_0x54f1bd,'gid':_0x469b6d});return _0x46632b?_0x4b9fa2(null,_0x46632b):_0x4b9fa2(new Error('Memory\x20key'+'\x20\x22'+_0x54f1bd+('\x22\x20not\x20foun'+'d\x20for\x20')+_0x469b6d+'\x27s\x20store'));}else{let _0x421980=kvStore['store'][_0x469b6d]||{};return _0x421980=Object['keys'](_0x421980),_0x4b9fa2(null,_0x421980);}}function del(_0x44fdcd,_0x125c27){log('[mem.del]\x20'+'configurat'+'ion:\x20'+JSON['stringify'](_0x44fdcd)+'\x20store:\x20'+kvStore['toString']());let {key:_0x3e94bc,gid:_0xacd8d4}=normalize(_0x44fdcd);_0xacd8d4=_0xacd8d4||'local';const _0x4142d3=kvStore['del']({'key':_0x3e94bc,'gid':_0xacd8d4});return log('[mem.del]\x20'+'store\x20(aft'+'er):\x20'+kvStore['toString']()),_0x4142d3?_0x125c27(null,_0x4142d3):_0x125c27(new Error('Memory\x20key'+'\x20\x22'+_0x3e94bc+('\x22\x20not\x20foun'+'d\x20for\x20')+_0xacd8d4+'\x27s\x20store'));};module['exports']={'put':put,'get':get,'del':del};
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const http=require('http'),url=require('url'),log=require('../util/lo'+'g');function
|
|
9
|
+
const http=require('node:http'),url=require('node:url'),log=require('../util/lo'+'g.js'),args=require('yargs')['argv'];function setNodeConfig(){let _0x41c15b,_0x2ce115,_0x1f9a29;typeof args['ip']==='string'&&(_0x41c15b=args['ip']);typeof args['port']==='string'&&(_0x2ce115=parseInt(args['port']));if(typeof args['config']==='string'){const {ip:_0x44fcbd,port:_0x335446,onStart:_0x16a4f5}=globalThis['distributi'+'on']['util']['deserializ'+'e'](args['config']);typeof _0x44fcbd==='string'&&(_0x41c15b=_0x44fcbd),typeof _0x335446==='number'&&(_0x2ce115=_0x335446),typeof _0x16a4f5==='function'&&(_0x1f9a29=_0x16a4f5);}return _0x41c15b=_0x41c15b||'127.0.0.1',_0x2ce115=_0x2ce115||0x16c7+-0xb*-0x293+-0x1*0x2e46,{'ip':_0x41c15b,'port':_0x2ce115,'onStart':_0x1f9a29};}function validate(_0x35101b){if(_0x35101b['length']===-0x1bc8+0x15f0+0x58*0x11)throw new Error('No\x20body');return JSON['parse'](_0x35101b);}function start(_0x2edead){const _0x3eca42=http['createServ'+'er']((_0x1144bd,_0x651cbe)=>{if(_0x1144bd['method']!=='PUT'){_0x651cbe['end'](globalThis['distributi'+'on']['util']['serialize'](new Error('Method\x20not'+'\x20allowed!')));return;}const [,_0x4ddf2c,_0x3e5e05,_0x56a5d5]=url['parse'](_0x1144bd['url'])['pathname']['split']('/');log('[server]\x20g'+'ot\x20request'+'\x20'+_0x4ddf2c+'\x20'+_0x3e5e05+':'+_0x56a5d5+'\x20from\x20'+_0x1144bd['socket']['remoteAddr'+'ess']);const _0x57b4da=[];_0x1144bd['on']('data',_0x533dcf=>{_0x57b4da['push'](_0x533dcf);}),_0x1144bd['on']('end',()=>{let _0x3f49c4;try{_0x3f49c4=validate(Buffer['concat'](_0x57b4da)['toString']());}catch(_0x2e25d3){_0x651cbe['end'](globalThis['distributi'+'on']['util']['serialize']([_0x2e25d3]));return;}const _0x479c5d=globalThis['distributi'+'on']['util']['deserializ'+'e'](_0x3f49c4);!Array['isArray'](_0x479c5d)&&_0x651cbe['end'](globalThis['distributi'+'on']['util']['serialize']([new Error('Invalid\x20ar'+'gument\x20typ'+'e,\x20expecte'+'d\x20array,\x20g'+'ot\x20'+typeof _0x479c5d)]));const _0x41ed9f=_0x3e5e05;globalThis['distributi'+'on']['local']['routes']['get']({'service':_0x3e5e05,'gid':_0x4ddf2c},(_0x544747,_0x10a68a)=>{if(_0x544747){_0x651cbe['end'](globalThis['distributi'+'on']['util']['serialize']([_0x544747,null]));return;}if(!_0x10a68a[_0x56a5d5]){_0x651cbe['end'](globalThis['distributi'+'on']['util']['serialize']([new Error('Method\x20'+_0x56a5d5+('\x20not\x20found'+'\x20in\x20servic'+'e\x20')+_0x41ed9f),null]));return;}log('[server]\x20\x20'+'Calling\x20se'+'rvice:\x20'+_0x41ed9f+':'+_0x56a5d5+('\x20with\x20args'+':\x20')+JSON['stringify'](_0x479c5d));_0x479c5d['length']===0x1f2e*-0x1+0x1020+0xf0f&&_0x10a68a[_0x56a5d5]['length']===-0x1342+-0x1*-0x2072+-0xd2d&&_0x479c5d['push'](undefined);const _0x273bc1=_0x10a68a[_0x56a5d5]['bind'](_0x10a68a),_0x3746ab=globalThis['distributi'+'on']['util']['normalize'](_0x273bc1,_0x479c5d);try{_0x273bc1(..._0x3746ab,(_0x310183,_0x1473b2)=>_0x651cbe['end'](globalThis['distributi'+'on']['util']['serialize']([_0x310183,_0x1473b2])));}catch(_0x463d82){_0x651cbe['end'](globalThis['distributi'+'on']['util']['serialize']([_0x463d82,null]));}});});}),_0x3e09d7=globalThis['distributi'+'on']['node']['config'];_0x3eca42['listen'](_0x3e09d7['port'],_0x3e09d7['ip'],()=>{log('Server\x20run'+'ning\x20at\x20ht'+'tp://'+_0x3e09d7['ip']+':'+_0x3e09d7['port']+'/'),globalThis['distributi'+'on']['node']['server']=_0x3eca42,_0x2edead();}),_0x3eca42['on']('error',_0x56cfe6=>{log('Server\x20err'+'or:\x20'+_0x56cfe6);throw _0x56cfe6;});}module['exports']={'start':start,'config':setNodeConfig()};
|
|
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(
|
|
9
|
+
const log=require('../util/lo'+'g'),routesStore=new Map();function get(_0x46a330,_0x5ca7b0){log('[routes.ge'+'t]\x20Getting'+'\x20service:\x20'+JSON['stringify'](_0x46a330));if(!_0x46a330)return _0x5ca7b0(new Error('No\x20configu'+'ration\x20pro'+'vided!'));typeof _0x46a330==='string'&&(_0x46a330={'service':_0x46a330});const _0x1cfbc6=_0x46a330['service'],_0x13571f=_0x46a330['gid'];if(_0x13571f&&_0x13571f!=='local')return log('[routes.ge'+'t]\x20Found\x20d'+'istributed'+'\x20service:\x20'+_0x1cfbc6),_0x5ca7b0(null,globalThis['distributi'+'on'][_0x13571f][_0x1cfbc6]);else{const _0x1a374f=routesStore['get'](_0x1cfbc6);if(_0x1a374f)return log('[routes.ge'+'t]\x20Found\x20l'+'ocal\x20servi'+'ce:\x20'+_0x1cfbc6),_0x5ca7b0(null,_0x1a374f);else{const _0x182935=globalThis['toLocal']['get'](_0x1cfbc6);return _0x182935?(log('[routes.ge'+'t]\x20Found\x20R'+'PC:\x20'+_0x1cfbc6),_0x5ca7b0(null,{'call':_0x182935})):_0x5ca7b0(new Error('Service\x20'+_0x1cfbc6+('\x20not\x20found'+'\x20in\x20routes')));}}}function put(_0x160b72,_0x182dbd,_0x58aa05){log('[routes.pu'+'t]\x20Putting'+'\x20service:\x20'+_0x182dbd),routesStore['set'](_0x182dbd,_0x160b72);if(_0x58aa05)return _0x58aa05(null,_0x182dbd);}function rem(_0x588da7,_0x1661e9){const _0x5d0f91=routesStore['get'](_0x588da7);return routesStore['delete'](_0x588da7),_0x1661e9(null,_0x5d0f91);}module['exports']={'get':get,'put':put,'rem':rem};
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const log=require('../util/lo'+'g'),
|
|
9
|
+
const log=require('../util/lo'+'g'),counts=0x2*0x5f7+-0xd2a*-0x1+-0x1918;function get(_0x1d680b,_0x4be35a){if(_0x1d680b in globalThis['distributi'+'on']['node']['config']){_0x4be35a(null,globalThis['distributi'+'on']['node']['config'][_0x1d680b]);return;}if(_0x1d680b==='sid'){_0x4be35a(null,globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x1d680b==='nid'){_0x4be35a(null,globalThis['distributi'+'on']['util']['id']['getNID'](globalThis['distributi'+'on']['node']['config']));return;}if(_0x1d680b==='counts'){_0x4be35a(null,counts);return;}if(_0x1d680b==='heapTotal'){_0x4be35a(null,process['memoryUsag'+'e']()['heapTotal']);return;}if(_0x1d680b==='heapUsed'){_0x4be35a(null,process['memoryUsag'+'e']()['heapUsed']);return;}_0x4be35a(new Error('Status\x20key'+'\x20not\x20found'));};const fs=require('fs'),path=require('path'),proc=require('node:child'+'_process');function getDistribution(){let _0x5455b3=path['join'](process['cwd'](),'config.js');if(fs['existsSync'](_0x5455b3))return _0x5455b3;try{const _0x441f08=proc['execSync']('git\x20rev-pa'+'rse\x20--show'+'-toplevel',{'encoding':'utf8'})['trim']();_0x5455b3=path['join'](_0x441f08,'config.js');if(fs['existsSync'](_0x5455b3))return _0x5455b3;}catch(_0x99b481){throw new Error('Not\x20in\x20a\x20G'+'it\x20reposit'+'ory\x20or\x20git'+'\x20command\x20f'+'ailed.');}_0x5455b3=path['join'](__dirname,'../../','config.js');if(fs['existsSync'](_0x5455b3))return _0x5455b3;_0x5455b3=path['join'](__dirname,'../../','distributi'+'on.js');if(fs['existsSync'](_0x5455b3))return _0x5455b3;throw new Error('Failed\x20to\x20'+'find\x20proje'+'ct\x20root.');}function createOnStart(_0x2d7911,_0x4c59b1){const _0x5a5dbe='\x0a\x20\x20\x20\x20let\x20o'+'nStart\x20=\x20'+_0x2d7911['toString']()+(';\x0a\x20\x20\x20\x20let\x20'+'callbackRP'+'C\x20=\x20')+globalThis['distributi'+'on']['util']['wire']['createRPC'](globalThis['distributi'+'on']['util']['wire']['toAsync'](_0x4c59b1))['toString']()+(';\x0a\x20\x20\x20\x20try\x20'+'{\x0a\x20\x20\x20\x20\x20\x20on'+'Start();\x0a\x20'+'\x20\x20\x20\x20\x20callb'+'ackRPC(nul'+'l,\x20global.'+'distributi'+'on.node.co'+'nfig,\x20()\x20='+'>\x20{});\x0a\x20\x20\x20'+'\x20}\x20catch(e'+')\x20{\x0a\x20\x20\x20\x20\x20\x20'+'callbackRP'+'C(e,\x20null,'+'\x20()\x20=>\x20{})'+';\x0a\x20\x20\x20\x20}\x0a\x20\x20');return new Function(_0x5a5dbe);}function spawn(_0x4f0991,_0x1b0bd2){const _0x46f8bb=_0x4f0991;_0x46f8bb['onStart']=_0x46f8bb['onStart']||function(){};if(!_0x46f8bb['port']||!_0x46f8bb['ip']){_0x1b0bd2(new Error('Port\x20and\x20I'+'P\x20are\x20requ'+'ired\x20in\x20th'+'e\x20configur'+'ation'));return;}log('[status.sp'+'awn]\x20Spawn'+'ing\x20node\x20w'+'ith\x20config'+'uration:\x20'+JSON['stringify'](_0x46f8bb));const _0x3a74a8=(_0x4222ef,_0x5dcaf9)=>{if(_0x4222ef){_0x1b0bd2(_0x4222ef);return;}globalThis['distributi'+'on']['local']['groups']['add']('all',_0x5dcaf9,()=>{_0x1b0bd2(_0x4222ef,_0x5dcaf9);});};_0x46f8bb['onStart']=createOnStart(_0x46f8bb['onStart'],_0x3a74a8);const _0xc572dd=getDistribution(),_0x2b3e41=proc['spawn']('node',[_0xc572dd,'--config',globalThis['distributi'+'on']['util']['serialize'](_0x46f8bb)],{'detached':!![],'stdio':'inherit'});_0x2b3e41;}function stop(_0x3c79f9){return log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),globalThis['distributi'+'on']['node']['server']['close'](),process['nextTick'](()=>process['exit'](0x3*-0x43+-0x1b*0x115+0x1e00)),_0x3c79f9(null,globalThis['distributi'+'on']['node']['config']);}module['exports']={'get':get,'spawn':spawn,'stop':stop};
|
|
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)
|
|
9
|
+
const fs=require('fs'),path=require('path'),id=require('../util/id'),serialization=require('../util/se'+'rializatio'+'n'),log=require('../util/lo'+'g'),baseFolder=path['join'](__dirname,'../../stor'+'e');!fs['existsSync'](baseFolder)&&fs['mkdirSync'](baseFolder);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(_0x3b0f47){if(_0x3b0f47===null)return{'key':null,'gid':null,'action':'put'};else return typeof _0x3b0f47==='string'?{'key':_0x3b0f47,'gid':null,'action':'put'}:_0x3b0f47;}function put(_0x1ec5ba,_0x345ea9,_0x87322d){log('[store.put'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x345ea9)+'\x20state:\x20'+JSON['stringify'](_0x1ec5ba)),_0x345ea9=normalize(_0x345ea9),_0x345ea9['key']=_0x345ea9['key']||id['getID'](_0x1ec5ba),_0x345ea9['gid']=_0x345ea9['gid']||'local';const _0x3f2527=serialization['serialize'](_0x1ec5ba),_0x4a286f=Buffer['from'](_0x345ea9['key'])['toString']('base64'),_0x2e3100=path['join'](nodeFolder,_0x345ea9['gid']+'-'+_0x4a286f);fs['writeFile'](_0x2e3100,_0x3f2527,_0x4fb0c1=>{return _0x4fb0c1?_0x87322d(_0x4fb0c1):_0x87322d(null,_0x1ec5ba);});}function get(_0x14d784,_0x3fed28){log('[store.get'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x14d784)),_0x14d784=normalize(_0x14d784),_0x14d784['gid']=_0x14d784['gid']||'local';if(!_0x14d784['key']){fs['readdir'](nodeFolder,(_0x561559,_0x399954)=>{if(_0x561559)return _0x3fed28(_0x561559);const _0x47fbf7=[];for(let _0x372683=-0x8*-0x265+0x161f*-0x1+0x2f7;_0x372683<_0x399954['length'];_0x372683++){const _0x27cae0=_0x399954[_0x372683]['split']('-'),_0x13fc9a=_0x27cae0[-0x4*-0x313+0x622+-0x126e];if(_0x13fc9a!==_0x14d784['gid'])continue;const _0x1ab0cc=_0x27cae0[_0x27cae0['length']-(-0x101a+0x75b+0x8c0)];_0x47fbf7['push'](Buffer['from'](_0x1ab0cc,'base64')['toString']());}return _0x3fed28(null,_0x47fbf7);});return;}const _0x42e084=Buffer['from'](_0x14d784['key'])['toString']('base64'),_0x17e0c8=path['join'](nodeFolder,_0x14d784['gid']+'-'+_0x42e084);fs['readFile'](_0x17e0c8,(_0x52c8db,_0x558936)=>{return _0x52c8db?_0x52c8db['code']==='ENOENT'?_0x3fed28(new Error('File\x20'+_0x17e0c8+('\x20(from\x20key'+'\x20\x27')+_0x14d784['key']+('\x27)\x20not\x20fou'+'nd\x20for\x20gro'+'up\x20')+_0x14d784['gid'])):_0x3fed28(_0x52c8db):_0x3fed28(null,serialization['deserializ'+'e'](_0x558936['toString']()));});}function del(_0x58a169,_0x4db702){log('[store.del'+']\x20configur'+'ation:\x20'+JSON['stringify'](_0x58a169)),_0x58a169=normalize(_0x58a169),_0x58a169['gid']=_0x58a169['gid']||'local';const _0x26992a=Buffer['from'](_0x58a169['key'])['toString']('base64'),_0x5409ab=path['join'](nodeFolder,_0x58a169['gid']+'-'+_0x26992a);get(_0x58a169,(_0x41afcd,_0x26fc3f)=>{if(_0x41afcd)return _0x4db702(_0x41afcd);fs['rm'](_0x5409ab,_0x41ab40=>{return _0x41ab40?_0x4db702(_0x41ab40):_0x4db702(null,_0x26fc3f);});});}module['exports']={'put':put,'get':get,'del':del};
|
|
10
10
|
/* eslint-enable */
|
package/distribution/util/id.js
CHANGED
|
@@ -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(
|
|
9
|
+
const assert=require('assert'),crypto=require('crypto');function getID(_0x1d946c){const _0x2be2a4=crypto['createHash']('sha256');return _0x2be2a4['update'](JSON['stringify'](_0x1d946c)),_0x2be2a4['digest']('hex');}function getNID(_0x536ef2){return _0x536ef2={'ip':_0x536ef2['ip'],'port':_0x536ef2['port']},getID(_0x536ef2);}function getSID(_0x12e3d7){return getNID(_0x12e3d7)['substring'](-0x1*0x1431+-0x17b*0x3+0x18a2*0x1,-0xb6b+-0x1bdc*0x1+0x274c);}function getMID(_0x1928c8){const _0x1c4e2f={};return _0x1c4e2f['date']=new Date()['getTime'](),_0x1c4e2f['mss']=_0x1928c8,getID(_0x1c4e2f);}function idToNum(_0x21a12b){assert(typeof _0x21a12b==='string','idToNum:\x20i'+'d\x20is\x20not\x20i'+'n\x20KID\x20form'+'!');const _0x199e5b=_0x21a12b['startsWith']('0x')?_0x21a12b['slice'](0x2*-0x4ef+-0xd6*0x22+0xcc4*0x3):_0x21a12b;if(/^[0-9a-fA-F]+$/['test'](_0x199e5b))return BigInt('0x'+_0x199e5b);return BigInt(_0x21a12b);}const naiveHash=(_0x26b108,_0x300027)=>{_0x300027['sort']();const _0x30639f=Number(idToNum(_0x26b108)%BigInt(_0x300027['length']));return _0x300027[_0x30639f];},consistentHash=(_0x62cad7,_0x4440e1)=>{const _0x1fc965=idToNum(_0x62cad7),_0x69a163=_0x4440e1['map'](_0x5160bf=>({'id':_0x5160bf,'hash':idToNum(_0x5160bf)}));_0x69a163['sort']((_0x2f08e0,_0x23ed1b)=>{if(_0x2f08e0['hash']<_0x23ed1b['hash'])return-(0x7*0x355+0x1f36*-0x1+-0x14*-0x65);if(_0x2f08e0['hash']>_0x23ed1b['hash'])return-0x1*0x26b4+-0x171b+0x3dd0;return-0x3f4+0x2643+-0x224f;});for(const _0x44479b of _0x69a163){if(_0x1fc965<=_0x44479b['hash'])return _0x44479b['id'];}return _0x69a163[0x10*-0xf5+-0x1539*0x1+-0x2f*-0xc7]['id'];},rendezvousHash=(_0x426513,_0x3c9ebe)=>{let _0x4a6064=null,_0x2e1425=null;for(const _0x343537 of _0x3c9ebe){const _0x1d9a92=getID(_0x426513+_0x343537),_0x6913d5=idToNum(_0x1d9a92);(_0x4a6064===null||_0x6913d5>_0x4a6064)&&(_0x4a6064=_0x6913d5,_0x2e1425=_0x343537);}if(_0x2e1425===null)throw Error('maxNID\x20is\x20'+'null.\x20nids'+'\x20is\x20likely'+'\x20an\x20empty\x20'+'list');else return _0x2e1425;};module['exports']={'getID':getID,'getNID':getNID,'getSID':getSID,'getMID':getMID,'naiveHash':naiveHash,'consistentHash':consistentHash,'rendezvousHash':rendezvousHash};
|
|
10
10
|
/* eslint-enable */
|
package/distribution/util/log.js
CHANGED
|
@@ -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'),logFile=path['join']('/tmp','log.txt');function log(
|
|
9
|
+
const fs=require('node:fs'),path=require('node:path'),logFile=path['join']('/tmp','log.txt');function log(_0x3ac907,_0x284121){!_0x284121&&(_0x284121='info');const _0x37f7ee=new Date(),_0x1eac02=new Intl['DateTimeFo'+'rmat']('en-GB',{'day':'2-digit','month':'2-digit','year':'numeric','hour':'2-digit','minute':'2-digit','second':'2-digit','hour12':![]})['format'](_0x37f7ee)+'.'+String(_0x37f7ee['getMillise'+'conds']()*(0x914+0x1dfa*-0x1+0x5*0x4f6))['padStart'](0x1c2c+-0x10*-0x1e+-0x44a*0x7,'0'),_0x5aa946=globalThis['distributi'+'on']['util']['id']['getSID'](globalThis['distributi'+'on']['node']['config']);fs['appendFile'+'Sync'](logFile,_0x1eac02+'\x20['+globalThis['distributi'+'on']['node']['config']['ip']+':'+globalThis['distributi'+'on']['node']['config']['port']+'\x20('+_0x5aa946+')]\x20['+_0x284121+']\x20'+_0x3ac907+'\x0a');}module['exports']=log;
|
|
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 nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){const
|
|
9
|
+
const nativeFunctions={'forward':new Map(),'reverse':new Map()};function createNativeMap(){const _0x521ac3=[];function _0x1ca59d(_0x34e3b7,_0x1070b6){if(_0x1070b6===null||_0x1070b6===undefined)return;if(_0x521ac3['indexOf'](_0x1070b6)!==-(-0x1136*0x2+0x1*-0x827+0x2a94))return;_0x521ac3['push'](_0x1070b6),Object['getOwnProp'+'ertyNames'](_0x1070b6)['forEach'](_0x5cc576=>{if(typeof _0x1070b6[_0x5cc576]==='function'){nativeFunctions['forward']['set'](_0x1070b6[_0x5cc576],_0x34e3b7+'.'+_0x5cc576),nativeFunctions['reverse']['set'](_0x34e3b7+'.'+_0x5cc576,_0x1070b6[_0x5cc576]);return;}typeof _0x1070b6[_0x5cc576]==='object'&&_0x521ac3['indexOf'](_0x1070b6[_0x5cc576])===-(0x380+0x18b*0x2+-0x695)&&_0x1ca59d(_0x34e3b7+'.'+_0x5cc576,_0x1070b6[_0x5cc576]);});}for(const _0x5c2140 of require('repl')['_builtinLi'+'bs']){if(['wasi','sys','punycode','crypto']['includes'](_0x5c2140))continue;const _0x1d6bb8=require(_0x5c2140);_0x1ca59d(_0x5c2140,_0x1d6bb8);}}createNativeMap();function decycleObject(_0x2cd70e){if(_0x2cd70e===null||_0x2cd70e===undefined)return _0x2cd70e;const _0x59c57c=new WeakMap();function _0x55592c(_0x1b4883,_0x275489){let _0x585c56;if(!(typeof _0x1b4883==='object'&&!(_0x1b4883 instanceof Error)&&!(_0x1b4883 instanceof Date)&&!(_0x1b4883 instanceof Boolean)&&_0x1b4883!==null))return _0x1b4883;const _0x3d21f5=_0x59c57c['get'](_0x1b4883);if(_0x3d21f5!==undefined)return{'$reference':_0x3d21f5};return _0x59c57c['set'](_0x1b4883,_0x275489),Array['isArray'](_0x1b4883)?(_0x585c56=[],_0x1b4883['forEach'](function(_0x1113ee,_0x29f358){const _0x5b9b02=[..._0x275489,_0x29f358];_0x585c56[_0x29f358]=_0x55592c(_0x1113ee,_0x5b9b02);})):(_0x585c56={},Object['keys'](_0x1b4883)['forEach'](_0x33e506=>{const _0x3af39d=[..._0x275489,JSON['stringify'](_0x33e506)];_0x585c56[_0x33e506]=_0x55592c(_0x1b4883[_0x33e506],_0x3af39d);})),_0x585c56;}return _0x55592c(_0x2cd70e,[]);}function serializeBaseStructure(_0x24e35a){return{'type':typeof _0x24e35a,'value':_0x24e35a['toString']()};}function serializeBigInt(_0x491991){return{'type':'bigint','value':_0x491991['toString']()};}function serializeUndefined(_0x5a7c5c){return{'type':'undefined','value':''};}function serializeObject(_0x14786a){if(_0x14786a===null)return{'type':'null','value':''};else{if(_0x14786a instanceof Date)return{'type':'date','value':_0x14786a['toJSON']()};else{if(_0x14786a instanceof Error)return{'type':'error','value':serializeObject({'name':_0x14786a['name'],'message':_0x14786a['message'],'cause':_0x14786a['cause']})};}}if(_0x14786a['$reference']!==undefined&&Object['keys'](_0x14786a)['length']===0x1735+0x515+-0x1c49)return{'type':'reference','value':_0x14786a['$reference']};const _0x26aca4=Object['fromEntrie'+'s'](Object['entries'](_0x14786a)['map'](([_0xeaad49,_0x2a39a6])=>[_0xeaad49,serialize(_0x2a39a6)]));return{'type':_0x14786a instanceof Array?'array':'object','value':_0x26aca4};}function serializeFunction(_0x2d7641){const _0x817517=nativeFunctions['forward']['get'](_0x2d7641);return _0x817517===undefined?{'type':'function','value':_0x2d7641['toString']()}:{'type':'native','value':_0x817517};}function serialize(_0x1d4031){_0x1d4031=decycleObject(_0x1d4031);let _0x184a3f;switch(typeof _0x1d4031){case'object':_0x184a3f=serializeObject(_0x1d4031);break;case'function':_0x184a3f=serializeFunction(_0x1d4031);break;case'undefined':_0x184a3f=serializeUndefined(_0x1d4031);break;case'number':case'string':case'boolean':_0x184a3f=serializeBaseStructure(_0x1d4031);break;case'bigint':_0x184a3f=serializeBigInt(_0x1d4031);break;}return JSON['stringify'](_0x184a3f);}function deserializeObject(_0x434b82,_0x1f1e23){for(const [_0x6f6fbd,_0x5b95cb]of Object['entries'](_0x434b82)){_0x1f1e23[_0x6f6fbd]=doSerialize(_0x5b95cb,_0x1f1e23);}return _0x1f1e23;}function deserializeArray(_0x4778df,_0x1aea16){for(const [_0x4acc26,_0x2c3849]of Object['entries'](_0x4778df)){_0x1aea16[Number(_0x4acc26)]=doSerialize(_0x2c3849,_0x1aea16);}return _0x1aea16;}function deserializeString(_0x360abb){return _0x360abb;}function deserializeNumber(_0xcf130){return Number(_0xcf130);}function deserializeFunction(_0xc4aa1){return new Function('return\x20'+_0xc4aa1)();}function deserializeError(_0x497d13){const _0x377a7c=doSerialize(_0x497d13),_0x1df15f=new Error(_0x377a7c['message'],_0x377a7c['cause']);return _0x1df15f;}function deserializeReference(_0x1fcda7,_0xb9f95d){let _0x2653a2=_0xb9f95d;for(const _0x389f07 of _0x1fcda7){_0x2653a2=_0x2653a2[JSON['parse'](_0x389f07)];}return _0x2653a2;}function deserializeNative(_0x5e99d3){const _0x270340=nativeFunctions['reverse']['get'](_0x5e99d3);if(_0x270340===undefined)throw Error('Function\x20n'+'ot\x20found\x20i'+'n\x20native\x20f'+'unction\x20ma'+'p');return _0x270340;}function deserializeReferences(_0x26db98,_0x54061c){if(typeof _0x26db98!=='object'||_0x26db98===null)return _0x26db98;if(_0x26db98['type']==='reference')return deserializeReference(_0x26db98['value'],_0x54061c);if(Array['isArray'](_0x26db98))for(let _0x1782da=0x182c+0x1eda+-0x3706;_0x1782da<_0x26db98['length'];_0x1782da++){_0x26db98[_0x1782da]=deserializeReferences(_0x26db98[_0x1782da],_0x54061c);}else for(const [_0x4764c3,_0x137568]of Object['entries'](_0x26db98)){_0x26db98[_0x4764c3]=deserializeReferences(_0x137568,_0x54061c);}return _0x26db98;}function doSerialize(_0x157e49,_0x3e00bd=null){let _0x170e99;if(typeof _0x157e49==='object')_0x170e99=_0x157e49;else{if(typeof _0x157e49==='string')_0x170e99=JSON['parse'](_0x157e49);else throw new Error('Invalid\x20ar'+'gument\x20typ'+'e:\x20'+typeof _0x157e49+'.');}_0x3e00bd===null&&(_0x3e00bd={});switch(_0x170e99['type']){case'object':return deserializeObject(_0x170e99['value'],{});case'array':return deserializeArray(_0x170e99['value'],[]);case'function':return deserializeFunction(_0x170e99['value']);case'native':return deserializeNative(_0x170e99['value']);case'reference':return _0x170e99;case'number':return deserializeNumber(_0x170e99['value']);case'string':return deserializeString(_0x170e99['value']);case'boolean':return _0x170e99['value']==='true';case'bigint':return BigInt(_0x170e99['value']);case'date':return new Date(_0x170e99['value']);case'error':return deserializeError(_0x170e99['value']);case'null':return null;case'undefined':return undefined;default:throw new Error('Invalid\x20se'+'rialized\x20o'+'bject\x20type');}}function deserialize(_0x493bde){const _0x2c387d=doSerialize(_0x493bde);return deserializeReferences(_0x2c387d,_0x2c387d),_0x2c387d;}module['exports']={'serialize':serialize,'deserialize':deserialize};
|
|
10
10
|
/* eslint-enable */
|
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const serialization=require('./serializ'+'ation'),id=require('./id'),wire=require('./wire');module['exports']={'serialize':serialization['serialize'],'deserialize':serialization['deserializ'+'e'],'id':id,'wire':wire};
|
|
9
|
+
const serialization=require('./serializ'+'ation.js'),id=require('./id.js'),wire=require('./wire.js');function normalize(_0x4552bb,_0x4eb303){const _0x8ae455=[..._0x4eb303];if(_0x4eb303['length']<_0x4552bb['length']-(-0x1808+-0x6d4+-0x1edd*-0x1)){const _0x57a91d=_0x4552bb['length']-_0x4eb303['length']-(-0x13a2+0x1d7e+-0x9db);for(let _0x1a2262=-0x122b*-0x1+0x2463+-0x368e;_0x1a2262<_0x57a91d;_0x1a2262++){_0x8ae455['push'](undefined);}}return _0x8ae455;}module['exports']={'normalize':normalize,'serialize':serialization['serialize'],'deserialize':serialization['deserializ'+'e'],'id':id,'wire':wire};
|
|
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');
|
|
9
|
+
const log=require('../util/lo'+'g.js');globalThis['toLocal']=new Map();function createRPC(_0x5a49bc){const _0xd49be6=globalThis['distributi'+'on']['util']['id']['getID'](globalThis['distributi'+'on']['util']['serialize'](_0x5a49bc));globalThis['toLocal']['set'](_0xd49be6,_0x5a49bc);let _0x5b135b='\x0a\x20\x20\x20\x20const'+'\x20callback\x20'+'=\x20args.pop'+'();\x0a\x0a\x20\x20\x20\x20l'+'et\x20remote\x20'+'=\x20{node:\x20'+JSON['stringify'](globalThis['distributi'+'on']['node']['config'])+(',\x20service:'+'\x20\x27')+_0xd49be6+('\x27,\x20method:'+'\x20\x27call\x27};\x0a'+'\x20\x20\x20\x20let\x20me'+'ssage\x20=\x20ar'+'gs;\x0a\x0a\x20\x20\x20\x20d'+'istributio'+'n.local.co'+'mm.send(me'+'ssage,\x20rem'+'ote,\x20(erro'+'r,\x20respons'+'e)\x20=>\x20{\x0a\x20\x20'+'\x20\x20\x20\x20if\x20(er'+'ror)\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(error)'+';\x0a\x20\x20\x20\x20\x20\x20}\x20'+'else\x20{\x0a\x20\x20\x20'+'\x20\x20\x20\x20\x20callb'+'ack(null,\x20'+'response);'+'\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20'+'\x20\x20\x20});\x0a\x20\x20');return log('Created\x20RP'+'C\x20with\x20id:'+'\x20'+_0xd49be6),new Function('...args',_0x5b135b);}function toAsync(_0x452d3c){log('Converting'+'\x20function\x20'+'to\x20async:\x20'+_0x452d3c['name']+':\x20'+_0x452d3c['toString']()['replace'](/\n/g,'|'));const _0x435fd5=(..._0x1a3ffa)=>{const _0x5d5c1b=_0x1a3ffa['pop']();try{const _0xa98c6b=_0x452d3c(..._0x1a3ffa);return _0x5d5c1b(null,_0xa98c6b);}catch(_0x3447e7){return _0x5d5c1b(_0x3447e7);}};return _0x435fd5['toString']=()=>_0x452d3c['toString'](),_0x435fd5;}function dispatchMessage(_0x1b7acb,_0xc332d7,{key:_0x3f2260},_0xab9960,_0x2d849a){globalThis['distributi'+'on'][_0xab9960['gid']]['status']['get']('nid',(_0x41504c,_0x5e270a)=>{const _0x27ad58=Object['values'](_0x5e270a),_0x494ea5=globalThis['distributi'+'on']['util']['id']['getID'](_0x3f2260),_0x437604=_0xab9960['hash'](_0x494ea5,_0x27ad58),_0xdd0985=_0x437604['substring'](0x1153+0x10d6+-0x2229,-0x1f*0xc9+-0x1*-0x168b+0x1d1);globalThis['distributi'+'on']['local']['groups']['get'](_0xab9960['gid'],(_0x2aee21,_0x481548)=>{if(_0x481548){const _0x512fe4=_0x481548[_0xdd0985];globalThis['distributi'+'on']['local']['comm']['send'](_0x1b7acb,{..._0xc332d7,'node':_0x512fe4},_0x2d849a);}else return _0x2d849a(_0x2aee21);});});}module['exports']={'createRPC':createRPC,'toAsync':toAsync,'dispatchMessage':dispatchMessage};
|
|
10
10
|
/* eslint-enable */
|
package/distribution.js
CHANGED
|
@@ -1,86 +1,72 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {import("./distribution/types.js").Node} Node
|
|
4
|
+
*/
|
|
2
5
|
|
|
3
|
-
const util = require('./distribution/util/util.js');
|
|
4
6
|
const log = require('./distribution/util/log.js');
|
|
5
|
-
const args = require('yargs').argv;
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
You can pass "ip" and "port" arguments directly.
|
|
18
|
-
Use this to startup nodes from the terminal.
|
|
19
|
-
|
|
20
|
-
Usage:
|
|
21
|
-
./distribution.js --ip '127.0.0.1' --port 1234 # Start node on localhost:1234
|
|
22
|
-
*/
|
|
23
|
-
if (args.ip) {
|
|
24
|
-
global.nodeConfig.ip = args.ip;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (args.port) {
|
|
28
|
-
global.nodeConfig.port = parseInt(args.port);
|
|
29
|
-
}
|
|
8
|
+
/**
|
|
9
|
+
* @param {Node} [config]
|
|
10
|
+
*/
|
|
11
|
+
function bootstrap(config) {
|
|
12
|
+
if (globalThis.distribution) {
|
|
13
|
+
log('global.distribution has already been setup');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
30
16
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
nodeConfig.onStart : global.nodeConfig.onStart;
|
|
38
|
-
}
|
|
17
|
+
// @ts-ignore This is the first time globalThis.distribution is being initialized, so the object does not have all the necessary properties.
|
|
18
|
+
globalThis.distribution = {};
|
|
19
|
+
globalThis.distribution.util = require('./distribution/util/util.js');
|
|
20
|
+
// @ts-ignore node.server is lazily initialized.
|
|
21
|
+
globalThis.distribution.node = require('./distribution/local/node.js');
|
|
22
|
+
globalThis.distribution.local = require('./distribution/local/local.js');
|
|
39
23
|
|
|
40
|
-
const distribution = function(config) {
|
|
41
24
|
if (config) {
|
|
42
|
-
|
|
43
|
-
this.nodeConfig = config;
|
|
25
|
+
globalThis.distribution.node.config = config;
|
|
44
26
|
}
|
|
45
27
|
|
|
46
|
-
|
|
47
|
-
};
|
|
28
|
+
for (const [key, service] of Object.entries(globalThis.distribution.local)) {
|
|
29
|
+
globalThis.distribution.local.routes.put(service, key, () => {});
|
|
30
|
+
}
|
|
48
31
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
global.distribution = distribution;
|
|
52
|
-
}
|
|
32
|
+
const {setup} = require('./distribution/all/all.js');
|
|
33
|
+
globalThis.distribution.all = setup({gid: 'all'});
|
|
53
34
|
|
|
54
|
-
|
|
55
|
-
distribution.local = require('./distribution/local/local.js');
|
|
56
|
-
distribution.node = require('./distribution/local/node.js');
|
|
35
|
+
/* Overrides when missing functionality from previous milestone or extra credit is needed */
|
|
57
36
|
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
// For M3, when missing RPC, its path through routes, and status.{spawn, stop}
|
|
38
|
+
/*
|
|
39
|
+
globalThis.distribution.util.wire.createRPC = require('@brown-ds/distribution').util.wire.createRPC;
|
|
40
|
+
globalThis.distribution.local.routes.get = require('@brown-ds/distribution').local.routes.get;
|
|
41
|
+
globalThis.distribution.local.status.spawn = require('@brown-ds/distribution').local.status.spawn;
|
|
42
|
+
globalThis.distribution.local.status.stop = require('@brown-ds/distribution').local.status.stop;
|
|
43
|
+
*/
|
|
60
44
|
}
|
|
61
45
|
|
|
62
|
-
/*
|
|
63
|
-
distribution
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
require('./distribution/all/comm')({gid: 'all'});
|
|
68
|
-
distribution['all'].gossip =
|
|
69
|
-
require('./distribution/all/gossip')({gid: 'all'});
|
|
70
|
-
distribution['all'].groups =
|
|
71
|
-
require('./distribution/all/groups')({gid: 'all'});
|
|
72
|
-
distribution['all'].routes =
|
|
73
|
-
require('./distribution/all/routes')({gid: 'all'});
|
|
74
|
-
distribution['all'].mem =
|
|
75
|
-
require('./distribution/all/mem')({gid: 'all'});
|
|
76
|
-
distribution['all'].store =
|
|
77
|
-
require('./distribution/all/store')({gid: 'all'});
|
|
46
|
+
/*
|
|
47
|
+
This logic determines which implementation of the distribution library to use.
|
|
48
|
+
It can either be:
|
|
49
|
+
1. The reference implementation from the library @brown-ds/distribution
|
|
50
|
+
2. Your own, local implementation
|
|
78
51
|
|
|
79
|
-
|
|
80
|
-
|
|
52
|
+
Which one to be used by the tests is determined by the value of the property "useLibrary" in the package.json file.
|
|
53
|
+
*/
|
|
54
|
+
// @ts-ignore JSON import resolved at runtime.
|
|
55
|
+
const {useLibrary} = require('./package.json');
|
|
56
|
+
// @ts-ignore Optional dependency for reference implementation.
|
|
57
|
+
const distribution = useLibrary ? require('@brown-ds/distribution') : bootstrap;
|
|
81
58
|
|
|
82
59
|
/* The following code is run when distribution.js is run directly */
|
|
83
60
|
if (require.main === module) {
|
|
84
|
-
|
|
85
|
-
|
|
61
|
+
distribution();
|
|
62
|
+
// __start_solution__
|
|
63
|
+
log(
|
|
64
|
+
`[node] Starting node with configuration: ${
|
|
65
|
+
JSON.stringify(globalThis.distribution.node.config)
|
|
66
|
+
}`,
|
|
67
|
+
);
|
|
68
|
+
// __end_solution__
|
|
69
|
+
globalThis.distribution.node.start(globalThis.distribution.node.config.onStart || (() => {}));
|
|
86
70
|
}
|
|
71
|
+
|
|
72
|
+
module.exports = distribution;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brown-ds/distribution",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"description": "A library for building distributed systems.",
|
|
5
5
|
"main": "distribution.js",
|
|
6
6
|
"useLibrary": false,
|
|
@@ -10,36 +10,115 @@
|
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"eslint": "^8.55.0",
|
|
12
12
|
"eslint-config-google": "^0.14.0",
|
|
13
|
+
"eslint-plugin-n": "^16.6.2",
|
|
13
14
|
"javascript-obfuscator": "^4.1.0",
|
|
14
|
-
"jest": "^27.4.7"
|
|
15
|
+
"jest": "^27.4.7",
|
|
16
|
+
"typescript": "^5.8.3"
|
|
15
17
|
},
|
|
16
18
|
"scripts": {
|
|
17
|
-
"pretest": "./scripts/pretest.sh",
|
|
18
19
|
"test": "./scripts/test.sh",
|
|
19
|
-
"
|
|
20
|
-
"lint": "eslint --ignore-path .gitignore --config .eslintrc . --fix"
|
|
20
|
+
"lint": "./scripts/lint.sh"
|
|
21
21
|
},
|
|
22
22
|
"author": "",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"yargs": "^17.7.2"
|
|
26
26
|
},
|
|
27
|
-
"report":
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
27
|
+
"report": [
|
|
28
|
+
{
|
|
29
|
+
"milestone": "M1",
|
|
30
|
+
"hours": 999,
|
|
31
|
+
"loc": 999,
|
|
32
|
+
"dev": {
|
|
33
|
+
"cpu-no": 999,
|
|
34
|
+
"mem-gb": 999,
|
|
35
|
+
"ssd-gb": 999
|
|
36
|
+
},
|
|
37
|
+
"throughput": {
|
|
38
|
+
"dev": [],
|
|
39
|
+
"aws": []
|
|
40
|
+
},
|
|
41
|
+
"latency": {
|
|
42
|
+
"dev": [],
|
|
43
|
+
"aws": []
|
|
44
|
+
},
|
|
45
|
+
"dloc": -99
|
|
34
46
|
},
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
47
|
+
{
|
|
48
|
+
"milestone": "M2",
|
|
49
|
+
"hours": 999,
|
|
50
|
+
"loc": 999,
|
|
51
|
+
"dev": {
|
|
52
|
+
"cpu-no": 999,
|
|
53
|
+
"mem-gb": 999,
|
|
54
|
+
"ssd-gb": 999
|
|
55
|
+
},
|
|
56
|
+
"throughput": {
|
|
57
|
+
"dev": [],
|
|
58
|
+
"aws": []
|
|
59
|
+
},
|
|
60
|
+
"latency": {
|
|
61
|
+
"dev": [],
|
|
62
|
+
"aws": []
|
|
63
|
+
},
|
|
64
|
+
"dloc": -99
|
|
38
65
|
},
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
66
|
+
{
|
|
67
|
+
"milestone": "M3",
|
|
68
|
+
"hours": 999,
|
|
69
|
+
"loc": 999,
|
|
70
|
+
"dev": {
|
|
71
|
+
"cpu-no": 999,
|
|
72
|
+
"mem-gb": 999,
|
|
73
|
+
"ssd-gb": 999
|
|
74
|
+
},
|
|
75
|
+
"throughput": {
|
|
76
|
+
"dev": [],
|
|
77
|
+
"aws": []
|
|
78
|
+
},
|
|
79
|
+
"latency": {
|
|
80
|
+
"dev": [],
|
|
81
|
+
"aws": []
|
|
82
|
+
},
|
|
83
|
+
"dloc": -99
|
|
42
84
|
},
|
|
43
|
-
|
|
44
|
-
|
|
85
|
+
{
|
|
86
|
+
"milestone": "M4",
|
|
87
|
+
"hours": 999,
|
|
88
|
+
"loc": 999,
|
|
89
|
+
"dev": {
|
|
90
|
+
"cpu-no": 999,
|
|
91
|
+
"mem-gb": 999,
|
|
92
|
+
"ssd-gb": 999
|
|
93
|
+
},
|
|
94
|
+
"throughput": {
|
|
95
|
+
"dev": [],
|
|
96
|
+
"aws": []
|
|
97
|
+
},
|
|
98
|
+
"latency": {
|
|
99
|
+
"dev": [],
|
|
100
|
+
"aws": []
|
|
101
|
+
},
|
|
102
|
+
"dloc": -99
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"milestone": "M5",
|
|
106
|
+
"hours": 999,
|
|
107
|
+
"loc": 999,
|
|
108
|
+
"dev": {
|
|
109
|
+
"cpu-no": 999,
|
|
110
|
+
"mem-gb": 999,
|
|
111
|
+
"ssd-gb": 999
|
|
112
|
+
},
|
|
113
|
+
"throughput": {
|
|
114
|
+
"dev": [],
|
|
115
|
+
"aws": []
|
|
116
|
+
},
|
|
117
|
+
"latency": {
|
|
118
|
+
"dev": [],
|
|
119
|
+
"aws": []
|
|
120
|
+
},
|
|
121
|
+
"dloc": -99
|
|
122
|
+
}
|
|
123
|
+
]
|
|
45
124
|
}
|