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.

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