mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-01 10:45:56 +08:00
Add ConfigBroadcastFollowerGetChangesReply class
This commit is contained in:
parent
f10dd70c37
commit
39e43801aa
@ -78,12 +78,26 @@ struct ConfigBroadcastFollowerGetSnapshotRequest {
|
||||
}
|
||||
};
|
||||
|
||||
struct ConfigBroadcastFollowerGetChangesReply {
|
||||
static constexpr FileIdentifier file_identifier = 4014927;
|
||||
Version mostRecentVersion;
|
||||
Standalone<VectorRef<VersionedConfigMutationRef>> changes;
|
||||
|
||||
ConfigBroadcastFollowerGetChangesReply()=default;
|
||||
explicit ConfigBroadcastFollowerGetChangesReply(Version mostRecentVersion, Standalone<VectorRef<VersionedConfigMutationRef>> const& changes)
|
||||
: mostRecentVersion(mostRecentVersion), changes(changes) {}
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, mostRecentVersion, changes);
|
||||
}
|
||||
};
|
||||
|
||||
struct ConfigBroadcastFollowerGetChangesRequest {
|
||||
static constexpr FileIdentifier file_identifier = 601280;
|
||||
Version lastSeenVersion;
|
||||
ConfigClassSet configClassSet;
|
||||
// TODO: Should use a different type here because we don't care about annotation
|
||||
ReplyPromise<ConfigFollowerGetChangesReply> reply;
|
||||
ReplyPromise<ConfigBroadcastFollowerGetChangesReply> reply;
|
||||
|
||||
ConfigBroadcastFollowerGetChangesRequest() = default;
|
||||
explicit ConfigBroadcastFollowerGetChangesRequest(Version lastSeenVersion, ConfigClassSet const& configClassSet)
|
||||
|
@ -134,7 +134,7 @@ class ConfigBroadcasterImpl {
|
||||
template <class Changes>
|
||||
void sendChangesReply(ConfigBroadcastFollowerGetChangesRequest const& req, Changes const& changes) const {
|
||||
ASSERT_LT(req.lastSeenVersion, mostRecentVersion);
|
||||
ConfigFollowerGetChangesReply reply;
|
||||
ConfigBroadcastFollowerGetChangesReply reply;
|
||||
reply.mostRecentVersion = mostRecentVersion;
|
||||
for (const auto& versionedMutation : changes) {
|
||||
if (versionedMutation.version > req.lastSeenVersion &&
|
||||
|
@ -252,7 +252,7 @@ class LocalConfigurationImpl {
|
||||
ConfigBroadcastFollowerInterface broadcaster) {
|
||||
loop {
|
||||
try {
|
||||
state ConfigFollowerGetChangesReply changesReply =
|
||||
state ConfigBroadcastFollowerGetChangesReply changesReply =
|
||||
wait(broadcaster.getChanges.getReply(ConfigBroadcastFollowerGetChangesRequest{
|
||||
self->lastSeenVersion, self->configKnobOverrides.getConfigClassSet() }));
|
||||
TraceEvent(SevDebug, "LocalConfigGotChanges", self->id); // TODO: Add more fields
|
||||
|
Loading…
x
Reference in New Issue
Block a user