volume_server.proto 12 KB

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