Project

General

Profile

Statistics
| Branch: | Revision:

gdp-if / tensorflow / GDPfs.proto @ master

History | View | Annotate | Download (1.68 KB)

1
syntax = "proto2";
2
package GDPfs;
3

    
4
enum FileType {
5
    UNKNOWN_TYPE = 0;
6
    FILE = 1;
7
    DIR = 2;
8
}
9

    
10
enum Operation {
11
    UNKNOWN_OP = 0;
12
    ADD = 1;
13
    DELETE = 2;
14
}
15

    
16
// The first record in a log indicates the type and other
17
// meta information about the file/directory.
18
message GDPfsMeta {
19
    // the *preferred* name for this file/directory. But
20
    // this is merely a suggestion.
21
    required FileType type = 1 [default = UNKNOWN_TYPE];
22
    optional string name = 2;
23
}
24

    
25

    
26
// For a directory, all records starting from the second
27
// record are of the following type:
28
message GDPfsDentry {
29

    
30
    // the operation
31
    required Operation op = 1;
32
    // the name of the entry. This is the name of the
33
    // file/directory without any slashes.
34
    required string name = 2;
35
    // the corresponding logname. This isn't required
36
    // for all operations. For example, delete does not
37
    // need the logname, only the name of the file/dir.
38
    // Note that this is the 32-byte internal name. 
39
    optional bytes logname = 3;
40
    // Type. Whether it is a directory or file.
41
    optional FileType type = 4;
42
}
43

    
44
// For a file, all records starting from the second
45
// record are of the following type:
46
message GDPfsFchunk {
47

    
48
    // offset of this file chunk in the file.
49
    required uint64 offset = 1;
50
    // ideally, this should be 16 bits. But we do not
51
    // have a pre-defined protobuf scalar for 16-bit.
52
    required uint32 length = 2;
53
    // actual data.
54
    required bytes data = 3;
55
}
56

    
57
message GDPfsMsg {
58
    oneof msg_oneof {
59
        GDPfsMeta meta = 1;
60
        GDPfsDentry dentry = 2;
61
        GDPfsFchunk fchunk = 3;
62
    }
63
    // time represented in nanoseconds since epoch.
64
    optional uint64 time_ns = 8;
65
}
66