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

Function throttleGenerator

fdbcli/ThrottleCommand.actor.cpp:313–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313void throttleGenerator(const char* text,
314 const char* line,
315 std::vector<std::string>& lc,
316 std::vector<StringRef> const& tokens) {
317 if (tokens.size() == 1) {
318 const char* opts[] = { "on tag", "off", "enable auto", "disable auto", "list", nullptr };
319 arrayGenerator(text, line, opts, lc);
320 } else if (tokens.size() >= 2 && tokencmp(tokens[1], "on")) {
321 if (tokens.size() == 2) {
322 const char* opts[] = { "tag", nullptr };
323 arrayGenerator(text, line, opts, lc);
324 } else if (tokens.size() == 6) {
325 const char* opts[] = { "default", "immediate", "batch", nullptr };
326 arrayGenerator(text, line, opts, lc);
327 }
328 } else if (tokens.size() >= 2 && tokencmp(tokens[1], "off") && !tokencmp(tokens[tokens.size() - 1], "tag")) {
329 const char* opts[] = { "all", "auto", "manual", "tag", "default", "immediate", "batch", nullptr };
330 arrayGenerator(text, line, opts, lc);
331 } else if (tokens.size() == 2 && (tokencmp(tokens[1], "enable") || tokencmp(tokens[1], "disable"))) {
332 const char* opts[] = { "auto", nullptr };
333 arrayGenerator(text, line, opts, lc);
334 } else if (tokens.size() >= 2 && tokencmp(tokens[1], "list")) {
335 if (tokens.size() == 2) {
336 const char* opts[] = { "throttled", "recommended", "all", nullptr };
337 arrayGenerator(text, line, opts, lc);
338 } else if (tokens.size() == 3) {
339 const char* opts[] = { "LIMITS", nullptr };
340 arrayGenerator(text, line, opts, lc);
341 }
342 }
343}
344
345std::vector<const char*> throttleHintGenerator(std::vector<StringRef> const& tokens, bool inArgument) {
346 if (tokens.size() == 1) {

Callers

nothing calls this directly

Calls 3

arrayGeneratorFunction · 0.85
tokencmpFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected