-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpfs_metaserver.proto
103 lines (85 loc) · 2.2 KB
/
pfs_metaserver.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
syntax = "proto3";
import "google/protobuf/empty.proto";
service MetaService {
rpc getClientId (ClientInfo) returns (ClientId);
rpc startClientService(ClientInfo) returns (google.protobuf.Empty);
rpc createFile(FileCreateRequest) returns (ResponseCode);
rpc openFile(FileOpenRequest) returns (ResponseCode);
rpc deleteFile(FileDeleteRequest) returns (Sidlist);
rpc requestToken(Token) returns (ResponseCode);
rpc getServerInfoForBlock(Blockinfo) returns (ResponseCode);
rpc canCacheBlock(CacheRequest) returns (ResponseCode);
rpc closefd(CloseRequest) returns (google.protobuf.Empty);
rpc fstat(ResponseCode) returns (Metadata);
rpc getfilesize(File) returns (File);
rpc setfilesize(File) returns (File);
}
service ClientService {
rpc isConnected (ClientInfo) returns (google.protobuf.Empty);
rpc revokeTokens(Token) returns (google.protobuf.Empty);
rpc setUnlock(google.protobuf.Empty) returns (google.protobuf.Empty);
rpc stopRevocation(File) returns (google.protobuf.Empty);
rpc invalidateCacheBlock(Blockinfo) returns (google.protobuf.Empty);
}
message File {
int32 fd = 1;
int64 filesize = 2;
}
message Metadata {
string fname = 1;
int64 filesize = 2;
int64 ctime = 3;
int64 mtime = 4;
int32 res = 5;
}
message Sidlist {
int32 fd = 3;
repeated int32 sids = 1;
int32 res = 2;
}
message FileDeleteRequest {
string filename = 1;
}
message CloseRequest {
int32 clientid = 1;
int32 fd = 2;
}
message Blockinfo {
int32 fd = 1;
int64 blocknum = 2;
}
message CacheRequest {
Blockinfo block = 1;
int32 type = 2;
int32 full = 3;
int32 clientid = 4;
}
message ClientInfo {
string client_ip = 1;
string client_name = 2;
int32 clientid = 3;
}
message ClientId {
int32 id = 1;
}
message FileCreateRequest {
string filename = 1;
int32 stripe_width = 2;
}
message ResponseCode {
int32 val = 1;
}
message FileOpenRequest {
string filename = 1;
int32 mode = 2;
}
message Tokeninterval {
int64 startoffset = 1;
int64 endoffset = 2;
}
message Token {
int32 clientid = 1;
int32 fd = 2;
repeated Tokeninterval tokenintervals = 3;
int32 type = 4;
}