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.

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