sapling/eden/fs/takeover/takeover.thrift
Wez Furlong a3b148fddb add thrift takeover serialization
Summary:
This adds version 3 nee 2 of the takeover serialization,
which uses thrift to represent the data.  Even though it is logically
version 2 I'm naming it version 3 because we're taking advantage of
the MessageType values from Version 1 which allowed numerical values
1 or 2 to represent different data types.

In this diff we now formalize that first word as the protocol version
and to avoid ambiguity are starting the new version value at 3.  I
did briefly consider using the name Version2 to refer to this and setting
the value in the enum to 3, but I didn't want to become known for
API hate crimes against my fellow engineers.

Reviewed By: simpkins

Differential Revision: D6733406

fbshipit-source-id: e2067365e4e8b388490440fd73ab504544011846
2018-01-30 14:21:18 -08:00

45 lines
1.3 KiB
Thrift

include "eden/fs/fuse/handlemap.thrift"
namespace cpp2 facebook.eden
// A list of takeover data serialization versions that the client supports
struct TakeoverVersionQuery {
// The set of versions supported by the client
1: set<i32> versions,
}
struct SerializedInodeMapEntry {
1: i64 inodeNumber,
2: i64 parentInode,
3: string name,
4: bool isUnlinked,
5: i64 numFuseReferences,
6: string hash,
7: i32 mode,
}
struct SerializedInodeMap {
1: i64 nextInodeNumber
2: list<SerializedInodeMapEntry> unloadedInodes,
}
struct SerializedMountInfo {
1: string mountPath,
2: string stateDirectory,
3: list<string> bindMountPaths,
// This binary blob is really a fuse_init_out instance.
// We don't transcribe that into thrift because the layout
// is system dependent and happens to be flat and thus is
// suitable for reinterpret_cast to be used upon it to
// access the struct once we've moved it across the process
// boundary. Note that takeover is always local to the same
// machine and thus has the same endianness.
4: binary connInfo, // fuse_init_out
5: handlemap.SerializedFileHandleMap fileHandleMap,
6: SerializedInodeMap inodeMap,
}
union SerializedTakeoverData {
1: list<SerializedMountInfo> mounts,
2: string errorReason,
}