mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 18:02:31 +08:00
Rename config broadcast interface messages
This commit is contained in:
parent
833e53f8f0
commit
564a3d69b7
@ -122,8 +122,8 @@ class ConfigBroadcastInterface {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static constexpr FileIdentifier file_identifier = 1676543;
|
static constexpr FileIdentifier file_identifier = 1676543;
|
||||||
RequestStream<ConfigBroadcastSnapshotRequest> getSnapshot;
|
RequestStream<ConfigBroadcastSnapshotRequest> snapshot;
|
||||||
RequestStream<ConfigBroadcastChangesRequest> getChanges;
|
RequestStream<ConfigBroadcastChangesRequest> changes;
|
||||||
|
|
||||||
ConfigBroadcastInterface() : _id(deterministicRandom()->randomUniqueID()) {}
|
ConfigBroadcastInterface() : _id(deterministicRandom()->randomUniqueID()) {}
|
||||||
|
|
||||||
@ -133,6 +133,6 @@ public:
|
|||||||
|
|
||||||
template <class Ar>
|
template <class Ar>
|
||||||
void serialize(Ar& ar) {
|
void serialize(Ar& ar) {
|
||||||
serializer(ar, _id, getSnapshot, getChanges);
|
serializer(ar, _id, snapshot, changes);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -119,7 +119,7 @@ class ConfigBroadcasterImpl {
|
|||||||
req.mostRecentVersion = mostRecentVersion;
|
req.mostRecentVersion = mostRecentVersion;
|
||||||
// TODO: Retry in event of failure
|
// TODO: Retry in event of failure
|
||||||
++successfulChangeRequest;
|
++successfulChangeRequest;
|
||||||
return success(client.broadcastInterface.getChanges.getReply(req));
|
return success(client.broadcastInterface.changes.getReply(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigBroadcasterImpl()
|
ConfigBroadcasterImpl()
|
||||||
@ -193,7 +193,7 @@ public:
|
|||||||
TraceEvent(SevDebug, "ConfigBroadcasterSnapshotRequest", id)
|
TraceEvent(SevDebug, "ConfigBroadcasterSnapshotRequest", id)
|
||||||
.detail("Size", request.snapshot.size())
|
.detail("Size", request.snapshot.size())
|
||||||
.detail("Version", request.version);
|
.detail("Version", request.version);
|
||||||
return success(clients.back().broadcastInterface.getSnapshot.getReply(request));
|
return success(clients.back().broadcastInterface.snapshot.getReply(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyChanges(Standalone<VectorRef<VersionedConfigMutationRef>> const& changes,
|
void applyChanges(Standalone<VectorRef<VersionedConfigMutationRef>> const& changes,
|
||||||
|
@ -284,12 +284,12 @@ class LocalConfigurationImpl {
|
|||||||
ACTOR static Future<Void> consumeInternal(LocalConfigurationImpl* self, ConfigBroadcastInterface broadcaster) {
|
ACTOR static Future<Void> consumeInternal(LocalConfigurationImpl* self, ConfigBroadcastInterface broadcaster) {
|
||||||
loop {
|
loop {
|
||||||
choose {
|
choose {
|
||||||
when(ConfigBroadcastSnapshotRequest snapshotReq = waitNext(broadcaster.getSnapshot.getFuture())) {
|
when(ConfigBroadcastSnapshotRequest snapshotReq = waitNext(broadcaster.snapshot.getFuture())) {
|
||||||
ASSERT_GT(snapshotReq.version, self->lastSeenVersion);
|
ASSERT_GT(snapshotReq.version, self->lastSeenVersion);
|
||||||
++self->snapshots;
|
++self->snapshots;
|
||||||
wait(setSnapshot(self, std::move(snapshotReq.snapshot), snapshotReq.version));
|
wait(setSnapshot(self, std::move(snapshotReq.snapshot), snapshotReq.version));
|
||||||
}
|
}
|
||||||
when(state ConfigBroadcastChangesRequest req = waitNext(broadcaster.getChanges.getFuture())) {
|
when(state ConfigBroadcastChangesRequest req = waitNext(broadcaster.changes.getFuture())) {
|
||||||
wait(self->addChanges(req.changes, req.mostRecentVersion));
|
wait(self->addChanges(req.changes, req.mostRecentVersion));
|
||||||
req.reply.send(ConfigBroadcastChangesReply());
|
req.reply.send(ConfigBroadcastChangesReply());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user