volume_server.proto 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. rpc VolumeMarkReadonly (VolumeMarkReadonlyRequest) returns (VolumeMarkReadonlyResponse) {
  31. }
  32. // copy the .idx .dat files, and mount this volume
  33. rpc VolumeCopy (VolumeCopyRequest) returns (VolumeCopyResponse) {
  34. }
  35. rpc ReadVolumeFileStatus (ReadVolumeFileStatusRequest) returns (ReadVolumeFileStatusResponse) {
  36. }
  37. rpc CopyFile (CopyFileRequest) returns (stream CopyFileResponse) {
  38. }
  39. rpc VolumeTailSender (VolumeTailSenderRequest) returns (stream VolumeTailSenderResponse) {
  40. }
  41. rpc VolumeTailReceiver (VolumeTailReceiverRequest) returns (VolumeTailReceiverResponse) {
  42. }
  43. // erasure coding
  44. rpc VolumeEcShardsGenerate (VolumeEcShardsGenerateRequest) returns (VolumeEcShardsGenerateResponse) {
  45. }
  46. rpc VolumeEcShardsRebuild (VolumeEcShardsRebuildRequest) returns (VolumeEcShardsRebuildResponse) {
  47. }
  48. rpc VolumeEcShardsCopy (VolumeEcShardsCopyRequest) returns (VolumeEcShardsCopyResponse) {
  49. }
  50. rpc VolumeEcShardsDelete (VolumeEcShardsDeleteRequest) returns (VolumeEcShardsDeleteResponse) {
  51. }
  52. rpc VolumeEcShardsMount (VolumeEcShardsMountRequest) returns (VolumeEcShardsMountResponse) {
  53. }
  54. rpc VolumeEcShardsUnmount (VolumeEcShardsUnmountRequest) returns (VolumeEcShardsUnmountResponse) {
  55. }
  56. rpc VolumeEcShardRead (VolumeEcShardReadRequest) returns (stream VolumeEcShardReadResponse) {
  57. }
  58. rpc VolumeEcBlobDelete (VolumeEcBlobDeleteRequest) returns (VolumeEcBlobDeleteResponse) {
  59. }
  60. // query
  61. rpc Query (QueryRequest) returns (stream QueriedStripe) {
  62. }
  63. }
  64. //////////////////////////////////////////////////
  65. message BatchDeleteRequest {
  66. repeated string file_ids = 1;
  67. }
  68. message BatchDeleteResponse {
  69. repeated DeleteResult results = 1;
  70. }
  71. message DeleteResult {
  72. string file_id = 1;
  73. int32 status = 2;
  74. string error = 3;
  75. uint32 size = 4;
  76. uint32 version = 5;
  77. }
  78. message Empty {
  79. }
  80. message VacuumVolumeCheckRequest {
  81. uint32 volume_id = 1;
  82. }
  83. message VacuumVolumeCheckResponse {
  84. double garbage_ratio = 1;
  85. }
  86. message VacuumVolumeCompactRequest {
  87. uint32 volume_id = 1;
  88. int64 preallocate = 2;
  89. }
  90. message VacuumVolumeCompactResponse {
  91. }
  92. message VacuumVolumeCommitRequest {
  93. uint32 volume_id = 1;
  94. }
  95. message VacuumVolumeCommitResponse {
  96. }
  97. message VacuumVolumeCleanupRequest {
  98. uint32 volume_id = 1;
  99. }
  100. message VacuumVolumeCleanupResponse {
  101. }
  102. message DeleteCollectionRequest {
  103. string collection = 1;
  104. }
  105. message DeleteCollectionResponse {
  106. }
  107. message AllocateVolumeRequest {
  108. uint32 volume_id = 1;
  109. string collection = 2;
  110. int64 preallocate = 3;
  111. string replication = 4;
  112. string ttl = 5;
  113. uint32 memory_map_max_size_mb = 6;
  114. }
  115. message AllocateVolumeResponse {
  116. }
  117. message VolumeSyncStatusRequest {
  118. uint32 volume_id = 1;
  119. }
  120. message VolumeSyncStatusResponse {
  121. uint32 volume_id = 1;
  122. string collection = 2;
  123. string replication = 4;
  124. string ttl = 5;
  125. uint64 tail_offset = 6;
  126. uint32 compact_revision = 7;
  127. uint64 idx_file_size = 8;
  128. }
  129. message VolumeIncrementalCopyRequest {
  130. uint32 volume_id = 1;
  131. uint64 since_ns = 2;
  132. }
  133. message VolumeIncrementalCopyResponse {
  134. bytes file_content = 1;
  135. }
  136. message VolumeMountRequest {
  137. uint32 volume_id = 1;
  138. }
  139. message VolumeMountResponse {
  140. }
  141. message VolumeUnmountRequest {
  142. uint32 volume_id = 1;
  143. }
  144. message VolumeUnmountResponse {
  145. }
  146. message VolumeDeleteRequest {
  147. uint32 volume_id = 1;
  148. }
  149. message VolumeDeleteResponse {
  150. }
  151. message VolumeMarkReadonlyRequest {
  152. uint32 volume_id = 1;
  153. }
  154. message VolumeMarkReadonlyResponse {
  155. }
  156. message VolumeCopyRequest {
  157. uint32 volume_id = 1;
  158. string collection = 2;
  159. string replication = 3;
  160. string ttl = 4;
  161. string source_data_node = 5;
  162. }
  163. message VolumeCopyResponse {
  164. uint64 last_append_at_ns = 1;
  165. }
  166. message CopyFileRequest {
  167. uint32 volume_id = 1;
  168. string ext = 2;
  169. uint32 compaction_revision = 3;
  170. uint64 stop_offset = 4;
  171. string collection = 5;
  172. bool is_ec_volume = 6;
  173. }
  174. message CopyFileResponse {
  175. bytes file_content = 1;
  176. }
  177. message VolumeTailSenderRequest {
  178. uint32 volume_id = 1;
  179. uint64 since_ns = 2;
  180. uint32 idle_timeout_seconds = 3;
  181. }
  182. message VolumeTailSenderResponse {
  183. bytes needle_header = 1;
  184. bytes needle_body = 2;
  185. bool is_last_chunk = 3;
  186. }
  187. message VolumeTailReceiverRequest {
  188. uint32 volume_id = 1;
  189. uint64 since_ns = 2;
  190. uint32 idle_timeout_seconds = 3;
  191. string source_volume_server = 4;
  192. }
  193. message VolumeTailReceiverResponse {
  194. }
  195. message VolumeEcShardsGenerateRequest {
  196. uint32 volume_id = 1;
  197. string collection = 2;
  198. }
  199. message VolumeEcShardsGenerateResponse {
  200. }
  201. message VolumeEcShardsRebuildRequest {
  202. uint32 volume_id = 1;
  203. string collection = 2;
  204. }
  205. message VolumeEcShardsRebuildResponse {
  206. repeated uint32 rebuilt_shard_ids = 1;
  207. }
  208. message VolumeEcShardsCopyRequest {
  209. uint32 volume_id = 1;
  210. string collection = 2;
  211. repeated uint32 shard_ids = 3;
  212. bool copy_ecx_file = 4;
  213. string source_data_node = 5;
  214. }
  215. message VolumeEcShardsCopyResponse {
  216. }
  217. message VolumeEcShardsDeleteRequest {
  218. uint32 volume_id = 1;
  219. string collection = 2;
  220. repeated uint32 shard_ids = 3;
  221. }
  222. message VolumeEcShardsDeleteResponse {
  223. }
  224. message VolumeEcShardsMountRequest {
  225. uint32 volume_id = 1;
  226. string collection = 2;
  227. repeated uint32 shard_ids = 3;
  228. }
  229. message VolumeEcShardsMountResponse {
  230. }
  231. message VolumeEcShardsUnmountRequest {
  232. uint32 volume_id = 1;
  233. repeated uint32 shard_ids = 3;
  234. }
  235. message VolumeEcShardsUnmountResponse {
  236. }
  237. message VolumeEcShardReadRequest {
  238. uint32 volume_id = 1;
  239. uint32 shard_id = 2;
  240. int64 offset = 3;
  241. int64 size = 4;
  242. uint64 file_key = 5;
  243. }
  244. message VolumeEcShardReadResponse {
  245. bytes data = 1;
  246. bool is_deleted = 2;
  247. }
  248. message VolumeEcBlobDeleteRequest {
  249. uint32 volume_id = 1;
  250. string collection = 2;
  251. uint64 file_key = 3;
  252. uint32 version = 4;
  253. }
  254. message VolumeEcBlobDeleteResponse {
  255. }
  256. message ReadVolumeFileStatusRequest {
  257. uint32 volume_id = 1;
  258. }
  259. message ReadVolumeFileStatusResponse {
  260. uint32 volume_id = 1;
  261. uint64 idx_file_timestamp_seconds = 2;
  262. uint64 idx_file_size = 3;
  263. uint64 dat_file_timestamp_seconds = 4;
  264. uint64 dat_file_size = 5;
  265. uint64 file_count = 6;
  266. uint32 compaction_revision = 7;
  267. string collection = 8;
  268. }
  269. message DiskStatus {
  270. string dir = 1;
  271. uint64 all = 2;
  272. uint64 used = 3;
  273. uint64 free = 4;
  274. }
  275. message MemStatus {
  276. int32 goroutines = 1;
  277. uint64 all = 2;
  278. uint64 used = 3;
  279. uint64 free = 4;
  280. uint64 self = 5;
  281. uint64 heap = 6;
  282. uint64 stack = 7;
  283. }
  284. message QueryRequest {
  285. repeated string selections = 1;
  286. repeated string from_file_ids = 2;
  287. message Filter {
  288. string field = 1;
  289. string operand = 2;
  290. string value = 3;
  291. }
  292. Filter filter = 3;
  293. message InputSerialization {
  294. // NONE | GZIP | BZIP2
  295. string compression_type = 1;
  296. message CSVInput {
  297. string file_header_info = 1; // Valid values: NONE | USE | IGNORE
  298. string record_delimiter = 2; // Default: \n
  299. string field_delimiter = 3; // Default: ,
  300. string quote_charactoer = 4; // Default: "
  301. string quote_escape_character = 5; // Default: "
  302. string comments = 6; // Default: #
  303. // If true, records might contain record delimiters within quote characters
  304. bool allow_quoted_record_delimiter = 7; // default False.
  305. }
  306. message JSONInput {
  307. string type = 1; // Valid values: DOCUMENT | LINES
  308. }
  309. message ParquetInput {
  310. }
  311. CSVInput csv_input = 2;
  312. JSONInput json_input = 3;
  313. ParquetInput parquet_input = 4;
  314. }
  315. InputSerialization input_serialization = 4;
  316. message OutputSerialization {
  317. message CSVOutput {
  318. string quote_fields = 1; // Valid values: ALWAYS | ASNEEDED
  319. string record_delimiter = 2; // Default: \n
  320. string field_delimiter = 3; // Default: ,
  321. string quote_charactoer = 4; // Default: "
  322. string quote_escape_character = 5; // Default: "
  323. }
  324. message JSONOutput {
  325. string record_delimiter = 1;
  326. }
  327. CSVOutput csv_output = 2;
  328. JSONOutput json_output = 3;
  329. }
  330. OutputSerialization output_serialization = 5;
  331. }
  332. message QueriedStripe {
  333. bytes records = 1;
  334. }