MCPcopy Create free account
hub / github.com/apple/foundationdb / DataDistributorSingleton

Class DataDistributorSingleton

fdbserver/ClusterController.actor.cpp:117–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115};
116
117struct DataDistributorSingleton : Singleton<DataDistributorInterface> {
118
119 DataDistributorSingleton(const Optional<DataDistributorInterface>& interface) : Singleton(interface) {}
120
121 Role getRole() const { return Role::DATA_DISTRIBUTOR; }
122 ProcessClass::ClusterRole getClusterRole() const { return ProcessClass::DataDistributor; }
123
124 void setInterfaceToDbInfo(ClusterControllerData* cc) const {
125 if (interface.present()) {
126 TraceEvent("CCDD_SetInf", cc->id).detail("Id", interface.get().id());
127 cc->db.setDistributor(interface.get());
128 }
129 }
130 void halt(ClusterControllerData* cc, Optional<Standalone<StringRef>> pid) const {
131 if (interface.present() && cc->id_worker.count(pid)) {
132 cc->id_worker[pid].haltDistributor =
133 brokenPromiseToNever(interface.get().haltDataDistributor.getReply(HaltDataDistributorRequest(cc->id)));
134 }
135 }
136 void recruit(ClusterControllerData* cc) const {
137 cc->lastRecruitTime = now();
138 cc->recruitDistributor.set(true);
139 }
140};
141
142struct BlobManagerSingleton : Singleton<BlobManagerInterface> {
143

Calls

no outgoing calls

Tested by

no test coverage detected