Skip to content

Commit

Permalink
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

This diff moves the changes since API from the streaming interface to the non-streaming interface.

# Next Steps

* Collapsing journal entries
* .t tests, Python integration tests, C++ unit tests

# Discussion Points

None

Differential Revision: D66039653

fbshipit-source-id: 3d884bed0c632e59739433b8e372ad0601a0089f
  • Loading branch information
jdelliot authored and facebook-github-bot committed Nov 16, 2024
1 parent 95647f2 commit 738175a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 38 deletions.
29 changes: 28 additions & 1 deletion third-party/watchman/src/eden/fs/service/eden.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@ union CheckoutProgressInfoResponse {
}

/*
* Structs/Unionts for changesSince API
* Structs/Unions for changesSinceV2 API
*/
struct Added {
1: Dtype fileType;
Expand Down Expand Up @@ -1810,6 +1810,22 @@ union ChangeNotification {
2: LargeChangeNotification largeChange;
}

/**
* Return value of the changesSinceV2 API
*/
struct ChangesSinceV2Result {
1: JournalPosition toPosition;
2: list<ChangeNotification> changes;
}

/**
* Argument to changesSinceV2 API
*/
struct ChangesSinceV2Params {
1: PathString mountPoint;
2: JournalPosition fromPosition;
}

service EdenService extends fb303_core.BaseService {
list<MountInfo> listMounts() throws (1: EdenError ex);
void mount(1: MountArgument info) throws (1: EdenError ex);
Expand Down Expand Up @@ -2646,6 +2662,17 @@ service EdenService extends fb303_core.BaseService {
void ensureMaterialized(1: EnsureMaterializedParams params) throws (
1: EdenError ex,
);

/**
* Returns a list of change notifications along with a new journal position for a given mount
* since a specific journal position.
*
* This does not resolve expensive operations like moving a directory or changing
* commits. Callers must query Sapling to evaluate those potentially expensive operations.
*/
ChangesSinceV2Result changesSinceV2(1: ChangesSinceV2Params params) throws (
1: EdenError ex,
);
}

// The following were automatically generated and may benefit from renaming.
Expand Down
37 changes: 0 additions & 37 deletions third-party/watchman/src/eden/fs/service/streamingeden.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,6 @@ struct ChangesSinceResult {
1: eden.JournalPosition toPosition;
}

/**
* The value of a stream item in a streamChangedSinceV2 result stream.
*
* Each stream item refers to a single change notification
* since the notification clock provided.
*/
struct ChangeNotificationResult {
1: eden.ChangeNotification change;
}

/**
* Return value of the streamChangedSinceV2 API
*/
struct ChangesSinceV2Result {
1: eden.JournalPosition toPosition;
}

/**
* Argument to streamChangesSince API.
*/
Expand All @@ -115,14 +98,6 @@ struct StreamSelectedChangesSinceParams {
2: list<string> globs;
}

/**
* Argument to streamChangedSinceV2 API
*/
struct StreamChangesSinceV2Params {
1: eden.PathString mountPoint;
2: eden.JournalPosition fromPosition;
}

struct TraceTaskEventsRequest {}

typedef binary EdenStartStatusUpdate
Expand Down Expand Up @@ -221,18 +196,6 @@ service StreamingEdenService extends eden.EdenService {
1: eden.EdenError ex,
);

/**
* Returns a stream of change notifications for a given path since a specific point in time.
*
* This does not resolve expensive operations like moving a directory or changing
* commits. Callers must query Sapling to evaluate those potentially expensive operations.
*/
ChangesSinceV2Result, stream<
ChangeNotificationResult throws (1: eden.EdenError ex)
> streamChangesSinceV2(1: StreamChangesSinceV2Params params) throws (
1: eden.EdenError ex,
);

/**
* Same as the API above but only returns files that match the globs in filter.
* This API is intend to replace the above API but it's currently under development.
Expand Down

0 comments on commit 738175a

Please sign in to comment.