MCPcopy Create free account
hub / github.com/apache/impala / GetBytes

Method GetBytes

be/src/util/process-state-info.cc:68–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68int64_t ProcessStateInfo::GetBytes(const string& state_key) const {
69 ProcessStateMap::const_iterator it = process_state_map_.find(state_key);
70 if (it != process_state_map_.end()) {
71 vector<string> fields;
72 split(fields, it->second, is_any_of(" "), token_compress_on);
73 // We expect state_value such as, e.g., '16129508', '16129508 kB', '16129508 mB'
74 StringParser::ParseResult result;
75 int64_t state_value = StringParser::StringToInt<int64_t>(fields[0].data(),
76 fields[0].size(), &result);
77 if (result == StringParser::PARSE_SUCCESS) {
78 if (fields.size() < 2) return state_value;
79 if (fields[1].compare("kB") == 0) return state_value * 1024L;
80 }
81 }
82 return -1;
83}
84
85void ProcessStateInfo::ReadProcIO() {
86 ifstream ioinfo("/proc/self/io", ios::in);

Callers 1

TESTFunction · 0.45

Calls 5

compareMethod · 0.65
findMethod · 0.45
endMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36