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.

203 lines
4.5 KiB

  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 AssignVolume (AssignVolumeRequest) returns (AssignVolumeResponse) {
  19. }
  20. rpc VolumeSyncStatus (VolumeSyncStatusRequest) returns (VolumeSyncStatusResponse) {
  21. }
  22. rpc VolumeSyncIndex (VolumeSyncIndexRequest) returns (stream VolumeSyncIndexResponse) {
  23. }
  24. rpc VolumeSyncData (VolumeSyncDataRequest) returns (stream VolumeSyncDataResponse) {
  25. }
  26. rpc VolumeMount (VolumeMountRequest) returns (VolumeMountResponse) {
  27. }
  28. rpc VolumeUnmount (VolumeUnmountRequest) returns (VolumeUnmountResponse) {
  29. }
  30. rpc VolumeDelete (VolumeDeleteRequest) returns (VolumeDeleteResponse) {
  31. }
  32. rpc ReplicateVolume (ReplicateVolumeRequest) returns (ReplicateVolumeResponse) {
  33. }
  34. rpc ReadVolumeFileStatus (ReadVolumeFileStatusRequest) returns (ReadVolumeFileStatusResponse) {
  35. }
  36. rpc CopyFile (CopyFileRequest) returns (stream CopyFileResponse) {
  37. }
  38. }
  39. //////////////////////////////////////////////////
  40. message BatchDeleteRequest {
  41. repeated string file_ids = 1;
  42. }
  43. message BatchDeleteResponse {
  44. repeated DeleteResult results = 1;
  45. }
  46. message DeleteResult {
  47. string file_id = 1;
  48. int32 status = 2;
  49. string error = 3;
  50. uint32 size = 4;
  51. }
  52. message Empty {
  53. }
  54. message VacuumVolumeCheckRequest {
  55. uint32 volume_id = 1;
  56. }
  57. message VacuumVolumeCheckResponse {
  58. double garbage_ratio = 1;
  59. }
  60. message VacuumVolumeCompactRequest {
  61. uint32 volume_id = 1;
  62. int64 preallocate = 2;
  63. }
  64. message VacuumVolumeCompactResponse {
  65. }
  66. message VacuumVolumeCommitRequest {
  67. uint32 volume_id = 1;
  68. }
  69. message VacuumVolumeCommitResponse {
  70. }
  71. message VacuumVolumeCleanupRequest {
  72. uint32 volume_id = 1;
  73. }
  74. message VacuumVolumeCleanupResponse {
  75. }
  76. message DeleteCollectionRequest {
  77. string collection = 1;
  78. }
  79. message DeleteCollectionResponse {
  80. }
  81. message AssignVolumeRequest {
  82. uint32 volume_id = 1;
  83. string collection = 2;
  84. int64 preallocate = 3;
  85. string replication = 4;
  86. string ttl = 5;
  87. }
  88. message AssignVolumeResponse {
  89. }
  90. message VolumeSyncStatusRequest {
  91. uint32 volume_id = 1;
  92. }
  93. message VolumeSyncStatusResponse {
  94. uint32 volume_id = 1;
  95. string collection = 2;
  96. string replication = 4;
  97. string ttl = 5;
  98. uint64 tail_offset = 6;
  99. uint32 compact_revision = 7;
  100. uint64 idx_file_size = 8;
  101. }
  102. message VolumeSyncIndexRequest {
  103. uint32 volume_id = 1;
  104. }
  105. message VolumeSyncIndexResponse {
  106. bytes index_file_content = 1;
  107. }
  108. message VolumeSyncDataRequest {
  109. uint32 volume_id = 1;
  110. uint32 revision = 2;
  111. uint32 offset = 3;
  112. uint32 size = 4;
  113. string needle_id = 5;
  114. }
  115. message VolumeSyncDataResponse {
  116. bytes file_content = 1;
  117. }
  118. message VolumeMountRequest {
  119. uint32 volume_id = 1;
  120. }
  121. message VolumeMountResponse {
  122. }
  123. message VolumeUnmountRequest {
  124. uint32 volume_id = 1;
  125. }
  126. message VolumeUnmountResponse {
  127. }
  128. message VolumeDeleteRequest {
  129. uint32 volume_id = 1;
  130. }
  131. message VolumeDeleteResponse {
  132. }
  133. message ReplicateVolumeRequest {
  134. uint32 volume_id = 1;
  135. string collection = 2;
  136. string replication = 3;
  137. string ttl = 4;
  138. string source_data_node = 5;
  139. }
  140. message ReplicateVolumeResponse {
  141. }
  142. message CopyFileRequest {
  143. uint32 volume_id = 1;
  144. bool is_idx_file = 2;
  145. bool is_dat_file = 3;
  146. }
  147. message CopyFileResponse {
  148. bytes file_content = 1;
  149. }
  150. message ReadVolumeFileStatusRequest {
  151. uint32 volume_id = 1;
  152. }
  153. message ReadVolumeFileStatusResponse {
  154. uint32 volume_id = 1;
  155. uint64 idx_file_timestamp = 2;
  156. uint64 idx_file_size = 3;
  157. uint64 dat_file_timestamp = 4;
  158. uint64 dat_file_size = 5;
  159. }
  160. message DiskStatus {
  161. string dir = 1;
  162. uint64 all = 2;
  163. uint64 used = 3;
  164. uint64 free = 4;
  165. }
  166. message MemStatus {
  167. int32 goroutines = 1;
  168. uint64 all = 2;
  169. uint64 used = 3;
  170. uint64 free = 4;
  171. uint64 self = 5;
  172. uint64 heap = 6;
  173. uint64 stack = 7;
  174. }