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.

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