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.

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