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.

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