⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhblock_replicated_srv.h

📁 chord 源码 http://pdos.csail.mit.edu/chord/
💻 H
字号:
#ifndef __DHBLOCK_REPLICATED_SRV__#define __DHBLOCK_REPLICATED_SRV__#include <dhblock_srv.h>#include <chord.h>#include <adb_prot.h>class location;class merkle_tree;class merkle_server;class dhblock_replicated_srv;struct rjrep : public repair_job {  rjrep (blockID key, ptr<location> w, ptr<dhblock_replicated_srv> bsrv);  const ptr<dhblock_replicated_srv> bsrv;  void execute ();  // Async callbacks  void repair_retrieve_cb (dhash_stat err, 			   ptr<dhash_block> b, 			   route r);  void repair_send_cb (dhash_stat err, bool something);  bool repair (blockID k, ptr<location> to);};class dhblock_replicated_srv : public dhblock_srv{  friend struct rjrep;  // async callbacks  void delete_cb (chordID k, str d, cb_dhstat cb, adb_status stat);  void store_after_fetch_cb (str d, cb_dhstat cb, adb_status stat, 			     chordID key, str old_data);    void store_after_rstore_cb (chordID dbkey, cb_dhstat cb, dhash_stat astat);  void finish_store (chordID key);  void localqueue (clnt_stat err, adb_status stat, vec<block_info> blocks);protected:  const dhash_ctype ctype;  merkle_tree *mtree;  merkle_server *msrv;  qhash<chordID, vec<cbv> *, hashID> _paused_stores;  virtual void populate_mtree (adb_status stat, vec<chordID> keys, vec<u_int32_t> aux);  // Mutable blocks require Merkle key tweaking  virtual chordID idaux_to_mkey (chordID key, u_int32_t aux);  virtual chordID id_to_dbkey (chordID key);  virtual void real_store (chordID key, str od, str nd, cb_dhstat cb) = 0;  virtual void real_repair (blockID key, ptr<location> me, u_int32_t *myaux, ptr<location> them, u_int32_t *theiraux) = 0;public:  dhblock_replicated_srv (ptr<vnode> node, ptr<dhashcli> cli,			  str dbname, str dbext, str desc,                          dhash_ctype ctype, cbv donecb);  merkle_server *mserv () { return msrv; };  virtual void store (chordID key, str d, cb_dhstat cb);  virtual void fetch (chordID key, cb_fetch cb);  virtual void generate_repair_jobs ();};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -