Skip to content

Commit df5b760

Browse files
Chris Dinhfacebook-github-bot
authored andcommitted
Rename subscribeStreamTemporary to subscribeStreamChangesSince
Summary: # Context SubscribeStreamTemporary is a function that allows users to recieve notifications whenever there is a change to the edenFS journal. Despite intended to be a temporary function, it's been named as such for about 6 years. # This Diff Creates a new function subscribeStreamChangesSince. Move the logic of subscribeStreamTemporary to this new function and have subscribeStreamTemporary call it. Reviewed By: jdelliot Differential Revision: D68220555 fbshipit-source-id: de630f60dd66fba77ba3935ca27d95e994acbc7c
1 parent 4add551 commit df5b760

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

eden/fs/service/EdenServiceHandler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,12 @@ void EdenServiceHandler::getCurrentJournalPosition(
12261226
apache::thrift::ServerStream<JournalPosition>
12271227
EdenServiceHandler::subscribeStreamTemporary(
12281228
std::unique_ptr<std::string> mountPoint) {
1229+
return streamJournalChanged(std::move(mountPoint));
1230+
}
1231+
1232+
apache::thrift::ServerStream<JournalPosition>
1233+
EdenServiceHandler::streamJournalChanged(
1234+
std::unique_ptr<std::string> mountPoint) {
12291235
auto helper = INSTRUMENT_THRIFT_CALL(DBG3, *mountPoint);
12301236
auto mountHandle = lookupMount(mountPoint);
12311237

eden/fs/service/EdenServiceHandler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ class EdenServiceHandler : virtual public StreamingEdenServiceSvIf,
230230
apache::thrift::ServerStream<JournalPosition> subscribeStreamTemporary(
231231
std::unique_ptr<std::string> mountPoint) override;
232232

233+
apache::thrift::ServerStream<JournalPosition> streamJournalChanged(
234+
std::unique_ptr<std::string> mountPoint) override;
235+
233236
apache::thrift::ServerStream<FsEvent> traceFsEvents(
234237
std::unique_ptr<std::string> mountPoint,
235238
int64_t eventCategoryMask) override;

eden/fs/service/streamingeden.thrift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,25 +110,26 @@ typedef binary EdenStartStatusUpdate
110110
*/
111111
service StreamingEdenService extends eden.EdenService {
112112
/**
113-
* Request notification about changes to the journal for
114-
* the specified mountPoint.
113+
* subscribeStreamTemporary is deprecated. Please use streamJournalChanged.
114+
*/
115+
stream<eden.JournalPosition> subscribeStreamTemporary(
116+
1: eden.PathString mountPoint,
117+
) (deprecated);
118+
119+
/**
120+
*
121+
* Returns a stream of "events" indicating that the Journal has changed.
115122
*
116123
* IMPORTANT: Do not use the JournalPosition values in the stream. They are
117-
* meaningless. Instead, call getFilesChangedSince or
124+
* meaningless. Instead, call changesSinceV2 or
118125
* getCurrentJournalPosition which will return up-to-date information and
119126
* unblock future notifications on this subscription. If the subscriber
120-
* never calls getFilesChangedSince or getCurrentJournalPosition in
127+
* never calls changesSinceV2 or getCurrentJournalPosition in
121128
* response to a notification on this stream, future notifications may not
122129
* arrive.
123-
*
124-
* This is an implementation of the subscribe API using the
125-
* new rsocket based streaming thrift protocol.
126-
* The name is temporary: we want to make some API changes
127-
* but want to start pushing out an implementation now because
128-
* we've seen inflated memory usage for the older `subscribe`
129-
* method above.
130+
130131
*/
131-
stream<eden.JournalPosition> subscribeStreamTemporary(
132+
stream<eden.JournalPosition> streamJournalChanged(
132133
1: eden.PathString mountPoint,
133134
);
134135

0 commit comments

Comments
 (0)