From 749660d0a3a115b088341b7513929d14594aa27b Mon Sep 17 00:00:00 2001 From: John Elliott Date: Fri, 15 Nov 2024 18:36:32 -0800 Subject: [PATCH] Prepare to move changes since API from streaming to non-streaming Summary: # Context We are introducing EdenFS notifications to support scalable and ergonomic file system notifications for EdenFS mounts. # This Diff Based on user feedback as well as discussions with former Watchman/EdenFS SWEs, we are planning to move from a streaming endpoint to a non-streaming endpoint. There are many reasons, but ergonomics and peformance (for this use case) are top reasons. This diff moves some defintions from the streaming API to the non-streaming API. # Next Steps * Continue migrating the streaming interface to a non-streaming interface. * Collapsing journal entries * .t tests, Python integration tests, C++ unit tests # Discussion Points None Differential Revision: D66026081 fbshipit-source-id: c7d1652f3a42d2854db5fba948706fe316376ef9 --- eden/fs/service/eden.thrift | 58 ++++++++++++++++++++++++++++ eden/fs/service/streamingeden.thrift | 57 +-------------------------- 2 files changed, 59 insertions(+), 56 deletions(-) diff --git a/eden/fs/service/eden.thrift b/eden/fs/service/eden.thrift index 93feb9e24fb0..ed273ffc868b 100644 --- a/eden/fs/service/eden.thrift +++ b/eden/fs/service/eden.thrift @@ -1752,6 +1752,64 @@ union CheckoutProgressInfoResponse { 2: CheckoutNotInProgress noProgress; } +/* + * Structs/Unionts for changesSince API + */ +struct Added { + 1: Dtype fileType; + 3: PathString path; +} + +struct Modified { + 1: Dtype fileType; + 3: PathString path; +} + +struct Renamed { + 1: Dtype fileType; + 2: PathString from; + 3: PathString to; +} + +struct Replaced { + 1: Dtype fileType; + 2: PathString from; + 3: PathString to; +} + +struct Removed { + 1: Dtype fileType; + 3: PathString path; +} + +union SmallChangeNotification { + 1: Added added; + 2: Modified modified; + 3: Renamed renamed; + 4: Replaced replaced; + 5: Removed removed; +} + +struct DirectoryRenamed { + 1: PathString from; + 2: PathString to; +} + +struct CommitTransition { + 1: ThriftRootId from; + 2: ThriftRootId to; +} + +union LargeChangeNotification { + 1: DirectoryRenamed directoryRenamed; + 2: CommitTransition commitTransition; +} + +union ChangeNotification { + 1: SmallChangeNotification smallChange; + 2: LargeChangeNotification largeChange; +} + service EdenService extends fb303_core.BaseService { list listMounts() throws (1: EdenError ex); void mount(1: MountArgument info) throws (1: EdenError ex); diff --git a/eden/fs/service/streamingeden.thrift b/eden/fs/service/streamingeden.thrift index 578baaed6768..d7b39c2a30b9 100644 --- a/eden/fs/service/streamingeden.thrift +++ b/eden/fs/service/streamingeden.thrift @@ -62,61 +62,6 @@ const i64 FS_EVENT_READ = 1; const i64 FS_EVENT_WRITE = 2; const i64 FS_EVENT_OTHER = 4; -struct Added { - 1: eden.Dtype fileType; - 3: eden.PathString path; -} - -struct Modified { - 1: eden.Dtype fileType; - 3: eden.PathString path; -} - -struct Renamed { - 1: eden.Dtype fileType; - 2: eden.PathString from; - 3: eden.PathString to; -} - -struct Replaced { - 1: eden.Dtype fileType; - 2: eden.PathString from; - 3: eden.PathString to; -} - -struct Removed { - 1: eden.Dtype fileType; - 3: eden.PathString path; -} - -union SmallChangeNotification { - 1: Added added; - 2: Modified modified; - 3: Renamed renamed; - 4: Replaced replaced; - 5: Removed removed; -} - -struct DirectoryRenamed { - 1: eden.PathString from; - 2: eden.PathString to; -} - -struct CommitTransition { - 1: eden.ThriftRootId from; - 2: eden.ThriftRootId to; -} - -union LargeChangeNotification { - 1: DirectoryRenamed directoryRenamed; - 2: CommitTransition commitTransition; -} - -union ChangeNotification { - 1: SmallChangeNotification smallChange; - 2: LargeChangeNotification largeChange; -} - /** * The value of a stream item. * @@ -144,7 +89,7 @@ struct ChangesSinceResult { * since the notification clock provided. */ struct ChangeNotificationResult { - 1: ChangeNotification change; + 1: eden.ChangeNotification change; } /**