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.

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