@@ -38,22 +38,22 @@ class TabletNodeZkAdapter : public TabletNodeZkAdapterBase {
38
38
virtual bool GetRootTableAddr (std::string* root_table_addr);
39
39
40
40
private:
41
- bool Register (const std::string& session_id, int * zk_code);
42
- bool Unregister (int * zk_code);
43
-
44
- bool WatchMaster (std::string* master, int * zk_code);
45
- bool WatchSafeModeMark (bool * is_exist, int * zk_code);
46
- bool WatchKickMark (bool * is_exist, int * zk_code);
47
- bool WatchSelfNode (bool * is_exist, int * zk_code);
48
- bool WatchRootNode (bool * is_exist, std::string* root_tablet_addr, int * zk_errno);
49
-
50
- void OnSafeModeMarkCreated ();
51
- void OnSafeModeMarkDeleted ();
52
- void OnKickMarkCreated ();
53
- void OnSelfNodeDeleted ();
54
- void OnRootNodeCreated ();
55
- void OnRootNodeDeleted ();
56
- void OnRootNodeChanged (const std::string& root_tablet_addr);
41
+ virtual bool Register (const std::string& session_id, int * zk_code);
42
+ virtual bool Unregister (int * zk_code);
43
+
44
+ virtual bool WatchMaster (std::string* master, int * zk_code);
45
+ virtual bool WatchSafeModeMark (bool * is_exist, int * zk_code);
46
+ virtual bool WatchKickMark (bool * is_exist, int * zk_code);
47
+ virtual bool WatchSelfNode (bool * is_exist, int * zk_code);
48
+ virtual bool WatchRootNode (bool * is_exist, std::string* root_tablet_addr, int * zk_errno);
49
+
50
+ virtual void OnSafeModeMarkCreated ();
51
+ virtual void OnSafeModeMarkDeleted ();
52
+ virtual void OnKickMarkCreated ();
53
+ virtual void OnSelfNodeDeleted ();
54
+ virtual void OnRootNodeCreated ();
55
+ virtual void OnRootNodeDeleted ();
56
+ virtual void OnRootNodeChanged (const std::string& root_tablet_addr);
57
57
58
58
virtual void OnChildrenChanged (const std::string& path,
59
59
const std::vector<std::string>& name_list,
@@ -72,6 +72,19 @@ class TabletNodeZkAdapter : public TabletNodeZkAdapterBase {
72
72
std::string kick_node_path_;
73
73
};
74
74
75
+ class MockTabletNodeZkAdapter : public TabletNodeZkAdapter {
76
+ public:
77
+ MockTabletNodeZkAdapter (TabletNodeImpl* tabletnode_impl,
78
+ const std::string & server_addr) :
79
+ TabletNodeZkAdapter (tabletnode_impl, server_addr) {}
80
+ virtual ~MockTabletNodeZkAdapter () {}
81
+ private:
82
+ virtual void OnKickMarkCreated () {}
83
+ virtual void OnSelfNodeDeleted () {}
84
+ virtual void OnWatchFailed (const std::string& /* path*/ , int /* watch_type*/ , int /* err*/ ) {}
85
+ virtual void OnSessionTimeout () {}
86
+ };
87
+
75
88
class FakeTabletNodeZkAdapter : public TabletNodeZkAdapterBase {
76
89
public:
77
90
FakeTabletNodeZkAdapter (TabletNodeImpl* tabletnode_impl,
0 commit comments