Skip to content
Snippets Groups Projects
Commit 24d71fdd authored by Timm Fitschen's avatar Timm Fitschen Committed by Henrik tom Wörden
Browse files

WIP: file upload/download

parent 9f91df07
No related branches found
No related tags found
No related merge requests found
...@@ -565,10 +565,8 @@ enum TransmissionStatus { ...@@ -565,10 +565,8 @@ enum TransmissionStatus {
TRANSMISSION_STATUS_GO_ON = 3; TRANSMISSION_STATUS_GO_ON = 3;
} }
// Register a file upload indicating the total size if possible. // Register a file upload.
message RegisterFileUploadRequest { message RegisterFileUploadRequest {
// Estimated total size of the upload.
int64 total_size = 1;
} }
// Response of the file server upon an upload registration request. // Response of the file server upon an upload registration request.
...@@ -577,8 +575,6 @@ message RegisterFileUploadResponse { ...@@ -577,8 +575,6 @@ message RegisterFileUploadResponse {
RegistrationStatus status = 1; RegistrationStatus status = 1;
// The registration id is used to identify chunks and files which belong to the same upload . // The registration id is used to identify chunks and files which belong to the same upload .
string registration_id = 2; string registration_id = 2;
// The server's maximum number of parallel uploads. Requesting more uploads has undefined behavior.
int32 max_parallel_transmissions = 3;
// The server's maximum chunk size. Submitting bigger chunks has undefined behavior. // The server's maximum chunk size. Submitting bigger chunks has undefined behavior.
int64 max_chunk_size = 4; int64 max_chunk_size = 4;
// The server's maximum file size. Submitting bigger files has undefined behavior. // The server's maximum file size. Submitting bigger files has undefined behavior.
...@@ -615,13 +611,16 @@ message FileDownloadHeader { ...@@ -615,13 +611,16 @@ message FileDownloadHeader {
FileIdentifier id = 1; FileIdentifier id = 1;
// The file descriptor of the file. // The file descriptor of the file.
FileDescriptor file_descriptor = 2; FileDescriptor file_descriptor = 2;
// This is the transmission id which can be used to download the actual blob
// in the FileDownloadRequest.
FileTransmissionId file_transmission_id = 3;
// Errors for this file (e.g. MESSAGE_CODE_ENTITY_DOES_NOT_EXIST, or // Errors for this file (e.g. MESSAGE_CODE_ENTITY_DOES_NOT_EXIST, or
// MESSAGE_CODE_FILE_NOT_FOUND). // MESSAGE_CODE_FILE_NOT_FOUND).
repeated Message errors = 3; repeated Message errors = 4;
// Warnings for this file. // Warnings for this file.
repeated Message warnings = 4; repeated Message warnings = 5;
// Info messages for this file. // Info messages for this file.
repeated Message infos = 5; repeated Message infos = 6;
} }
...@@ -632,31 +631,18 @@ message RegisterFileDownloadResponse { ...@@ -632,31 +631,18 @@ message RegisterFileDownloadResponse {
// The registration id is used to identify chunks and files which belong to // The registration id is used to identify chunks and files which belong to
// the same upload . // the same upload .
string registration_id = 2; string registration_id = 2;
// The server's maximum number of parallel downloads. Starting more parallel // Metadata of the files which are to be downloaded.
// uploads has undefined behavior. repeated FileDownloadHeader files = 4;
int32 max_parallel_transmissions = 3;
// The estimated total size of the downloaded files.
int64 total_size = 4;
} }
// Stores a single chunk of a file // Stores a single chunk of a file
message FileChunk { message FileChunk {
// Chunk metadata. // Temporary identifier containing the file and registration_id.
FileChunkMetadata metadata = 1; FileTransmissionId file_transmission_id = 1;
// Chunk id.
FileChunkId id = 2;
// Binary data of a chunk. // Binary data of a chunk.
bytes data = 5; bytes data = 5;
} }
// Identifies a chunk in a file transmission.
message FileChunkId {
// Temporary identifier containing the file and registration_id.
FileTransmissionId file_transmission_id = 1;
// The number of this chunk. Chunks do not have to be uploaded in the correct
// sequence. This chunk number is used to define the order of the chunks.
int32 chunk_no = 3;
}
// Temporary identifier of a single file during a transmission. // Temporary identifier of a single file during a transmission.
message FileTransmissionId { message FileTransmissionId {
...@@ -668,11 +654,6 @@ message FileTransmissionId { ...@@ -668,11 +654,6 @@ message FileTransmissionId {
string file_id = 2; string file_id = 2;
} }
// Chunk metadata.
message FileChunkMetadata {
// The size of this chunk
int64 chunk_size = 4;
}
// Request for a file upload which has been registered previously. Chunks may be send in any order. // Request for a file upload which has been registered previously. Chunks may be send in any order.
message FileUploadRequest { message FileUploadRequest {
...@@ -688,16 +669,8 @@ message FileUploadResponse { ...@@ -688,16 +669,8 @@ message FileUploadResponse {
// Request for a file download which has been registered previously. // Request for a file download which has been registered previously.
message FileDownloadRequest { message FileDownloadRequest {
// Download a chunk by identifying the chunk explicitely or by letting the // Request the next chunk for this file.
// server decide which chunk is to be send. FileTransmissionId file_transmission_id = 1;
oneof request {
// The registration id which has previously been issued by the server. This
// request means: Send any chunk
string registration_id = 1;
// An id of a chunk. The client can guess a chunk id or use one from a
// previous download request's next field.
FileChunkId chunk_id = 2;
}
} }
// Response containing a chunk of a file. // Response containing a chunk of a file.
...@@ -706,8 +679,6 @@ message FileDownloadResponse { ...@@ -706,8 +679,6 @@ message FileDownloadResponse {
TransmissionStatus status = 1; TransmissionStatus status = 1;
// A single file chunk // A single file chunk
FileChunk chunk = 2; FileChunk chunk = 2;
// The next chunk (if any)
FileChunkId next = 3;
} }
// File Transaction Service // File Transaction Service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment