Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Utility class for parsing information from strings. More...
#include <parse-util.h>
Static Public Member Functions | |
static int64_t | ParseMemSpec (const std::string &mem_spec_str, bool *is_percent, int64_t relative_reference) |
Utility class for parsing information from strings.
Definition at line 24 of file parse-util.h.
|
static |
Parses mem_spec_str and returns the memory size in bytes. Sets *is_percent to indicate whether the given spec is in percent. Accepted formats: '<int>[bB]?' -> bytes (default if no unit given) '<float>[mM(bB)]' -> megabytes '<float>[gG(bB)]' -> in gigabytes '<int>' -> in percent of relative_reference 'relative_reference' -> value used to compute the percentage value, typically MemInfo::physical_mem() Requires MemInfo to be initialized for the '' spec to work. Returns 0 if mem_spec_str is empty or '-1'. Returns -1 if parsing failed.
Definition at line 23 of file parse-util.cc.
References impala::StringParser::PARSE_SUCCESS.
Referenced by impala::QuerySchedule::GetPerHostMemoryEstimate(), ParseMemValue(), impala::RequestPoolService::RequestPoolService(), impala::ExecEnv::StartServices(), and impala::TEST().