| syntax = "proto3"; |
| |
| package pcloud; |
| |
| message Chunk { |
| string chunk_id = 1; |
| int32 size_bytes = 2; |
| bytes data = 3; |
| } |
| |
| // ChunkStorage |
| |
| service ChunkStorage { |
| rpc ListChunks(ListChunksRequest) returns (ListChunksResponse) {} |
| |
| rpc ReadChunk(ReadChunkRequest) returns (ReadChunkResponse) {} |
| |
| rpc StoreChunk(StoreChunkRequest) returns (StoreChunkResponse) {} |
| } |
| |
| message ListChunksRequest { |
| } |
| |
| message ListChunksResponse { |
| repeated string chunk_id = 1; |
| } |
| |
| message ReadChunkRequest { |
| string chunk_id = 1; |
| int32 offset = 2; |
| int32 num_bytes = 3; |
| } |
| |
| message ReadChunkResponse { |
| bytes data = 1; |
| } |
| |
| message StoreChunkRequest { |
| string chunk_id = 1; |
| bytes data = 2; |
| } |
| |
| message StoreChunkResponse { |
| } |
| |
| // MetadataStorage |
| |
| message ChunkStorageMetadata { |
| string chunk_id = 1; |
| int32 size_bytes = 2; |
| repeated string server = 3; |
| } |
| |
| service MetadataStorage { |
| rpc AddChunkServer(AddChunkServerRequest) returns (AddChunkServerResponse) {} |
| |
| rpc CreateBlob(CreateBlobRequest) returns (CreateBlobResponse) {} |
| |
| rpc GetBlobMetadata(GetBlobMetadataRequest) returns (GetBlobMetadataResponse) {} |
| } |
| |
| message AddChunkServerRequest { |
| string address = 1; |
| } |
| |
| message AddChunkServerResponse { |
| } |
| |
| message CreateBlobRequest { |
| int32 size_bytes = 1; |
| int32 chunk_size_bytes = 2; |
| int32 num_replicas = 3; |
| } |
| |
| message CreateBlobResponse { |
| string blob_id = 1; |
| repeated ChunkStorageMetadata chunk = 2; |
| } |
| |
| message GetBlobMetadataRequest { |
| string blob_id = 1; |
| } |
| |
| message GetBlobMetadataResponse { |
| string blob_id = 1; |
| int32 size_bytes = 2; |
| repeated ChunkStorageMetadata chunk = 3; |
| } |