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.

573 lines
14 KiB

5 years ago
6 years ago
6 years ago
6 years ago
5 years ago
5 years ago
3 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
3 years ago
5 years ago
5 years ago
5 years ago
3 years ago
3 years ago
3 years ago
5 years ago
  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 (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 (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. }
  123. message VacuumVolumeCommitRequest {
  124. uint32 volume_id = 1;
  125. }
  126. message VacuumVolumeCommitResponse {
  127. bool is_read_only = 1;
  128. }
  129. message VacuumVolumeCleanupRequest {
  130. uint32 volume_id = 1;
  131. }
  132. message VacuumVolumeCleanupResponse {
  133. }
  134. message DeleteCollectionRequest {
  135. string collection = 1;
  136. }
  137. message DeleteCollectionResponse {
  138. }
  139. message AllocateVolumeRequest {
  140. uint32 volume_id = 1;
  141. string collection = 2;
  142. int64 preallocate = 3;
  143. string replication = 4;
  144. string ttl = 5;
  145. uint32 memory_map_max_size_mb = 6;
  146. string disk_type = 7;
  147. }
  148. message AllocateVolumeResponse {
  149. }
  150. message VolumeSyncStatusRequest {
  151. uint32 volume_id = 1;
  152. }
  153. message VolumeSyncStatusResponse {
  154. uint32 volume_id = 1;
  155. string collection = 2;
  156. string replication = 4;
  157. string ttl = 5;
  158. uint64 tail_offset = 6;
  159. uint32 compact_revision = 7;
  160. uint64 idx_file_size = 8;
  161. }
  162. message VolumeIncrementalCopyRequest {
  163. uint32 volume_id = 1;
  164. uint64 since_ns = 2;
  165. }
  166. message VolumeIncrementalCopyResponse {
  167. bytes file_content = 1;
  168. }
  169. message VolumeMountRequest {
  170. uint32 volume_id = 1;
  171. }
  172. message VolumeMountResponse {
  173. }
  174. message VolumeUnmountRequest {
  175. uint32 volume_id = 1;
  176. }
  177. message VolumeUnmountResponse {
  178. }
  179. message VolumeDeleteRequest {
  180. uint32 volume_id = 1;
  181. }
  182. message VolumeDeleteResponse {
  183. }
  184. message VolumeMarkReadonlyRequest {
  185. uint32 volume_id = 1;
  186. }
  187. message VolumeMarkReadonlyResponse {
  188. }
  189. message VolumeMarkWritableRequest {
  190. uint32 volume_id = 1;
  191. }
  192. message VolumeMarkWritableResponse {
  193. }
  194. message VolumeConfigureRequest {
  195. uint32 volume_id = 1;
  196. string replication = 2;
  197. }
  198. message VolumeConfigureResponse {
  199. string error = 1;
  200. }
  201. message VolumeStatusRequest {
  202. uint32 volume_id = 1;
  203. }
  204. message VolumeStatusResponse {
  205. bool is_read_only = 1;
  206. }
  207. message VolumeCopyRequest {
  208. uint32 volume_id = 1;
  209. string collection = 2;
  210. string replication = 3;
  211. string ttl = 4;
  212. string source_data_node = 5;
  213. string disk_type = 6;
  214. }
  215. message VolumeCopyResponse {
  216. uint64 last_append_at_ns = 1;
  217. }
  218. message CopyFileRequest {
  219. uint32 volume_id = 1;
  220. string ext = 2;
  221. uint32 compaction_revision = 3;
  222. uint64 stop_offset = 4;
  223. string collection = 5;
  224. bool is_ec_volume = 6;
  225. bool ignore_source_file_not_found = 7;
  226. }
  227. message CopyFileResponse {
  228. bytes file_content = 1;
  229. int64 modified_ts_ns = 2;
  230. }
  231. message ReadNeedleBlobRequest {
  232. uint32 volume_id = 1;
  233. uint64 needle_id = 2;
  234. int64 offset = 3; // actual offset
  235. int32 size = 4;
  236. }
  237. message ReadNeedleBlobResponse {
  238. bytes needle_blob = 1;
  239. }
  240. message WriteNeedleBlobRequest {
  241. uint32 volume_id = 1;
  242. uint64 needle_id = 2;
  243. int32 size = 3;
  244. bytes needle_blob = 4;
  245. }
  246. message WriteNeedleBlobResponse {
  247. }
  248. message ReadAllNeedlesRequest {
  249. repeated uint32 volume_ids = 1;
  250. }
  251. message ReadAllNeedlesResponse {
  252. uint32 volume_id = 1;
  253. uint64 needle_id = 2;
  254. uint32 cookie = 3;
  255. bytes needle_blob = 5;
  256. }
  257. message VolumeTailSenderRequest {
  258. uint32 volume_id = 1;
  259. uint64 since_ns = 2;
  260. uint32 idle_timeout_seconds = 3;
  261. }
  262. message VolumeTailSenderResponse {
  263. bytes needle_header = 1;
  264. bytes needle_body = 2;
  265. bool is_last_chunk = 3;
  266. }
  267. message VolumeTailReceiverRequest {
  268. uint32 volume_id = 1;
  269. uint64 since_ns = 2;
  270. uint32 idle_timeout_seconds = 3;
  271. string source_volume_server = 4;
  272. }
  273. message VolumeTailReceiverResponse {
  274. }
  275. message VolumeEcShardsGenerateRequest {
  276. uint32 volume_id = 1;
  277. string collection = 2;
  278. }
  279. message VolumeEcShardsGenerateResponse {
  280. }
  281. message VolumeEcShardsRebuildRequest {
  282. uint32 volume_id = 1;
  283. string collection = 2;
  284. }
  285. message VolumeEcShardsRebuildResponse {
  286. repeated uint32 rebuilt_shard_ids = 1;
  287. }
  288. message VolumeEcShardsCopyRequest {
  289. uint32 volume_id = 1;
  290. string collection = 2;
  291. repeated uint32 shard_ids = 3;
  292. bool copy_ecx_file = 4;
  293. string source_data_node = 5;
  294. bool copy_ecj_file = 6;
  295. bool copy_vif_file = 7;
  296. }
  297. message VolumeEcShardsCopyResponse {
  298. }
  299. message VolumeEcShardsDeleteRequest {
  300. uint32 volume_id = 1;
  301. string collection = 2;
  302. repeated uint32 shard_ids = 3;
  303. }
  304. message VolumeEcShardsDeleteResponse {
  305. }
  306. message VolumeEcShardsMountRequest {
  307. uint32 volume_id = 1;
  308. string collection = 2;
  309. repeated uint32 shard_ids = 3;
  310. }
  311. message VolumeEcShardsMountResponse {
  312. }
  313. message VolumeEcShardsUnmountRequest {
  314. uint32 volume_id = 1;
  315. repeated uint32 shard_ids = 3;
  316. }
  317. message VolumeEcShardsUnmountResponse {
  318. }
  319. message VolumeEcShardReadRequest {
  320. uint32 volume_id = 1;
  321. uint32 shard_id = 2;
  322. int64 offset = 3;
  323. int64 size = 4;
  324. uint64 file_key = 5;
  325. }
  326. message VolumeEcShardReadResponse {
  327. bytes data = 1;
  328. bool is_deleted = 2;
  329. }
  330. message VolumeEcBlobDeleteRequest {
  331. uint32 volume_id = 1;
  332. string collection = 2;
  333. uint64 file_key = 3;
  334. uint32 version = 4;
  335. }
  336. message VolumeEcBlobDeleteResponse {
  337. }
  338. message VolumeEcShardsToVolumeRequest {
  339. uint32 volume_id = 1;
  340. string collection = 2;
  341. }
  342. message VolumeEcShardsToVolumeResponse {
  343. }
  344. message ReadVolumeFileStatusRequest {
  345. uint32 volume_id = 1;
  346. }
  347. message ReadVolumeFileStatusResponse {
  348. uint32 volume_id = 1;
  349. uint64 idx_file_timestamp_seconds = 2;
  350. uint64 idx_file_size = 3;
  351. uint64 dat_file_timestamp_seconds = 4;
  352. uint64 dat_file_size = 5;
  353. uint64 file_count = 6;
  354. uint32 compaction_revision = 7;
  355. string collection = 8;
  356. string disk_type = 9;
  357. }
  358. message DiskStatus {
  359. string dir = 1;
  360. uint64 all = 2;
  361. uint64 used = 3;
  362. uint64 free = 4;
  363. float percent_free = 5;
  364. float percent_used = 6;
  365. string disk_type = 7;
  366. }
  367. message MemStatus {
  368. int32 goroutines = 1;
  369. uint64 all = 2;
  370. uint64 used = 3;
  371. uint64 free = 4;
  372. uint64 self = 5;
  373. uint64 heap = 6;
  374. uint64 stack = 7;
  375. }
  376. // tired storage on volume servers
  377. message RemoteFile {
  378. string backend_type = 1;
  379. string backend_id = 2;
  380. string key = 3;
  381. uint64 offset = 4;
  382. uint64 file_size = 5;
  383. uint64 modified_time = 6;
  384. string extension = 7;
  385. }
  386. message VolumeInfo {
  387. repeated RemoteFile files = 1;
  388. uint32 version = 2;
  389. string replication = 3;
  390. }
  391. // tiered storage
  392. message VolumeTierMoveDatToRemoteRequest {
  393. uint32 volume_id = 1;
  394. string collection = 2;
  395. string destination_backend_name = 3;
  396. bool keep_local_dat_file = 4;
  397. }
  398. message VolumeTierMoveDatToRemoteResponse {
  399. int64 processed = 1;
  400. float processedPercentage = 2;
  401. }
  402. message VolumeTierMoveDatFromRemoteRequest {
  403. uint32 volume_id = 1;
  404. string collection = 2;
  405. bool keep_remote_dat_file = 3;
  406. }
  407. message VolumeTierMoveDatFromRemoteResponse {
  408. int64 processed = 1;
  409. float processedPercentage = 2;
  410. }
  411. message VolumeServerStatusRequest {
  412. }
  413. message VolumeServerStatusResponse {
  414. repeated DiskStatus disk_statuses = 1;
  415. MemStatus memory_status = 2;
  416. }
  417. message VolumeServerLeaveRequest {
  418. }
  419. message VolumeServerLeaveResponse {
  420. }
  421. // remote storage
  422. message FetchAndWriteNeedleRequest {
  423. uint32 volume_id = 1;
  424. uint64 needle_id = 2;
  425. uint32 cookie = 3;
  426. int64 offset = 4;
  427. int64 size = 5;
  428. message Replica {
  429. string url = 1;
  430. string public_url = 2;
  431. int32 grpc_port = 3;
  432. }
  433. repeated Replica replicas = 6;
  434. string auth = 7;
  435. // remote conf
  436. remote_pb.RemoteConf remote_conf = 15;
  437. remote_pb.RemoteStorageLocation remote_location = 16;
  438. }
  439. message FetchAndWriteNeedleResponse {
  440. }
  441. // select on volume servers
  442. message QueryRequest {
  443. repeated string selections = 1;
  444. repeated string from_file_ids = 2;
  445. message Filter {
  446. string field = 1;
  447. string operand = 2;
  448. string value = 3;
  449. }
  450. Filter filter = 3;
  451. message InputSerialization {
  452. // NONE | GZIP | BZIP2
  453. string compression_type = 1;
  454. message CSVInput {
  455. string file_header_info = 1; // Valid values: NONE | USE | IGNORE
  456. string record_delimiter = 2; // Default: \n
  457. string field_delimiter = 3; // Default: ,
  458. string quote_charactoer = 4; // Default: "
  459. string quote_escape_character = 5; // Default: "
  460. string comments = 6; // Default: #
  461. // If true, records might contain record delimiters within quote characters
  462. bool allow_quoted_record_delimiter = 7; // default False.
  463. }
  464. message JSONInput {
  465. string type = 1; // Valid values: DOCUMENT | LINES
  466. }
  467. message ParquetInput {
  468. }
  469. CSVInput csv_input = 2;
  470. JSONInput json_input = 3;
  471. ParquetInput parquet_input = 4;
  472. }
  473. InputSerialization input_serialization = 4;
  474. message OutputSerialization {
  475. message CSVOutput {
  476. string quote_fields = 1; // Valid values: ALWAYS | ASNEEDED
  477. string record_delimiter = 2; // Default: \n
  478. string field_delimiter = 3; // Default: ,
  479. string quote_charactoer = 4; // Default: "
  480. string quote_escape_character = 5; // Default: "
  481. }
  482. message JSONOutput {
  483. string record_delimiter = 1;
  484. }
  485. CSVOutput csv_output = 2;
  486. JSONOutput json_output = 3;
  487. }
  488. OutputSerialization output_serialization = 5;
  489. }
  490. message QueriedStripe {
  491. bytes records = 1;
  492. }
  493. message VolumeNeedleStatusRequest {
  494. uint32 volume_id = 1;
  495. uint64 needle_id = 2;
  496. }
  497. message VolumeNeedleStatusResponse {
  498. uint64 needle_id = 1;
  499. uint32 cookie = 2;
  500. uint32 size = 3;
  501. uint64 last_modified = 4;
  502. uint32 crc = 5;
  503. string ttl = 6;
  504. }