-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpfs_client.proto
132 lines (107 loc) · 2.77 KB
/
pfs_client.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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 deleteFile(FileDeleteRequest) returns (Sidlist);
rpc openFile(FileOpenRequest) returns (ResponseCode);
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);
}
service FileService {
rpc isConnected(Dummy) returns (google.protobuf.Empty);
rpc readData(Blockinfo) returns (Data);
rpc writeData(Data) returns (google.protobuf.Empty);
rpc writeDataSpecific(DataSpecific) returns (google.protobuf.Empty);
rpc deleteFd(File) returns (google.protobuf.Empty);
}
message Sidlist {
int32 fd = 3;
repeated int32 sids = 1;
int32 res = 2;
}
message Dummy {
int32 dummy = 1;
}
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 CacheRequest {
Blockinfo block = 1;
int32 type = 2;
int32 full = 3;
int32 clientid = 4;
}
message CloseRequest {
int32 clientid = 1;
int32 fd = 2;
}
message Data {
bytes data = 1;
int32 fd = 2;
int64 blocknum = 3;
}
message DataSpecific {
bytes data = 1;
int32 fd = 2;
int64 blocknum = 3;
int64 startoffset = 4;
int64 size = 5;
}
message Blockinfo {
int32 fd = 1;
int64 blocknum = 2;
}
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 FileDeleteRequest {
string filename = 1;
}
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;
}