2016-09-10 02:56:02 +03:00
|
|
|
namespace cpp2 facebook.eden.overlay
|
2017-07-08 04:32:42 +03:00
|
|
|
namespace py facebook.eden.overlay
|
2016-09-10 02:56:02 +03:00
|
|
|
|
|
|
|
typedef binary Hash
|
|
|
|
typedef string PathComponent
|
|
|
|
typedef string RelativePath
|
|
|
|
|
2018-03-24 04:17:05 +03:00
|
|
|
// An entry can be in one of three states:
|
|
|
|
//
|
|
|
|
// 1. Non-materialized, unknown inode number
|
|
|
|
// 2. Non-materialized, known inode number
|
|
|
|
// 3. Materialized (inode number must be known)
|
|
|
|
//
|
|
|
|
// Eventually, once legacy data has been migrated, only states #2 and #3 will
|
|
|
|
// occur. All tree entries will be given an inode number upon allocation,
|
|
|
|
// regardless of whether the entry exists in the overlay.
|
|
|
|
|
2016-09-10 02:56:02 +03:00
|
|
|
struct OverlayEntry {
|
|
|
|
// Holds the mode_t data, which encodes the file type and permissions
|
2018-03-24 04:17:05 +03:00
|
|
|
// Note: eventually this data will be obsoleted by the InodeMetadata table.
|
2016-09-10 02:56:02 +03:00
|
|
|
1: i32 mode
|
2018-03-24 04:17:05 +03:00
|
|
|
// The child's inode number. Until legacy data is migrated, this may be zero
|
|
|
|
// or unset. It should never be the case that hash is unset (indicating
|
|
|
|
// materialized) and inodeNumber is zero or unset.
|
2017-02-11 01:16:00 +03:00
|
|
|
2: i64 inodeNumber
|
2018-03-24 04:17:05 +03:00
|
|
|
// If not materialized, then this child is identical to an existing
|
2017-02-11 01:16:00 +03:00
|
|
|
// source control Tree or Blob. This contains the hash of that Tree or Blob.
|
2018-03-24 04:17:05 +03:00
|
|
|
// If materialized, the hash is either unset or has zero length.
|
|
|
|
3: optional Hash hash
|
2016-09-10 02:56:02 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
struct OverlayDir {
|
|
|
|
// The contents of this dir.
|
|
|
|
1: map<PathComponent, OverlayEntry> entries
|
|
|
|
}
|