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.

191 lines
4.2 KiB

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