Skip to content

Commit

Permalink
Prepare to move changes since API from streaming to non-streaming
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jdelliot authored and facebook-github-bot committed Nov 16, 2024
1 parent 10c03e8 commit 749660d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 56 deletions.
58 changes: 58 additions & 0 deletions eden/fs/service/eden.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -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<MountInfo> listMounts() throws (1: EdenError ex);
void mount(1: MountArgument info) throws (1: EdenError ex);
Expand Down
57 changes: 1 addition & 56 deletions eden/fs/service/streamingeden.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -144,7 +89,7 @@ struct ChangesSinceResult {
* since the notification clock provided.
*/
struct ChangeNotificationResult {
1: ChangeNotification change;
1: eden.ChangeNotification change;
}

/**
Expand Down

0 comments on commit 749660d

Please sign in to comment.