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.

381 lines
9.5 KiB

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