You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

320 lines
7.6 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. syntax = "proto3";
  2. package volume_server_pb;
  3. //////////////////////////////////////////////////
  4. service VolumeServer {
  5. //Experts only: takes multiple fid parameters. This function does not propagate deletes to replicas.
  6. rpc BatchDelete (BatchDeleteRequest) returns (BatchDeleteResponse) {
  7. }
  8. rpc VacuumVolumeCheck (VacuumVolumeCheckRequest) returns (VacuumVolumeCheckResponse) {
  9. }
  10. rpc VacuumVolumeCompact (VacuumVolumeCompactRequest) returns (VacuumVolumeCompactResponse) {
  11. }
  12. rpc VacuumVolumeCommit (VacuumVolumeCommitRequest) returns (VacuumVolumeCommitResponse) {
  13. }
  14. rpc VacuumVolumeCleanup (VacuumVolumeCleanupRequest) returns (VacuumVolumeCleanupResponse) {
  15. }
  16. rpc DeleteCollection (DeleteCollectionRequest) returns (DeleteCollectionResponse) {
  17. }
  18. rpc AllocateVolume (AllocateVolumeRequest) returns (AllocateVolumeResponse) {
  19. }
  20. rpc VolumeSyncStatus (VolumeSyncStatusRequest) returns (VolumeSyncStatusResponse) {
  21. }
  22. rpc VolumeIncrementalCopy (VolumeIncrementalCopyRequest) returns (stream VolumeIncrementalCopyResponse) {
  23. }
  24. rpc VolumeMount (VolumeMountRequest) returns (VolumeMountResponse) {
  25. }
  26. rpc VolumeUnmount (VolumeUnmountRequest) returns (VolumeUnmountResponse) {
  27. }
  28. rpc VolumeDelete (VolumeDeleteRequest) returns (VolumeDeleteResponse) {
  29. }
  30. rpc VolumeMarkReadonly (VolumeMarkReadonlyRequest) returns (VolumeMarkReadonlyResponse) {
  31. }
  32. // copy the .idx .dat files, and mount this volume
  33. rpc VolumeCopy (VolumeCopyRequest) returns (VolumeCopyResponse) {
  34. }
  35. rpc ReadVolumeFileStatus (ReadVolumeFileStatusRequest) returns (ReadVolumeFileStatusResponse) {
  36. }
  37. rpc CopyFile (CopyFileRequest) returns (stream CopyFileResponse) {
  38. }
  39. rpc VolumeTailSender (VolumeTailSenderRequest) returns (stream VolumeTailSenderResponse) {
  40. }
  41. rpc VolumeTailReceiver (VolumeTailReceiverRequest) returns (VolumeTailReceiverResponse) {
  42. }
  43. // erasure coding
  44. rpc VolumeEcShardsGenerate (VolumeEcShardsGenerateRequest) returns (VolumeEcShardsGenerateResponse) {
  45. }
  46. rpc VolumeEcShardsRebuild (VolumeEcShardsRebuildRequest) returns (VolumeEcShardsRebuildResponse) {
  47. }
  48. rpc VolumeEcShardsCopy (VolumeEcShardsCopyRequest) returns (VolumeEcShardsCopyResponse) {
  49. }
  50. rpc VolumeEcShardsDelete (VolumeEcShardsDeleteRequest) returns (VolumeEcShardsDeleteResponse) {
  51. }
  52. rpc VolumeEcShardsMount (VolumeEcShardsMountRequest) returns (VolumeEcShardsMountResponse) {
  53. }
  54. rpc VolumeEcShardsUnmount (VolumeEcShardsUnmountRequest) returns (VolumeEcShardsUnmountResponse) {
  55. }
  56. rpc VolumeEcShardRead (VolumeEcShardReadRequest) returns (stream VolumeEcShardReadResponse) {
  57. }
  58. rpc VolumeEcBlobDelete (VolumeEcBlobDeleteRequest) returns (VolumeEcBlobDeleteResponse) {
  59. }
  60. }
  61. //////////////////////////////////////////////////
  62. message BatchDeleteRequest {
  63. repeated string file_ids = 1;
  64. }
  65. message BatchDeleteResponse {
  66. repeated DeleteResult results = 1;
  67. }
  68. message DeleteResult {
  69. string file_id = 1;
  70. int32 status = 2;
  71. string error = 3;
  72. uint32 size = 4;
  73. uint32 version = 5;
  74. }
  75. message Empty {
  76. }
  77. message VacuumVolumeCheckRequest {
  78. uint32 volume_id = 1;
  79. }
  80. message VacuumVolumeCheckResponse {
  81. double garbage_ratio = 1;
  82. }
  83. message VacuumVolumeCompactRequest {
  84. uint32 volume_id = 1;
  85. int64 preallocate = 2;
  86. }
  87. message VacuumVolumeCompactResponse {
  88. }
  89. message VacuumVolumeCommitRequest {
  90. uint32 volume_id = 1;
  91. }
  92. message VacuumVolumeCommitResponse {
  93. }
  94. message VacuumVolumeCleanupRequest {
  95. uint32 volume_id = 1;
  96. }
  97. message VacuumVolumeCleanupResponse {
  98. }
  99. message DeleteCollectionRequest {
  100. string collection = 1;
  101. }
  102. message DeleteCollectionResponse {
  103. }
  104. message AllocateVolumeRequest {
  105. uint32 volume_id = 1;
  106. string collection = 2;
  107. int64 preallocate = 3;
  108. string replication = 4;
  109. string ttl = 5;
  110. }
  111. message AllocateVolumeResponse {
  112. }
  113. message VolumeSyncStatusRequest {
  114. uint32 volume_id = 1;
  115. }
  116. message VolumeSyncStatusResponse {
  117. uint32 volume_id = 1;
  118. string collection = 2;
  119. string replication = 4;
  120. string ttl = 5;
  121. uint64 tail_offset = 6;
  122. uint32 compact_revision = 7;
  123. uint64 idx_file_size = 8;
  124. }
  125. message VolumeIncrementalCopyRequest {
  126. uint32 volume_id = 1;
  127. uint64 since_ns = 2;
  128. }
  129. message VolumeIncrementalCopyResponse {
  130. bytes file_content = 1;
  131. }
  132. message VolumeMountRequest {
  133. uint32 volume_id = 1;
  134. }
  135. message VolumeMountResponse {
  136. }
  137. message VolumeUnmountRequest {
  138. uint32 volume_id = 1;
  139. }
  140. message VolumeUnmountResponse {
  141. }
  142. message VolumeDeleteRequest {
  143. uint32 volume_id = 1;
  144. }
  145. message VolumeDeleteResponse {
  146. }
  147. message VolumeMarkReadonlyRequest {
  148. uint32 volume_id = 1;
  149. }
  150. message VolumeMarkReadonlyResponse {
  151. }
  152. message VolumeCopyRequest {
  153. uint32 volume_id = 1;
  154. string collection = 2;
  155. string replication = 3;
  156. string ttl = 4;
  157. string source_data_node = 5;
  158. }
  159. message VolumeCopyResponse {
  160. uint64 last_append_at_ns = 1;
  161. }
  162. message CopyFileRequest {
  163. uint32 volume_id = 1;
  164. string ext = 2;
  165. uint32 compaction_revision = 3;
  166. uint64 stop_offset = 4;
  167. string collection = 5;
  168. bool is_ec_volume = 6;
  169. }
  170. message CopyFileResponse {
  171. bytes file_content = 1;
  172. }
  173. message VolumeTailSenderRequest {
  174. uint32 volume_id = 1;
  175. uint64 since_ns = 2;
  176. uint32 idle_timeout_seconds = 3;
  177. }
  178. message VolumeTailSenderResponse {
  179. bytes needle_header = 1;
  180. bytes needle_body = 2;
  181. bool is_last_chunk = 3;
  182. }
  183. message VolumeTailReceiverRequest {
  184. uint32 volume_id = 1;
  185. uint64 since_ns = 2;
  186. uint32 idle_timeout_seconds = 3;
  187. string source_volume_server = 4;
  188. }
  189. message VolumeTailReceiverResponse {
  190. }
  191. message VolumeEcShardsGenerateRequest {
  192. uint32 volume_id = 1;
  193. string collection = 2;
  194. }
  195. message VolumeEcShardsGenerateResponse {
  196. }
  197. message VolumeEcShardsRebuildRequest {
  198. uint32 volume_id = 1;
  199. string collection = 2;
  200. }
  201. message VolumeEcShardsRebuildResponse {
  202. repeated uint32 rebuilt_shard_ids = 1;
  203. }
  204. message VolumeEcShardsCopyRequest {
  205. uint32 volume_id = 1;
  206. string collection = 2;
  207. repeated uint32 shard_ids = 3;
  208. bool copy_ecx_file = 4;
  209. string source_data_node = 5;
  210. }
  211. message VolumeEcShardsCopyResponse {
  212. }
  213. message VolumeEcShardsDeleteRequest {
  214. uint32 volume_id = 1;
  215. string collection = 2;
  216. repeated uint32 shard_ids = 3;
  217. }
  218. message VolumeEcShardsDeleteResponse {
  219. }
  220. message VolumeEcShardsMountRequest {
  221. uint32 volume_id = 1;
  222. string collection = 2;
  223. repeated uint32 shard_ids = 3;
  224. }
  225. message VolumeEcShardsMountResponse {
  226. }
  227. message VolumeEcShardsUnmountRequest {
  228. uint32 volume_id = 1;
  229. repeated uint32 shard_ids = 3;
  230. }
  231. message VolumeEcShardsUnmountResponse {
  232. }
  233. message VolumeEcShardReadRequest {
  234. uint32 volume_id = 1;
  235. uint32 shard_id = 2;
  236. int64 offset = 3;
  237. int64 size = 4;
  238. uint64 file_key = 5;
  239. }
  240. message VolumeEcShardReadResponse {
  241. bytes data = 1;
  242. bool is_deleted = 2;
  243. }
  244. message VolumeEcBlobDeleteRequest {
  245. uint32 volume_id = 1;
  246. string collection = 2;
  247. uint64 file_key = 3;
  248. uint32 version = 4;
  249. }
  250. message VolumeEcBlobDeleteResponse {
  251. }
  252. message ReadVolumeFileStatusRequest {
  253. uint32 volume_id = 1;
  254. }
  255. message ReadVolumeFileStatusResponse {
  256. uint32 volume_id = 1;
  257. uint64 idx_file_timestamp_seconds = 2;
  258. uint64 idx_file_size = 3;
  259. uint64 dat_file_timestamp_seconds = 4;
  260. uint64 dat_file_size = 5;
  261. uint64 file_count = 6;
  262. uint32 compaction_revision = 7;
  263. string collection = 8;
  264. }
  265. message DiskStatus {
  266. string dir = 1;
  267. uint64 all = 2;
  268. uint64 used = 3;
  269. uint64 free = 4;
  270. }
  271. message MemStatus {
  272. int32 goroutines = 1;
  273. uint64 all = 2;
  274. uint64 used = 3;
  275. uint64 free = 4;
  276. uint64 self = 5;
  277. uint64 heap = 6;
  278. uint64 stack = 7;
  279. }