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.

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