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.

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