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.

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