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.

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