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.

551 lines
14 KiB

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