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.

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