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.

321 lines
7.7 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. int32 memorymapmaxsizemb = 6;
  111. }
  112. message AllocateVolumeResponse {
  113. }
  114. message VolumeSyncStatusRequest {
  115. uint32 volume_id = 1;
  116. }
  117. message VolumeSyncStatusResponse {
  118. uint32 volume_id = 1;
  119. string collection = 2;
  120. string replication = 4;
  121. string ttl = 5;
  122. uint64 tail_offset = 6;
  123. uint32 compact_revision = 7;
  124. uint64 idx_file_size = 8;
  125. }
  126. message VolumeIncrementalCopyRequest {
  127. uint32 volume_id = 1;
  128. uint64 since_ns = 2;
  129. }
  130. message VolumeIncrementalCopyResponse {
  131. bytes file_content = 1;
  132. }
  133. message VolumeMountRequest {
  134. uint32 volume_id = 1;
  135. }
  136. message VolumeMountResponse {
  137. }
  138. message VolumeUnmountRequest {
  139. uint32 volume_id = 1;
  140. }
  141. message VolumeUnmountResponse {
  142. }
  143. message VolumeDeleteRequest {
  144. uint32 volume_id = 1;
  145. }
  146. message VolumeDeleteResponse {
  147. }
  148. message VolumeMarkReadonlyRequest {
  149. uint32 volume_id = 1;
  150. }
  151. message VolumeMarkReadonlyResponse {
  152. }
  153. message VolumeCopyRequest {
  154. uint32 volume_id = 1;
  155. string collection = 2;
  156. string replication = 3;
  157. string ttl = 4;
  158. string source_data_node = 5;
  159. }
  160. message VolumeCopyResponse {
  161. uint64 last_append_at_ns = 1;
  162. }
  163. message CopyFileRequest {
  164. uint32 volume_id = 1;
  165. string ext = 2;
  166. uint32 compaction_revision = 3;
  167. uint64 stop_offset = 4;
  168. string collection = 5;
  169. bool is_ec_volume = 6;
  170. }
  171. message CopyFileResponse {
  172. bytes file_content = 1;
  173. }
  174. message VolumeTailSenderRequest {
  175. uint32 volume_id = 1;
  176. uint64 since_ns = 2;
  177. uint32 idle_timeout_seconds = 3;
  178. }
  179. message VolumeTailSenderResponse {
  180. bytes needle_header = 1;
  181. bytes needle_body = 2;
  182. bool is_last_chunk = 3;
  183. }
  184. message VolumeTailReceiverRequest {
  185. uint32 volume_id = 1;
  186. uint64 since_ns = 2;
  187. uint32 idle_timeout_seconds = 3;
  188. string source_volume_server = 4;
  189. }
  190. message VolumeTailReceiverResponse {
  191. }
  192. message VolumeEcShardsGenerateRequest {
  193. uint32 volume_id = 1;
  194. string collection = 2;
  195. }
  196. message VolumeEcShardsGenerateResponse {
  197. }
  198. message VolumeEcShardsRebuildRequest {
  199. uint32 volume_id = 1;
  200. string collection = 2;
  201. }
  202. message VolumeEcShardsRebuildResponse {
  203. repeated uint32 rebuilt_shard_ids = 1;
  204. }
  205. message VolumeEcShardsCopyRequest {
  206. uint32 volume_id = 1;
  207. string collection = 2;
  208. repeated uint32 shard_ids = 3;
  209. bool copy_ecx_file = 4;
  210. string source_data_node = 5;
  211. }
  212. message VolumeEcShardsCopyResponse {
  213. }
  214. message VolumeEcShardsDeleteRequest {
  215. uint32 volume_id = 1;
  216. string collection = 2;
  217. repeated uint32 shard_ids = 3;
  218. }
  219. message VolumeEcShardsDeleteResponse {
  220. }
  221. message VolumeEcShardsMountRequest {
  222. uint32 volume_id = 1;
  223. string collection = 2;
  224. repeated uint32 shard_ids = 3;
  225. }
  226. message VolumeEcShardsMountResponse {
  227. }
  228. message VolumeEcShardsUnmountRequest {
  229. uint32 volume_id = 1;
  230. repeated uint32 shard_ids = 3;
  231. }
  232. message VolumeEcShardsUnmountResponse {
  233. }
  234. message VolumeEcShardReadRequest {
  235. uint32 volume_id = 1;
  236. uint32 shard_id = 2;
  237. int64 offset = 3;
  238. int64 size = 4;
  239. uint64 file_key = 5;
  240. }
  241. message VolumeEcShardReadResponse {
  242. bytes data = 1;
  243. bool is_deleted = 2;
  244. }
  245. message VolumeEcBlobDeleteRequest {
  246. uint32 volume_id = 1;
  247. string collection = 2;
  248. uint64 file_key = 3;
  249. uint32 version = 4;
  250. }
  251. message VolumeEcBlobDeleteResponse {
  252. }
  253. message ReadVolumeFileStatusRequest {
  254. uint32 volume_id = 1;
  255. }
  256. message ReadVolumeFileStatusResponse {
  257. uint32 volume_id = 1;
  258. uint64 idx_file_timestamp_seconds = 2;
  259. uint64 idx_file_size = 3;
  260. uint64 dat_file_timestamp_seconds = 4;
  261. uint64 dat_file_size = 5;
  262. uint64 file_count = 6;
  263. uint32 compaction_revision = 7;
  264. string collection = 8;
  265. }
  266. message DiskStatus {
  267. string dir = 1;
  268. uint64 all = 2;
  269. uint64 used = 3;
  270. uint64 free = 4;
  271. }
  272. message MemStatus {
  273. int32 goroutines = 1;
  274. uint64 all = 2;
  275. uint64 used = 3;
  276. uint64 free = 4;
  277. uint64 self = 5;
  278. uint64 heap = 6;
  279. uint64 stack = 7;
  280. }