2018-10-11 16:16:33 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package volume_server_pb;
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////
|
|
|
|
|
|
|
|
service VolumeServer {
|
|
|
|
//Experts only: takes multiple fid parameters. This function does not propagate deletes to replicas.
|
|
|
|
rpc BatchDelete (BatchDeleteRequest) returns (BatchDeleteResponse) {
|
|
|
|
}
|
2018-10-15 14:12:43 +08:00
|
|
|
rpc VacuumVolumeCheck (VacuumVolumeCheckRequest) returns (VacuumVolumeCheckResponse) {
|
|
|
|
}
|
|
|
|
rpc VacuumVolumeCompact (VacuumVolumeCompactRequest) returns (VacuumVolumeCompactResponse) {
|
|
|
|
}
|
|
|
|
rpc VacuumVolumeCommit (VacuumVolumeCommitRequest) returns (VacuumVolumeCommitResponse) {
|
|
|
|
}
|
|
|
|
rpc VacuumVolumeCleanup (VacuumVolumeCleanupRequest) returns (VacuumVolumeCleanupResponse) {
|
|
|
|
}
|
2018-10-15 15:40:46 +08:00
|
|
|
|
2018-10-15 15:03:55 +08:00
|
|
|
rpc DeleteCollection (DeleteCollectionRequest) returns (DeleteCollectionResponse) {
|
|
|
|
}
|
2019-04-11 12:41:17 +08:00
|
|
|
rpc AllocateVolume (AllocateVolumeRequest) returns (AllocateVolumeResponse) {
|
2018-10-15 15:40:46 +08:00
|
|
|
}
|
2018-10-16 12:44:41 +08:00
|
|
|
|
2018-10-15 16:19:15 +08:00
|
|
|
rpc VolumeSyncStatus (VolumeSyncStatusRequest) returns (VolumeSyncStatusResponse) {
|
|
|
|
}
|
2019-04-18 13:04:49 +08:00
|
|
|
rpc VolumeIncrementalCopy (VolumeIncrementalCopyRequest) returns (stream VolumeIncrementalCopyResponse) {
|
2019-03-26 00:16:12 +08:00
|
|
|
}
|
2018-10-15 16:48:15 +08:00
|
|
|
|
|
|
|
rpc VolumeMount (VolumeMountRequest) returns (VolumeMountResponse) {
|
|
|
|
}
|
|
|
|
rpc VolumeUnmount (VolumeUnmountRequest) returns (VolumeUnmountResponse) {
|
|
|
|
}
|
2018-12-29 16:03:30 +08:00
|
|
|
rpc VolumeDelete (VolumeDeleteRequest) returns (VolumeDeleteResponse) {
|
|
|
|
}
|
2018-10-15 16:48:15 +08:00
|
|
|
|
2019-04-18 13:04:49 +08:00
|
|
|
// copy the .idx .dat files, and mount this volume
|
|
|
|
rpc VolumeCopy (VolumeCopyRequest) returns (VolumeCopyResponse) {
|
2019-03-24 02:33:34 +08:00
|
|
|
}
|
|
|
|
rpc ReadVolumeFileStatus (ReadVolumeFileStatusRequest) returns (ReadVolumeFileStatusResponse) {
|
|
|
|
}
|
|
|
|
rpc CopyFile (CopyFileRequest) returns (stream CopyFileResponse) {
|
|
|
|
}
|
2018-10-16 13:25:28 +08:00
|
|
|
|
2019-04-21 02:35:20 +08:00
|
|
|
rpc VolumeTailSender (VolumeTailSenderRequest) returns (stream VolumeTailSenderResponse) {
|
|
|
|
}
|
|
|
|
rpc VolumeTailReceiver (VolumeTailReceiverRequest) returns (VolumeTailReceiverResponse) {
|
2019-04-18 15:18:29 +08:00
|
|
|
}
|
|
|
|
|
2019-05-20 15:53:17 +08:00
|
|
|
// erasure coding
|
2019-05-26 05:02:06 +08:00
|
|
|
rpc VolumeEcShardsGenerate (VolumeEcShardsGenerateRequest) returns (VolumeEcShardsGenerateResponse) {
|
2019-05-20 15:53:17 +08:00
|
|
|
}
|
2019-05-26 05:02:06 +08:00
|
|
|
rpc VolumeEcShardsCopy (VolumeEcShardsCopyRequest) returns (VolumeEcShardsCopyResponse) {
|
|
|
|
}
|
|
|
|
rpc VolumeEcShardsDelete (VolumeEcShardsDeleteRequest) returns (VolumeEcShardsDeleteResponse) {
|
2019-05-20 15:53:17 +08:00
|
|
|
}
|
2019-05-26 14:23:19 +08:00
|
|
|
rpc VolumeEcShardsMount (VolumeEcShardsMountRequest) returns (VolumeEcShardsMountResponse) {
|
|
|
|
}
|
|
|
|
rpc VolumeEcShardsUnmount (VolumeEcShardsUnmountRequest) returns (VolumeEcShardsUnmountResponse) {
|
|
|
|
}
|
2019-05-20 15:53:17 +08:00
|
|
|
|
|
|
|
|
2018-10-11 16:16:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////
|
|
|
|
|
|
|
|
message BatchDeleteRequest {
|
|
|
|
repeated string file_ids = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BatchDeleteResponse {
|
|
|
|
repeated DeleteResult results = 1;
|
|
|
|
}
|
|
|
|
message DeleteResult {
|
|
|
|
string file_id = 1;
|
|
|
|
int32 status = 2;
|
|
|
|
string error = 3;
|
|
|
|
uint32 size = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Empty {
|
|
|
|
}
|
2018-10-15 14:12:43 +08:00
|
|
|
|
|
|
|
message VacuumVolumeCheckRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 14:12:43 +08:00
|
|
|
}
|
|
|
|
message VacuumVolumeCheckResponse {
|
|
|
|
double garbage_ratio = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message VacuumVolumeCompactRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 14:12:43 +08:00
|
|
|
int64 preallocate = 2;
|
|
|
|
}
|
|
|
|
message VacuumVolumeCompactResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message VacuumVolumeCommitRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 14:12:43 +08:00
|
|
|
}
|
|
|
|
message VacuumVolumeCommitResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message VacuumVolumeCleanupRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 14:12:43 +08:00
|
|
|
}
|
|
|
|
message VacuumVolumeCleanupResponse {
|
|
|
|
}
|
2018-10-15 15:03:55 +08:00
|
|
|
|
|
|
|
message DeleteCollectionRequest {
|
|
|
|
string collection = 1;
|
|
|
|
}
|
|
|
|
message DeleteCollectionResponse {
|
|
|
|
}
|
2018-10-15 15:40:46 +08:00
|
|
|
|
2019-04-11 12:41:17 +08:00
|
|
|
message AllocateVolumeRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 15:40:46 +08:00
|
|
|
string collection = 2;
|
|
|
|
int64 preallocate = 3;
|
|
|
|
string replication = 4;
|
|
|
|
string ttl = 5;
|
|
|
|
}
|
2019-04-11 12:41:17 +08:00
|
|
|
message AllocateVolumeResponse {
|
2018-10-15 15:40:46 +08:00
|
|
|
}
|
2018-10-15 16:19:15 +08:00
|
|
|
|
|
|
|
message VolumeSyncStatusRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 16:19:15 +08:00
|
|
|
}
|
|
|
|
message VolumeSyncStatusResponse {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-12-23 03:10:08 +08:00
|
|
|
string collection = 2;
|
2018-10-15 16:19:15 +08:00
|
|
|
string replication = 4;
|
|
|
|
string ttl = 5;
|
|
|
|
uint64 tail_offset = 6;
|
|
|
|
uint32 compact_revision = 7;
|
|
|
|
uint64 idx_file_size = 8;
|
|
|
|
}
|
2018-10-15 16:48:15 +08:00
|
|
|
|
2019-04-18 13:04:49 +08:00
|
|
|
message VolumeIncrementalCopyRequest {
|
2019-03-26 00:16:12 +08:00
|
|
|
uint32 volume_id = 1;
|
2019-04-18 15:18:29 +08:00
|
|
|
uint64 since_ns = 2;
|
2019-03-26 00:16:12 +08:00
|
|
|
}
|
2019-04-18 13:04:49 +08:00
|
|
|
message VolumeIncrementalCopyResponse {
|
2019-03-26 00:16:12 +08:00
|
|
|
bytes file_content = 1;
|
|
|
|
}
|
|
|
|
|
2018-10-15 16:48:15 +08:00
|
|
|
message VolumeMountRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 16:48:15 +08:00
|
|
|
}
|
|
|
|
message VolumeMountResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message VolumeUnmountRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-10-15 16:48:15 +08:00
|
|
|
}
|
|
|
|
message VolumeUnmountResponse {
|
|
|
|
}
|
2018-10-16 13:25:28 +08:00
|
|
|
|
2018-12-29 16:03:30 +08:00
|
|
|
message VolumeDeleteRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
2018-12-29 16:03:30 +08:00
|
|
|
}
|
|
|
|
message VolumeDeleteResponse {
|
|
|
|
}
|
|
|
|
|
2019-04-18 13:04:49 +08:00
|
|
|
message VolumeCopyRequest {
|
2019-03-24 02:33:34 +08:00
|
|
|
uint32 volume_id = 1;
|
|
|
|
string collection = 2;
|
|
|
|
string replication = 3;
|
|
|
|
string ttl = 4;
|
|
|
|
string source_data_node = 5;
|
|
|
|
}
|
2019-04-18 13:04:49 +08:00
|
|
|
message VolumeCopyResponse {
|
2019-04-19 15:39:34 +08:00
|
|
|
uint64 last_append_at_ns = 1;
|
2019-03-24 02:33:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message CopyFileRequest {
|
|
|
|
uint32 volume_id = 1;
|
2019-05-20 12:37:49 +08:00
|
|
|
string ext = 2;
|
|
|
|
uint32 compaction_revision = 3;
|
|
|
|
uint64 stop_offset = 4;
|
2019-03-24 02:33:34 +08:00
|
|
|
}
|
|
|
|
message CopyFileResponse {
|
|
|
|
bytes file_content = 1;
|
|
|
|
}
|
|
|
|
|
2019-04-21 02:35:20 +08:00
|
|
|
message VolumeTailSenderRequest {
|
2019-04-18 15:18:29 +08:00
|
|
|
uint32 volume_id = 1;
|
|
|
|
uint64 since_ns = 2;
|
2019-04-21 03:05:28 +08:00
|
|
|
uint32 idle_timeout_seconds = 3;
|
2019-04-18 15:18:29 +08:00
|
|
|
}
|
2019-04-21 02:35:20 +08:00
|
|
|
message VolumeTailSenderResponse {
|
2019-04-18 15:18:29 +08:00
|
|
|
bytes needle_header = 1;
|
|
|
|
bytes needle_body = 2;
|
2019-04-19 10:22:13 +08:00
|
|
|
bool is_last_chunk = 3;
|
2019-04-18 15:18:29 +08:00
|
|
|
}
|
|
|
|
|
2019-04-21 02:35:20 +08:00
|
|
|
message VolumeTailReceiverRequest {
|
|
|
|
uint32 volume_id = 1;
|
|
|
|
uint64 since_ns = 2;
|
2019-04-21 03:05:28 +08:00
|
|
|
uint32 idle_timeout_seconds = 3;
|
2019-04-21 02:35:20 +08:00
|
|
|
string source_volume_server = 4;
|
|
|
|
}
|
|
|
|
message VolumeTailReceiverResponse {
|
|
|
|
}
|
|
|
|
|
2019-05-26 05:02:06 +08:00
|
|
|
message VolumeEcShardsGenerateRequest {
|
2019-05-20 15:53:17 +08:00
|
|
|
uint32 volume_id = 1;
|
2019-05-26 05:02:06 +08:00
|
|
|
string collection = 2;
|
2019-05-20 15:53:17 +08:00
|
|
|
}
|
2019-05-26 05:02:06 +08:00
|
|
|
message VolumeEcShardsGenerateResponse {
|
2019-05-20 15:53:17 +08:00
|
|
|
}
|
|
|
|
|
2019-05-26 05:02:06 +08:00
|
|
|
message VolumeEcShardsCopyRequest {
|
2019-05-20 15:53:17 +08:00
|
|
|
uint32 volume_id = 1;
|
|
|
|
string collection = 2;
|
|
|
|
repeated uint32 ec_indexes = 3;
|
|
|
|
string source_data_node = 5;
|
|
|
|
}
|
2019-05-26 05:02:06 +08:00
|
|
|
message VolumeEcShardsCopyResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message VolumeEcShardsDeleteRequest {
|
|
|
|
uint32 volume_id = 1;
|
|
|
|
bool should_delete_ecx = 2;
|
|
|
|
repeated uint32 ec_indexes = 3;
|
|
|
|
}
|
|
|
|
message VolumeEcShardsDeleteResponse {
|
2019-05-20 15:53:17 +08:00
|
|
|
}
|
|
|
|
|
2019-05-26 14:23:19 +08:00
|
|
|
message VolumeEcShardsMountRequest {
|
|
|
|
uint32 volume_id = 1;
|
|
|
|
string collection = 2;
|
|
|
|
repeated uint32 ec_indexes = 3;
|
|
|
|
}
|
|
|
|
message VolumeEcShardsMountResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message VolumeEcShardsUnmountRequest {
|
|
|
|
uint32 volume_id = 1;
|
|
|
|
repeated uint32 ec_indexes = 3;
|
|
|
|
}
|
|
|
|
message VolumeEcShardsUnmountResponse {
|
|
|
|
}
|
|
|
|
|
2019-03-24 02:33:34 +08:00
|
|
|
message ReadVolumeFileStatusRequest {
|
|
|
|
uint32 volume_id = 1;
|
2018-10-16 13:25:28 +08:00
|
|
|
}
|
2019-03-24 02:33:34 +08:00
|
|
|
message ReadVolumeFileStatusResponse {
|
|
|
|
uint32 volume_id = 1;
|
2019-04-19 15:39:34 +08:00
|
|
|
uint64 idx_file_timestamp_seconds = 2;
|
2019-03-24 02:33:34 +08:00
|
|
|
uint64 idx_file_size = 3;
|
2019-04-19 15:39:34 +08:00
|
|
|
uint64 dat_file_timestamp_seconds = 4;
|
2019-03-24 02:33:34 +08:00
|
|
|
uint64 dat_file_size = 5;
|
2019-04-10 19:41:55 +08:00
|
|
|
uint64 file_count = 6;
|
2019-04-20 03:29:49 +08:00
|
|
|
uint32 compaction_revision = 7;
|
2019-04-21 02:35:20 +08:00
|
|
|
string collection = 8;
|
2018-10-16 13:25:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message DiskStatus {
|
|
|
|
string dir = 1;
|
|
|
|
uint64 all = 2;
|
|
|
|
uint64 used = 3;
|
|
|
|
uint64 free = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message MemStatus {
|
|
|
|
int32 goroutines = 1;
|
|
|
|
uint64 all = 2;
|
|
|
|
uint64 used = 3;
|
|
|
|
uint64 free = 4;
|
|
|
|
uint64 self = 5;
|
|
|
|
uint64 heap = 6;
|
|
|
|
uint64 stack = 7;
|
|
|
|
}
|