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.

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