volume_server.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. syntax = "proto3";
  2. package volume_server_pb;
  3. option go_package = "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb";
  4. //////////////////////////////////////////////////
  5. service VolumeServer {
  6. //Experts only: takes multiple fid parameters. This function does not propagate deletes to replicas.
  7. rpc BatchDelete (BatchDeleteRequest) returns (BatchDeleteResponse) {
  8. }
  9. rpc VacuumVolumeCheck (VacuumVolumeCheckRequest) returns (VacuumVolumeCheckResponse) {
  10. }
  11. rpc VacuumVolumeCompact (VacuumVolumeCompactRequest) returns (VacuumVolumeCompactResponse) {
  12. }
  13. rpc VacuumVolumeCommit (VacuumVolumeCommitRequest) returns (VacuumVolumeCommitResponse) {
  14. }
  15. rpc VacuumVolumeCleanup (VacuumVolumeCleanupRequest) returns (VacuumVolumeCleanupResponse) {
  16. }
  17. rpc DeleteCollection (DeleteCollectionRequest) returns (DeleteCollectionResponse) {
  18. }
  19. rpc AllocateVolume (AllocateVolumeRequest) returns (AllocateVolumeResponse) {
  20. }
  21. rpc VolumeSyncStatus (VolumeSyncStatusRequest) returns (VolumeSyncStatusResponse) {
  22. }
  23. rpc VolumeIncrementalCopy (VolumeIncrementalCopyRequest) returns (stream VolumeIncrementalCopyResponse) {
  24. }
  25. rpc VolumeMount (VolumeMountRequest) returns (VolumeMountResponse) {
  26. }
  27. rpc VolumeUnmount (VolumeUnmountRequest) returns (VolumeUnmountResponse) {
  28. }
  29. rpc VolumeDelete (VolumeDeleteRequest) returns (VolumeDeleteResponse) {
  30. }
  31. rpc VolumeMarkReadonly (VolumeMarkReadonlyRequest) returns (VolumeMarkReadonlyResponse) {
  32. }
  33. rpc VolumeConfigure (VolumeConfigureRequest) returns (VolumeConfigureResponse) {
  34. }
  35. // copy the .idx .dat files, and mount this volume
  36. rpc VolumeCopy (VolumeCopyRequest) returns (VolumeCopyResponse) {
  37. }
  38. rpc ReadVolumeFileStatus (ReadVolumeFileStatusRequest) returns (ReadVolumeFileStatusResponse) {
  39. }
  40. rpc CopyFile (CopyFileRequest) returns (stream CopyFileResponse) {
  41. }
  42. rpc VolumeTailSender (VolumeTailSenderRequest) returns (stream VolumeTailSenderResponse) {
  43. }
  44. rpc VolumeTailReceiver (VolumeTailReceiverRequest) returns (VolumeTailReceiverResponse) {
  45. }
  46. // erasure coding
  47. rpc VolumeEcShardsGenerate (VolumeEcShardsGenerateRequest) returns (VolumeEcShardsGenerateResponse) {
  48. }
  49. rpc VolumeEcShardsRebuild (VolumeEcShardsRebuildRequest) returns (VolumeEcShardsRebuildResponse) {
  50. }
  51. rpc VolumeEcShardsCopy (VolumeEcShardsCopyRequest) returns (VolumeEcShardsCopyResponse) {
  52. }
  53. rpc VolumeEcShardsDelete (VolumeEcShardsDeleteRequest) returns (VolumeEcShardsDeleteResponse) {
  54. }
  55. rpc VolumeEcShardsMount (VolumeEcShardsMountRequest) returns (VolumeEcShardsMountResponse) {
  56. }
  57. rpc VolumeEcShardsUnmount (VolumeEcShardsUnmountRequest) returns (VolumeEcShardsUnmountResponse) {
  58. }
  59. rpc VolumeEcShardRead (VolumeEcShardReadRequest) returns (stream VolumeEcShardReadResponse) {
  60. }
  61. rpc VolumeEcBlobDelete (VolumeEcBlobDeleteRequest) returns (VolumeEcBlobDeleteResponse) {
  62. }
  63. rpc VolumeEcShardsToVolume (VolumeEcShardsToVolumeRequest) returns (VolumeEcShardsToVolumeResponse) {
  64. }
  65. // tiered storage
  66. rpc VolumeTierMoveDatToRemote (VolumeTierMoveDatToRemoteRequest) returns (stream VolumeTierMoveDatToRemoteResponse) {
  67. }
  68. rpc VolumeTierMoveDatFromRemote (VolumeTierMoveDatFromRemoteRequest) returns (stream VolumeTierMoveDatFromRemoteResponse) {
  69. }
  70. rpc VolumeServerStatus (VolumeServerStatusRequest) returns (VolumeServerStatusResponse) {
  71. }
  72. // <experimental> query
  73. rpc Query (QueryRequest) returns (stream QueriedStripe) {
  74. }
  75. rpc VolumeNeedleStatus (VolumeNeedleStatusRequest) returns (VolumeNeedleStatusResponse) {
  76. }
  77. }
  78. //////////////////////////////////////////////////
  79. message BatchDeleteRequest {
  80. repeated string file_ids = 1;
  81. bool skip_cookie_check = 2;
  82. }
  83. message BatchDeleteResponse {
  84. repeated DeleteResult results = 1;
  85. }
  86. message DeleteResult {
  87. string file_id = 1;
  88. int32 status = 2;
  89. string error = 3;
  90. uint32 size = 4;
  91. uint32 version = 5;
  92. }
  93. message Empty {
  94. }
  95. message VacuumVolumeCheckRequest {
  96. uint32 volume_id = 1;
  97. }
  98. message VacuumVolumeCheckResponse {
  99. double garbage_ratio = 1;
  100. }
  101. message VacuumVolumeCompactRequest {
  102. uint32 volume_id = 1;
  103. int64 preallocate = 2;
  104. }
  105. message VacuumVolumeCompactResponse {
  106. }
  107. message VacuumVolumeCommitRequest {
  108. uint32 volume_id = 1;
  109. }
  110. message VacuumVolumeCommitResponse {
  111. bool is_read_only = 1;
  112. }
  113. message VacuumVolumeCleanupRequest {
  114. uint32 volume_id = 1;
  115. }
  116. message VacuumVolumeCleanupResponse {
  117. }
  118. message DeleteCollectionRequest {
  119. string collection = 1;
  120. }
  121. message DeleteCollectionResponse {
  122. }
  123. message AllocateVolumeRequest {
  124. uint32 volume_id = 1;
  125. string collection = 2;
  126. int64 preallocate = 3;
  127. string replication = 4;
  128. string ttl = 5;
  129. uint32 memory_map_max_size_mb = 6;
  130. }
  131. message AllocateVolumeResponse {
  132. }
  133. message VolumeSyncStatusRequest {
  134. uint32 volume_id = 1;
  135. }
  136. message VolumeSyncStatusResponse {
  137. uint32 volume_id = 1;
  138. string collection = 2;
  139. string replication = 4;
  140. string ttl = 5;
  141. uint64 tail_offset = 6;
  142. uint32 compact_revision = 7;
  143. uint64 idx_file_size = 8;
  144. }
  145. message VolumeIncrementalCopyRequest {
  146. uint32 volume_id = 1;
  147. uint64 since_ns = 2;
  148. }
  149. message VolumeIncrementalCopyResponse {
  150. bytes file_content = 1;
  151. }
  152. message VolumeMountRequest {
  153. uint32 volume_id = 1;
  154. }
  155. message VolumeMountResponse {
  156. }
  157. message VolumeUnmountRequest {
  158. uint32 volume_id = 1;
  159. }
  160. message VolumeUnmountResponse {
  161. }
  162. message VolumeDeleteRequest {
  163. uint32 volume_id = 1;
  164. }
  165. message VolumeDeleteResponse {
  166. }
  167. message VolumeMarkReadonlyRequest {
  168. uint32 volume_id = 1;
  169. }
  170. message VolumeMarkReadonlyResponse {
  171. }
  172. message VolumeConfigureRequest {
  173. uint32 volume_id = 1;
  174. string replication = 2;
  175. }
  176. message VolumeConfigureResponse {
  177. string error = 1;
  178. }
  179. message VolumeCopyRequest {
  180. uint32 volume_id = 1;
  181. string collection = 2;
  182. string replication = 3;
  183. string ttl = 4;
  184. string source_data_node = 5;
  185. }
  186. message VolumeCopyResponse {
  187. uint64 last_append_at_ns = 1;
  188. }
  189. message CopyFileRequest {
  190. uint32 volume_id = 1;
  191. string ext = 2;
  192. uint32 compaction_revision = 3;
  193. uint64 stop_offset = 4;
  194. string collection = 5;
  195. bool is_ec_volume = 6;
  196. bool ignore_source_file_not_found = 7;
  197. }
  198. message CopyFileResponse {
  199. bytes file_content = 1;
  200. }
  201. message VolumeTailSenderRequest {
  202. uint32 volume_id = 1;
  203. uint64 since_ns = 2;
  204. uint32 idle_timeout_seconds = 3;
  205. }
  206. message VolumeTailSenderResponse {
  207. bytes needle_header = 1;
  208. bytes needle_body = 2;
  209. bool is_last_chunk = 3;
  210. }
  211. message VolumeTailReceiverRequest {
  212. uint32 volume_id = 1;
  213. uint64 since_ns = 2;
  214. uint32 idle_timeout_seconds = 3;
  215. string source_volume_server = 4;
  216. }
  217. message VolumeTailReceiverResponse {
  218. }
  219. message VolumeEcShardsGenerateRequest {
  220. uint32 volume_id = 1;
  221. string collection = 2;
  222. }
  223. message VolumeEcShardsGenerateResponse {
  224. }
  225. message VolumeEcShardsRebuildRequest {
  226. uint32 volume_id = 1;
  227. string collection = 2;
  228. }
  229. message VolumeEcShardsRebuildResponse {
  230. repeated uint32 rebuilt_shard_ids = 1;
  231. }
  232. message VolumeEcShardsCopyRequest {
  233. uint32 volume_id = 1;
  234. string collection = 2;
  235. repeated uint32 shard_ids = 3;
  236. bool copy_ecx_file = 4;
  237. string source_data_node = 5;
  238. bool copy_ecj_file = 6;
  239. bool copy_vif_file = 7;
  240. }
  241. message VolumeEcShardsCopyResponse {
  242. }
  243. message VolumeEcShardsDeleteRequest {
  244. uint32 volume_id = 1;
  245. string collection = 2;
  246. repeated uint32 shard_ids = 3;
  247. }
  248. message VolumeEcShardsDeleteResponse {
  249. }
  250. message VolumeEcShardsMountRequest {
  251. uint32 volume_id = 1;
  252. string collection = 2;
  253. repeated uint32 shard_ids = 3;
  254. }
  255. message VolumeEcShardsMountResponse {
  256. }
  257. message VolumeEcShardsUnmountRequest {
  258. uint32 volume_id = 1;
  259. repeated uint32 shard_ids = 3;
  260. }
  261. message VolumeEcShardsUnmountResponse {
  262. }
  263. message VolumeEcShardReadRequest {
  264. uint32 volume_id = 1;
  265. uint32 shard_id = 2;
  266. int64 offset = 3;
  267. int64 size = 4;
  268. uint64 file_key = 5;
  269. }
  270. message VolumeEcShardReadResponse {
  271. bytes data = 1;
  272. bool is_deleted = 2;
  273. }
  274. message VolumeEcBlobDeleteRequest {
  275. uint32 volume_id = 1;
  276. string collection = 2;
  277. uint64 file_key = 3;
  278. uint32 version = 4;
  279. }
  280. message VolumeEcBlobDeleteResponse {
  281. }
  282. message VolumeEcShardsToVolumeRequest {
  283. uint32 volume_id = 1;
  284. string collection = 2;
  285. }
  286. message VolumeEcShardsToVolumeResponse {
  287. }
  288. message ReadVolumeFileStatusRequest {
  289. uint32 volume_id = 1;
  290. }
  291. message ReadVolumeFileStatusResponse {
  292. uint32 volume_id = 1;
  293. uint64 idx_file_timestamp_seconds = 2;
  294. uint64 idx_file_size = 3;
  295. uint64 dat_file_timestamp_seconds = 4;
  296. uint64 dat_file_size = 5;
  297. uint64 file_count = 6;
  298. uint32 compaction_revision = 7;
  299. string collection = 8;
  300. }
  301. message DiskStatus {
  302. string dir = 1;
  303. uint64 all = 2;
  304. uint64 used = 3;
  305. uint64 free = 4;
  306. float percent_free = 5;
  307. float percent_used = 6;
  308. }
  309. message MemStatus {
  310. int32 goroutines = 1;
  311. uint64 all = 2;
  312. uint64 used = 3;
  313. uint64 free = 4;
  314. uint64 self = 5;
  315. uint64 heap = 6;
  316. uint64 stack = 7;
  317. }
  318. // tired storage on volume servers
  319. message RemoteFile {
  320. string backend_type = 1;
  321. string backend_id = 2;
  322. string key = 3;
  323. uint64 offset = 4;
  324. uint64 file_size = 5;
  325. uint64 modified_time = 6;
  326. string extension = 7;
  327. }
  328. message VolumeInfo {
  329. repeated RemoteFile files = 1;
  330. uint32 version = 2;
  331. string replication = 3;
  332. }
  333. message VolumeTierMoveDatToRemoteRequest {
  334. uint32 volume_id = 1;
  335. string collection = 2;
  336. string destination_backend_name = 3;
  337. bool keep_local_dat_file = 4;
  338. }
  339. message VolumeTierMoveDatToRemoteResponse {
  340. int64 processed = 1;
  341. float processedPercentage = 2;
  342. }
  343. message VolumeTierMoveDatFromRemoteRequest {
  344. uint32 volume_id = 1;
  345. string collection = 2;
  346. bool keep_remote_dat_file = 3;
  347. }
  348. message VolumeTierMoveDatFromRemoteResponse {
  349. int64 processed = 1;
  350. float processedPercentage = 2;
  351. }
  352. message VolumeServerStatusRequest {
  353. }
  354. message VolumeServerStatusResponse {
  355. repeated DiskStatus disk_statuses = 1;
  356. MemStatus memory_status = 2;
  357. }
  358. // select on volume servers
  359. message QueryRequest {
  360. repeated string selections = 1;
  361. repeated string from_file_ids = 2;
  362. message Filter {
  363. string field = 1;
  364. string operand = 2;
  365. string value = 3;
  366. }
  367. Filter filter = 3;
  368. message InputSerialization {
  369. // NONE | GZIP | BZIP2
  370. string compression_type = 1;
  371. message CSVInput {
  372. string file_header_info = 1; // Valid values: NONE | USE | IGNORE
  373. string record_delimiter = 2; // Default: \n
  374. string field_delimiter = 3; // Default: ,
  375. string quote_charactoer = 4; // Default: "
  376. string quote_escape_character = 5; // Default: "
  377. string comments = 6; // Default: #
  378. // If true, records might contain record delimiters within quote characters
  379. bool allow_quoted_record_delimiter = 7; // default False.
  380. }
  381. message JSONInput {
  382. string type = 1; // Valid values: DOCUMENT | LINES
  383. }
  384. message ParquetInput {
  385. }
  386. CSVInput csv_input = 2;
  387. JSONInput json_input = 3;
  388. ParquetInput parquet_input = 4;
  389. }
  390. InputSerialization input_serialization = 4;
  391. message OutputSerialization {
  392. message CSVOutput {
  393. string quote_fields = 1; // Valid values: ALWAYS | ASNEEDED
  394. string record_delimiter = 2; // Default: \n
  395. string field_delimiter = 3; // Default: ,
  396. string quote_charactoer = 4; // Default: "
  397. string quote_escape_character = 5; // Default: "
  398. }
  399. message JSONOutput {
  400. string record_delimiter = 1;
  401. }
  402. CSVOutput csv_output = 2;
  403. JSONOutput json_output = 3;
  404. }
  405. OutputSerialization output_serialization = 5;
  406. }
  407. message QueriedStripe {
  408. bytes records = 1;
  409. }
  410. message VolumeNeedleStatusRequest {
  411. uint32 volume_id = 1;
  412. uint64 needle_id = 2;
  413. }
  414. message VolumeNeedleStatusResponse {
  415. uint64 needle_id = 1;
  416. uint32 cookie = 2;
  417. uint32 size = 3;
  418. uint64 last_modified = 4;
  419. uint32 crc = 5;
  420. string ttl = 6;
  421. }