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

#include <pretty-printer.h>

Collaboration diagram for impala::PrettyPrinter:

Static Public Member Functions

static std::string Print (bool value, TUnit::type ignored, bool verbose=false)
 
template<typename T >
static ENABLE_IF_ARITHMETIC (T, std::string) Print(T value
 
template<typename T >
static double GetByteUnit (T value, std::string *unit)
 
template<typename T >
static double GetUnit (T value, std::string *unit)
 
template<typename T >
static ENABLE_IF_INTEGRAL (T, int64_t) Mod(const T &value
 Utility to perform integer modulo if T is integral, otherwise to use fmod(). More...
 
template<typename T >
static ENABLE_IF_FLOAT (T, double) Mod(const T &value
 
template<typename T >
static void PrintTimeMs (T value, std::stringstream *ss)
 Print the value (time in ms) to ss. More...
 

Public Attributes

static TUnit::type unit
 
static TUnit::type bool verbose
 
static const int modulus
return value 
modulus
 
static int modulus
 

Static Public Attributes

static const int64_t KILOBYTE = 1024
 
static const int64_t MEGABYTE = KILOBYTE * 1024
 
static const int64_t GIGABYTE = MEGABYTE * 1024
 
static const int64_t SECOND = 1000
 
static const int64_t MINUTE = SECOND * 60
 
static const int64_t HOUR = MINUTE * 60
 
static const int64_t THOUSAND = 1000
 
static const int64_t MILLION = THOUSAND * 1000
 
static const int64_t BILLION = MILLION * 1000
 

Detailed Description

Methods for printing numeric values with optional units, or other types with an applicable operator<<.

Definition at line 31 of file pretty-printer.h.

Member Function Documentation

template<typename T >
static impala::PrettyPrinter::ENABLE_IF_ARITHMETIC ( ,
std::string   
)
static

Prints the 'value' in a human friendly format depending on the data type. i.e. for bytes: 3145728 -> 3MB If verbose is true, this also prints the raw value (before unit conversion) for types where this is applicable.

template<typename T >
static impala::PrettyPrinter::ENABLE_IF_FLOAT ( ,
double   
) const
static
template<typename T >
static impala::PrettyPrinter::ENABLE_IF_INTEGRAL ( ,
int64_t   
) const
static

Utility to perform integer modulo if T is integral, otherwise to use fmod().

template<typename T >
static double impala::PrettyPrinter::GetByteUnit ( value,
std::string *  unit 
)
inlinestatic

Definition at line 194 of file pretty-printer.h.

References GIGABYTE, KILOBYTE, and MEGABYTE.

template<typename T >
static double impala::PrettyPrinter::GetUnit ( value,
std::string *  unit 
)
inlinestatic

Definition at line 214 of file pretty-printer.h.

References BILLION, MILLION, and THOUSAND.

static std::string impala::PrettyPrinter::Print ( bool  value,
TUnit::type  ignored,
bool  verbose = false 
)
inlinestatic

Definition at line 33 of file pretty-printer.h.

Referenced by impala::AdmissionController::AdmitQuery(), impala::HdfsParquetTableWriter::BaseColumnWriter::AppendRow(), impala::Webserver::BeginRequestCallback(), impala::AdmissionController::CanAdmitRequest(), impala::ResourceBroker::ClearRequests(), impala::DiskIoMgr::ScanRange::Close(), impala::RuntimeState::CreateBlockMgr(), impala::MemInfo::DebugString(), impala::CpuInfo::DebugString(), impala::ResourceBroker::Expand(), impala::MemTracker::ExpandRmReservation(), impala::ImpalaServer::ExpireQueries(), impala::Statestore::GatherTopicUpdates(), impala::MemTracker::GetQueryMemTracker(), main(), impala::BufferedBlockMgr::MemLimitTooLowError(), impala::BufferedTupleStream::NewBlockForWrite(), impala::GrowingTest::NextTestCase(), impala::DataSink::OutputInsertStats(), impala::RpcEventHandler::postWrite(), impala::PlanFragmentExecutor::Prepare(), impala::PerfCounters::PrettyPrint(), impala::RuntimeProfile::PrettyPrint(), impala::RuntimeProfile::PrintChildCounters(), PrintExecSummary(), impala::HdfsScanNode::PrintHdfsSplitStats(), impala::HdfsParquetScanner::BaseColumnReader::ReadDataPage(), impala::AdmissionController::RejectRequest(), impala::ResourceBroker::Reserve(), impala::RuntimeState::SetMemLimitExceeded(), impala::ImpalaServer::SetQueryInflight(), impala::ExecEnv::StartServices(), impala::HdfsScanNode::StopAndFinalizeCounters(), impala::TEST(), impala::GrowingTest::Test(), impala::PartitioningThroughputTest::TestRawThroughput(), impala::PartitioningThroughputTest::TestThroughput(), TimeParallelExecutors(), impala::SimpleMetric< T, metric_kind >::ToHumanReadable(), impala::StatsMetric< double >::ToHumanReadable(), and impala::Statestore::TopicsHandler().

template<typename T >
static void impala::PrettyPrinter::PrintTimeMs ( value,
std::stringstream *  ss 
)
inlinestatic

Print the value (time in ms) to ss.

Definition at line 243 of file pretty-printer.h.

References HOUR, MINUTE, and SECOND.

Member Data Documentation

const int64_t impala::PrettyPrinter::BILLION = MILLION * 1000
static

Definition at line 191 of file pretty-printer.h.

Referenced by GetUnit().

const int64_t impala::PrettyPrinter::GIGABYTE = MEGABYTE * 1024
static

Definition at line 183 of file pretty-printer.h.

Referenced by GetByteUnit().

const int64_t impala::PrettyPrinter::HOUR = MINUTE * 60
static

Definition at line 187 of file pretty-printer.h.

Referenced by PrintTimeMs().

const int64_t impala::PrettyPrinter::KILOBYTE = 1024
static

Definition at line 181 of file pretty-printer.h.

Referenced by GetByteUnit().

const int64_t impala::PrettyPrinter::MEGABYTE = KILOBYTE * 1024
static

Definition at line 182 of file pretty-printer.h.

Referenced by GetByteUnit().

const int64_t impala::PrettyPrinter::MILLION = THOUSAND * 1000
static

Definition at line 190 of file pretty-printer.h.

Referenced by GetUnit().

const int64_t impala::PrettyPrinter::MINUTE = SECOND * 60
static

Definition at line 186 of file pretty-printer.h.

Referenced by PrintTimeMs().

const int modulus return value impala::PrettyPrinter::modulus

Definition at line 233 of file pretty-printer.h.

int impala::PrettyPrinter::modulus
Initial value:
{
return fmod(value, 1. * modulus)

Definition at line 237 of file pretty-printer.h.

const int64_t impala::PrettyPrinter::SECOND = 1000
static

Definition at line 185 of file pretty-printer.h.

Referenced by PrintTimeMs().

const int64_t impala::PrettyPrinter::THOUSAND = 1000
static

Definition at line 189 of file pretty-printer.h.

Referenced by GetUnit().

TUnit::type impala::PrettyPrinter::unit

Definition at line 45 of file pretty-printer.h.

TUnit::type bool impala::PrettyPrinter::verbose

Definition at line 45 of file pretty-printer.h.


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