| 470 | using namespace impala; |
| 471 | |
| 472 | void SetExecutorGroups(const string& flag, BackendDescriptorPB* be_desc) { |
| 473 | vector<StringPiece> groups; |
| 474 | groups = Split(flag, ",", SkipEmpty()); |
| 475 | if (groups.empty()) groups.push_back(ImpalaServer::DEFAULT_EXECUTOR_GROUP_NAME); |
| 476 | DCHECK_EQ(1, groups.size()); |
| 477 | // Name and optional minimum group size are separated by ':'. |
| 478 | for (const StringPiece& group : groups) { |
| 479 | int colon_idx = group.find_first_of(':'); |
| 480 | ExecutorGroupDescPB* group_desc = be_desc->add_executor_groups(); |
| 481 | group_desc->set_name(group.substr(0, colon_idx).as_string()); |
| 482 | if (colon_idx != StringPiece::npos) { |
| 483 | StringParser::ParseResult result; |
| 484 | group_desc->set_min_size(StringParser::StringToInt<int64_t>( |
| 485 | group.data() + colon_idx + 1, group.length() - colon_idx - 1, &result)); |
| 486 | if (result != StringParser::PARSE_SUCCESS) { |
| 487 | LOG(FATAL) << "Failed to parse minimum executor group size from group: " |
| 488 | << group.ToString(); |
| 489 | } |
| 490 | } else { |
| 491 | group_desc->set_min_size(1); |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | } // end anonymous namespace |
| 496 | |
| 497 | namespace impala { |
no test coverage detected