已有数据同步功能完成
This commit is contained in:
36
ebpf/c/replica.h
Normal file
36
ebpf/c/replica.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef __REPLICA_H__
|
||||
#define __REPLICA_H__
|
||||
|
||||
enum event_type {
|
||||
EVENT_CREATE_SNAPSHOT_ASYNC,
|
||||
EVENT_CREATE_SNAPSHOT_OK,
|
||||
EVENT_CREATE_SNAPSHOT_READY,
|
||||
EVENT_COMPLETED_CMD
|
||||
};
|
||||
|
||||
struct event {
|
||||
enum event_type type;
|
||||
union {
|
||||
struct {
|
||||
char ip[16];
|
||||
__u32 port;
|
||||
} sync;
|
||||
struct {
|
||||
__u8 cmd[256];
|
||||
__u64 len;
|
||||
} cmd;
|
||||
struct {
|
||||
char array_file[128];
|
||||
char rbtree_file[128];
|
||||
char hash_file[128];
|
||||
} ok;
|
||||
} data;
|
||||
};
|
||||
|
||||
enum state {
|
||||
NOSLAVE,
|
||||
PREPARING,
|
||||
ONLINE
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user