volume_server.proto 13 KB

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