Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::ParseUtil Class Reference

Utility class for parsing information from strings. More...

#include <parse-util.h>

Collaboration diagram for impala::ParseUtil:

Static Public Member Functions

static int64_t ParseMemSpec (const std::string &mem_spec_str, bool *is_percent, int64_t relative_reference)
 

Detailed Description

Utility class for parsing information from strings.

Definition at line 24 of file parse-util.h.

Member Function Documentation

int64_t impala::ParseUtil::ParseMemSpec ( const std::string &  mem_spec_str,
bool is_percent,
int64_t  relative_reference 
)
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().


The documentation for this class was generated from the following files: