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.

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