volume_server.proto 11 KB

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