volume_server.proto 14 KB

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