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.

244 lines
5.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. // 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 VolumeEcGenerateSlices (VolumeEcGenerateSlicesRequest) returns (VolumeEcGenerateSlicesResponse) {
  43. }
  44. rpc VolumeEcCopy (VolumeEcCopyRequest) returns (VolumeEcCopyResponse) {
  45. }
  46. }
  47. //////////////////////////////////////////////////
  48. message BatchDeleteRequest {
  49. repeated string file_ids = 1;
  50. }
  51. message BatchDeleteResponse {
  52. repeated DeleteResult results = 1;
  53. }
  54. message DeleteResult {
  55. string file_id = 1;
  56. int32 status = 2;
  57. string error = 3;
  58. uint32 size = 4;
  59. }
  60. message Empty {
  61. }
  62. message VacuumVolumeCheckRequest {
  63. uint32 volume_id = 1;
  64. }
  65. message VacuumVolumeCheckResponse {
  66. double garbage_ratio = 1;
  67. }
  68. message VacuumVolumeCompactRequest {
  69. uint32 volume_id = 1;
  70. int64 preallocate = 2;
  71. }
  72. message VacuumVolumeCompactResponse {
  73. }
  74. message VacuumVolumeCommitRequest {
  75. uint32 volume_id = 1;
  76. }
  77. message VacuumVolumeCommitResponse {
  78. }
  79. message VacuumVolumeCleanupRequest {
  80. uint32 volume_id = 1;
  81. }
  82. message VacuumVolumeCleanupResponse {
  83. }
  84. message DeleteCollectionRequest {
  85. string collection = 1;
  86. }
  87. message DeleteCollectionResponse {
  88. }
  89. message AllocateVolumeRequest {
  90. uint32 volume_id = 1;
  91. string collection = 2;
  92. int64 preallocate = 3;
  93. string replication = 4;
  94. string ttl = 5;
  95. }
  96. message AllocateVolumeResponse {
  97. }
  98. message VolumeSyncStatusRequest {
  99. uint32 volume_id = 1;
  100. }
  101. message VolumeSyncStatusResponse {
  102. uint32 volume_id = 1;
  103. string collection = 2;
  104. string replication = 4;
  105. string ttl = 5;
  106. uint64 tail_offset = 6;
  107. uint32 compact_revision = 7;
  108. uint64 idx_file_size = 8;
  109. }
  110. message VolumeIncrementalCopyRequest {
  111. uint32 volume_id = 1;
  112. uint64 since_ns = 2;
  113. }
  114. message VolumeIncrementalCopyResponse {
  115. bytes file_content = 1;
  116. }
  117. message VolumeMountRequest {
  118. uint32 volume_id = 1;
  119. }
  120. message VolumeMountResponse {
  121. }
  122. message VolumeUnmountRequest {
  123. uint32 volume_id = 1;
  124. }
  125. message VolumeUnmountResponse {
  126. }
  127. message VolumeDeleteRequest {
  128. uint32 volume_id = 1;
  129. }
  130. message VolumeDeleteResponse {
  131. }
  132. message VolumeCopyRequest {
  133. uint32 volume_id = 1;
  134. string collection = 2;
  135. string replication = 3;
  136. string ttl = 4;
  137. string source_data_node = 5;
  138. }
  139. message VolumeCopyResponse {
  140. uint64 last_append_at_ns = 1;
  141. }
  142. message CopyFileRequest {
  143. uint32 volume_id = 1;
  144. string ext = 2;
  145. uint32 compaction_revision = 3;
  146. uint64 stop_offset = 4;
  147. }
  148. message CopyFileResponse {
  149. bytes file_content = 1;
  150. }
  151. message VolumeTailSenderRequest {
  152. uint32 volume_id = 1;
  153. uint64 since_ns = 2;
  154. uint32 idle_timeout_seconds = 3;
  155. }
  156. message VolumeTailSenderResponse {
  157. bytes needle_header = 1;
  158. bytes needle_body = 2;
  159. bool is_last_chunk = 3;
  160. }
  161. message VolumeTailReceiverRequest {
  162. uint32 volume_id = 1;
  163. uint64 since_ns = 2;
  164. uint32 idle_timeout_seconds = 3;
  165. string source_volume_server = 4;
  166. }
  167. message VolumeTailReceiverResponse {
  168. }
  169. message VolumeEcGenerateSlicesRequest {
  170. uint32 volume_id = 1;
  171. }
  172. message VolumeEcGenerateSlicesResponse {
  173. }
  174. message VolumeEcCopyRequest {
  175. uint32 volume_id = 1;
  176. string collection = 2;
  177. repeated uint32 ec_indexes = 3;
  178. string source_data_node = 5;
  179. }
  180. message VolumeEcCopyResponse {
  181. }
  182. message ReadVolumeFileStatusRequest {
  183. uint32 volume_id = 1;
  184. }
  185. message ReadVolumeFileStatusResponse {
  186. uint32 volume_id = 1;
  187. uint64 idx_file_timestamp_seconds = 2;
  188. uint64 idx_file_size = 3;
  189. uint64 dat_file_timestamp_seconds = 4;
  190. uint64 dat_file_size = 5;
  191. uint64 file_count = 6;
  192. uint32 compaction_revision = 7;
  193. string collection = 8;
  194. }
  195. message DiskStatus {
  196. string dir = 1;
  197. uint64 all = 2;
  198. uint64 used = 3;
  199. uint64 free = 4;
  200. }
  201. message MemStatus {
  202. int32 goroutines = 1;
  203. uint64 all = 2;
  204. uint64 used = 3;
  205. uint64 free = 4;
  206. uint64 self = 5;
  207. uint64 heap = 6;
  208. uint64 stack = 7;
  209. }