@brown-ds/distribution 0.0.35 → 0.0.37

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.
@@ -0,0 +1,10 @@
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 distribution=global['distributi'+'on'],util=distribution['util'],log=require('../util/lo'+'g');function getNode(_0x589765,_0x19e411,_0xc1f933){typeof _0x19e411==='object'&&(_0x19e411=_0x19e411['key']),distribution[_0x589765['gid']]['status']['get']('nid',(_0x56a4dc,_0x327511)=>{let _0x1ec6eb=Object['values'](_0x327511),_0x2a079a=util['id']['getID'](_0x19e411),_0x2b837c=_0x589765['hash'](_0x2a079a,_0x1ec6eb),_0x3f4b86=_0x2b837c['substring'](0xfac+0x12f2+-0x229e,0x1676+-0x17c*0x1a+-0x33b*-0x5);distribution['local']['groups']['get'](_0x589765['gid'],(_0x36b12d,_0x3152f9)=>{let _0xe9ec=_0x3152f9[_0x3f4b86];log('[mem\x20(getN'+'ode)]\x20conf'+'iguration:'+'\x20'+JSON['stringify'](_0x19e411)+'group:\x20'+JSON['stringify'](_0x3152f9)+'\x20node:\x20'+JSON['stringify'](_0xe9ec)+'nid:\x20'+JSON['stringify'](_0x2b837c)+'\x20sid:\x20'+JSON['stringify'](_0x3f4b86)),_0xc1f933(_0xe9ec);});});}function normalize(_0xe68513,_0x44d826){let _0x23951e={};_0xe68513===null&&(_0xe68513={});if(typeof _0xe68513==='string')_0x23951e['key']=_0xe68513,_0x23951e['gid']=_0x44d826,_0x23951e['action']='put';else typeof _0xe68513==='object'&&(_0x23951e['key']=_0xe68513['key'],_0x23951e['gid']=_0xe68513['gid']||_0x44d826,_0x23951e['action']=_0xe68513['action']||'put');return _0x23951e;};const mem=function(_0x3a1d0e){let _0x2283ec={};return _0x2283ec['gid']=_0x3a1d0e['gid']||'all',_0x2283ec['hash']=_0x3a1d0e['hash']||util['id']['naiveHash'],{'get':(_0xaccb4e,_0x5dad77)=>{if(!_0xaccb4e){let _0x886e1d=[{'key':null,'gid':_0x2283ec['gid']}];distribution[_0x2283ec['gid']]['comm']['send'](_0x886e1d,{'service':'mem','method':'get'},(_0x71d717,_0xf9e85d)=>{let _0x50cc5a=Object['values'](_0xf9e85d)['reduce']((_0x614ca4,_0x13fda0)=>_0x614ca4['concat'](_0x13fda0),[]);_0x5dad77(_0x71d717,_0x50cc5a);});return;}_0xaccb4e=normalize(_0xaccb4e,_0x2283ec['gid']),getNode(_0x2283ec,_0xaccb4e,_0x4083f4=>{let _0x1c45e4=[_0xaccb4e],_0xc7d1fc={'service':'mem','method':'get','node':_0x4083f4};log('[all.mem.g'+'et]\x20config'+'uration:\x20'+JSON['stringify'](_0xaccb4e)+'\x20node:\x20'+JSON['stringify'](global['nodeConfig'])+('\x20target\x20no'+'de:\x20')+JSON['stringify'](_0x4083f4)),distribution['local']['comm']['send'](_0x1c45e4,_0xc7d1fc,_0x5dad77);});},'put':(_0x2ac3e5,_0x2d7ec8,_0x4fecc2)=>{_0x2d7ec8=_0x2d7ec8||util['id']['getID'](_0x2ac3e5),_0x2d7ec8=normalize(_0x2d7ec8,_0x2283ec['gid']),getNode(_0x2283ec,_0x2d7ec8,_0x286b9e=>{let _0x49f76f=[_0x2ac3e5,_0x2d7ec8],_0x21c899={'service':'mem','method':'put','node':_0x286b9e};log('[all.mem.p'+'ut]\x20state:'+'\x20'+JSON['stringify'](_0x2ac3e5)+('configurat'+'ion:\x20')+JSON['stringify'](_0x2d7ec8)+('target\x20nod'+'e:\x20')+JSON['stringify'](_0x286b9e)),distribution['local']['comm']['send'](_0x49f76f,_0x21c899,_0x4fecc2);});},'del':(_0x16b8b2,_0x5ede00)=>{getNode(_0x2283ec,_0x16b8b2,_0x35d4fc=>{let _0x44075a=[{'key':_0x16b8b2,'gid':_0x2283ec['gid']}],_0x48105a={'service':'mem','method':'del','node':_0x35d4fc};distribution['local']['comm']['send'](_0x44075a,_0x48105a,_0x5ede00);});},'reconf':(_0x2ae122,_0x2ec210)=>{distribution[_0x2283ec['gid']]['mem']['get'](null,(_0x4e758b,_0x4f2a58)=>{distribution[_0x2283ec['gid']]['status']['get']('nid',(_0x3c9859,_0x464236)=>{let _0xfbb01a=Object['values'](_0x464236),_0x2f589b=Object['values'](_0x2ae122)['map'](_0x260bab=>util['id']['getNID'](_0x260bab)),_0x2cdc74=0xeb7*0x1+0x1*0x18ac+-0x2763*0x1;const _0x5113ba=()=>{_0x2cdc74===_0x4f2a58['length']&&_0x2ec210();};if(_0x4f2a58['length']===0x1f5f+-0x1*-0x49f+-0x23fe){_0x2ec210();return;}for(let _0x1e74de of _0x4f2a58){let _0x3a2d06=util['id']['getID'](_0x1e74de),_0x55df9c=_0x2283ec['hash'](_0x3a2d06,_0x2f589b),_0x545ae9=_0x2283ec['hash'](_0x3a2d06,_0xfbb01a);if(_0x55df9c===_0x545ae9){_0x2cdc74++,_0x5113ba();continue;}let _0x4853c1=_0x2ae122[_0x55df9c['substring'](-0xb5c*0x1+-0x691+0x11ed,-0x2037+-0x1fcc+0x4008)],_0x1ffaf1=[{'key':_0x1e74de,'gid':_0x2283ec['gid']}],_0x1b81a2={'service':'mem','method':'del','node':_0x4853c1};distribution['local']['comm']['send'](_0x1ffaf1,_0x1b81a2,(_0x4e42af,_0x394b89)=>{distribution[_0x2283ec['gid']]['mem']['put'](_0x394b89,_0x1e74de,(_0xe183fd,_0x27f8da)=>{_0x2cdc74++,_0x5113ba();});});}});});}};};module['exports']=mem;
10
+ /* eslint-enable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brown-ds/distribution",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "A library for building distributed systems.",
5
5
  "main": "distribution.js",
6
6
  "useLibrary": false,