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.

482 lines
12 KiB

6 years ago
6 years ago
6 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 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 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. bool is_read_only = 1;
  125. }
  126. message VacuumVolumeCleanupRequest {
  127. uint32 volume_id = 1;
  128. }
  129. message VacuumVolumeCleanupResponse {
  130. }
  131. message DeleteCollectionRequest {
  132. string collection = 1;
  133. }
  134. message DeleteCollectionResponse {
  135. }
  136. message AllocateVolumeRequest {
  137. uint32 volume_id = 1;
  138. string collection = 2;
  139. int64 preallocate = 3;
  140. string replication = 4;
  141. string ttl = 5;
  142. uint32 memory_map_max_size_mb = 6;
  143. }
  144. message AllocateVolumeResponse {
  145. }
  146. message VolumeSyncStatusRequest {
  147. uint32 volume_id = 1;
  148. }
  149. message VolumeSyncStatusResponse {
  150. uint32 volume_id = 1;
  151. string collection = 2;
  152. string replication = 4;
  153. string ttl = 5;
  154. uint64 tail_offset = 6;
  155. uint32 compact_revision = 7;
  156. uint64 idx_file_size = 8;
  157. }
  158. message VolumeIncrementalCopyRequest {
  159. uint32 volume_id = 1;
  160. uint64 since_ns = 2;
  161. }
  162. message VolumeIncrementalCopyResponse {
  163. bytes file_content = 1;
  164. }
  165. message VolumeMountRequest {
  166. uint32 volume_id = 1;
  167. }
  168. message VolumeMountResponse {
  169. }
  170. message VolumeUnmountRequest {
  171. uint32 volume_id = 1;
  172. }
  173. message VolumeUnmountResponse {
  174. }
  175. message VolumeDeleteRequest {
  176. uint32 volume_id = 1;
  177. }
  178. message VolumeDeleteResponse {
  179. }
  180. message VolumeMarkReadonlyRequest {
  181. uint32 volume_id = 1;
  182. }
  183. message VolumeMarkReadonlyResponse {
  184. }
  185. message VolumeConfigureRequest {
  186. uint32 volume_id = 1;
  187. string replication = 2;
  188. }
  189. message VolumeConfigureResponse {
  190. string error = 1;
  191. }
  192. message VolumeCopyRequest {
  193. uint32 volume_id = 1;
  194. string collection = 2;
  195. string replication = 3;
  196. string ttl = 4;
  197. string source_data_node = 5;
  198. }
  199. message VolumeCopyResponse {
  200. uint64 last_append_at_ns = 1;
  201. }
  202. message CopyFileRequest {
  203. uint32 volume_id = 1;
  204. string ext = 2;
  205. uint32 compaction_revision = 3;
  206. uint64 stop_offset = 4;
  207. string collection = 5;
  208. bool is_ec_volume = 6;
  209. bool ignore_source_file_not_found = 7;
  210. }
  211. message CopyFileResponse {
  212. bytes file_content = 1;
  213. }
  214. message VolumeTailSenderRequest {
  215. uint32 volume_id = 1;
  216. uint64 since_ns = 2;
  217. uint32 idle_timeout_seconds = 3;
  218. }
  219. message VolumeTailSenderResponse {
  220. bytes needle_header = 1;
  221. bytes needle_body = 2;
  222. bool is_last_chunk = 3;
  223. }
  224. message VolumeTailReceiverRequest {
  225. uint32 volume_id = 1;
  226. uint64 since_ns = 2;
  227. uint32 idle_timeout_seconds = 3;
  228. string source_volume_server = 4;
  229. }
  230. message VolumeTailReceiverResponse {
  231. }
  232. message VolumeEcShardsGenerateRequest {
  233. uint32 volume_id = 1;
  234. string collection = 2;
  235. }
  236. message VolumeEcShardsGenerateResponse {
  237. }
  238. message VolumeEcShardsRebuildRequest {
  239. uint32 volume_id = 1;
  240. string collection = 2;
  241. }
  242. message VolumeEcShardsRebuildResponse {
  243. repeated uint32 rebuilt_shard_ids = 1;
  244. }
  245. message VolumeEcShardsCopyRequest {
  246. uint32 volume_id = 1;
  247. string collection = 2;
  248. repeated uint32 shard_ids = 3;
  249. bool copy_ecx_file = 4;
  250. string source_data_node = 5;
  251. bool copy_ecj_file = 6;
  252. bool copy_vif_file = 7;
  253. }
  254. message VolumeEcShardsCopyResponse {
  255. }
  256. message VolumeEcShardsDeleteRequest {
  257. uint32 volume_id = 1;
  258. string collection = 2;
  259. repeated uint32 shard_ids = 3;
  260. }
  261. message VolumeEcShardsDeleteResponse {
  262. }
  263. message VolumeEcShardsMountRequest {
  264. uint32 volume_id = 1;
  265. string collection = 2;
  266. repeated uint32 shard_ids = 3;
  267. }
  268. message VolumeEcShardsMountResponse {
  269. }
  270. message VolumeEcShardsUnmountRequest {
  271. uint32 volume_id = 1;
  272. repeated uint32 shard_ids = 3;
  273. }
  274. message VolumeEcShardsUnmountResponse {
  275. }
  276. message VolumeEcShardReadRequest {
  277. uint32 volume_id = 1;
  278. uint32 shard_id = 2;
  279. int64 offset = 3;
  280. int64 size = 4;
  281. uint64 file_key = 5;
  282. }
  283. message VolumeEcShardReadResponse {
  284. bytes data = 1;
  285. bool is_deleted = 2;
  286. }
  287. message VolumeEcBlobDeleteRequest {
  288. uint32 volume_id = 1;
  289. string collection = 2;
  290. uint64 file_key = 3;
  291. uint32 version = 4;
  292. }
  293. message VolumeEcBlobDeleteResponse {
  294. }
  295. message VolumeEcShardsToVolumeRequest {
  296. uint32 volume_id = 1;
  297. string collection = 2;
  298. }
  299. message VolumeEcShardsToVolumeResponse {
  300. }
  301. message ReadVolumeFileStatusRequest {
  302. uint32 volume_id = 1;
  303. }
  304. message ReadVolumeFileStatusResponse {
  305. uint32 volume_id = 1;
  306. uint64 idx_file_timestamp_seconds = 2;
  307. uint64 idx_file_size = 3;
  308. uint64 dat_file_timestamp_seconds = 4;
  309. uint64 dat_file_size = 5;
  310. uint64 file_count = 6;
  311. uint32 compaction_revision = 7;
  312. string collection = 8;
  313. }
  314. message DiskStatus {
  315. string dir = 1;
  316. uint64 all = 2;
  317. uint64 used = 3;
  318. uint64 free = 4;
  319. float percent_free = 5;
  320. float percent_used = 6;
  321. }
  322. message MemStatus {
  323. int32 goroutines = 1;
  324. uint64 all = 2;
  325. uint64 used = 3;
  326. uint64 free = 4;
  327. uint64 self = 5;
  328. uint64 heap = 6;
  329. uint64 stack = 7;
  330. }
  331. // tired storage on volume servers
  332. message RemoteFile {
  333. string backend_type = 1;
  334. string backend_id = 2;
  335. string key = 3;
  336. uint64 offset = 4;
  337. uint64 file_size = 5;
  338. uint64 modified_time = 6;
  339. string extension = 7;
  340. }
  341. message VolumeInfo {
  342. repeated RemoteFile files = 1;
  343. uint32 version = 2;
  344. string replication = 3;
  345. }
  346. message VolumeTierMoveDatToRemoteRequest {
  347. uint32 volume_id = 1;
  348. string collection = 2;
  349. string destination_backend_name = 3;
  350. bool keep_local_dat_file = 4;
  351. }
  352. message VolumeTierMoveDatToRemoteResponse {
  353. int64 processed = 1;
  354. float processedPercentage = 2;
  355. }
  356. message VolumeTierMoveDatFromRemoteRequest {
  357. uint32 volume_id = 1;
  358. string collection = 2;
  359. bool keep_remote_dat_file = 3;
  360. }
  361. message VolumeTierMoveDatFromRemoteResponse {
  362. int64 processed = 1;
  363. float processedPercentage = 2;
  364. }
  365. message VolumeServerStatusRequest {
  366. }
  367. message VolumeServerStatusResponse {
  368. repeated DiskStatus disk_statuses = 1;
  369. MemStatus memory_status = 2;
  370. }
  371. // select on volume servers
  372. message QueryRequest {
  373. repeated string selections = 1;
  374. repeated string from_file_ids = 2;
  375. message Filter {
  376. string field = 1;
  377. string operand = 2;
  378. string value = 3;
  379. }
  380. Filter filter = 3;
  381. message InputSerialization {
  382. // NONE | GZIP | BZIP2
  383. string compression_type = 1;
  384. message CSVInput {
  385. string file_header_info = 1; // Valid values: NONE | USE | IGNORE
  386. string record_delimiter = 2; // Default: \n
  387. string field_delimiter = 3; // Default: ,
  388. string quote_charactoer = 4; // Default: "
  389. string quote_escape_character = 5; // Default: "
  390. string comments = 6; // Default: #
  391. // If true, records might contain record delimiters within quote characters
  392. bool allow_quoted_record_delimiter = 7; // default False.
  393. }
  394. message JSONInput {
  395. string type = 1; // Valid values: DOCUMENT | LINES
  396. }
  397. message ParquetInput {
  398. }
  399. CSVInput csv_input = 2;
  400. JSONInput json_input = 3;
  401. ParquetInput parquet_input = 4;
  402. }
  403. InputSerialization input_serialization = 4;
  404. message OutputSerialization {
  405. message CSVOutput {
  406. string quote_fields = 1; // Valid values: ALWAYS | ASNEEDED
  407. string record_delimiter = 2; // Default: \n
  408. string field_delimiter = 3; // Default: ,
  409. string quote_charactoer = 4; // Default: "
  410. string quote_escape_character = 5; // Default: "
  411. }
  412. message JSONOutput {
  413. string record_delimiter = 1;
  414. }
  415. CSVOutput csv_output = 2;
  416. JSONOutput json_output = 3;
  417. }
  418. OutputSerialization output_serialization = 5;
  419. }
  420. message QueriedStripe {
  421. bytes records = 1;
  422. }