MCPcopy Create free account
hub / github.com/Tencent/phxsql / Apply

Method Apply

phxsqlproxy/plugin/requestfilter/freqctrlconfig.cpp:145–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145bool FreqCtrlConfig::Apply(const std::string & db_name, bool is_write_query) {
146 auto itr = db_bucket_.find(db_name);
147 if (itr == db_bucket_.end()) {
148 return true;
149 }
150 bool ret = true;
151 if (is_write_query) {
152 ret = itr->second->ApplyWriteToken(1);
153 } else {
154 ret = itr->second->ApplyReadToken(1);
155 }
156 return ret;
157}
158
159}
160

Callers 1

CanExecuteMethod · 0.45

Calls 2

ApplyWriteTokenMethod · 0.80
ApplyReadTokenMethod · 0.80

Tested by

no test coverage detected