Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
debug-util.h
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef IMPALA_UTIL_DEBUG_UTIL_H
16 #define IMPALA_UTIL_DEBUG_UTIL_H
17 
18 #include <ostream>
19 #include <string>
20 #include <sstream>
21 
22 #include "gen-cpp/JniCatalog_types.h"
23 #include "gen-cpp/Descriptors_types.h"
24 #include "gen-cpp/Exprs_types.h"
25 #include "gen-cpp/Frontend_types.h"
26 #include "gen-cpp/PlanNodes_types.h"
27 #include "gen-cpp/RuntimeProfile_types.h"
28 #include "gen-cpp/ImpalaService_types.h"
29 #include "gen-cpp/parquet_types.h"
30 
31 namespace impala {
32 
33 class RowDescriptor;
34 class TupleDescriptor;
35 class Tuple;
36 class TupleRow;
37 class RowBatch;
38 
39 std::ostream& operator<<(std::ostream& os, const TFunctionBinaryType::type& op);
40 std::ostream& operator<<(std::ostream& os, const TUniqueId& id);
41 std::ostream& operator<<(std::ostream& os, const THdfsFileFormat::type& type);
42 std::ostream& operator<<(std::ostream& os, const THdfsCompression::type& type);
43 std::ostream& operator<<(std::ostream& os, const TStmtType::type& type);
44 std::ostream& operator<<(std::ostream& os, const TUnit::type& type);
45 std::ostream& operator<<(std::ostream& os, const TMetricKind::type& type);
46 std::ostream& operator<<(std::ostream& os, const beeswax::QueryState::type& type);
47 std::ostream& operator<<(std::ostream& os, const parquet::Encoding::type& type);
48 std::ostream& operator<<(std::ostream& os, const parquet::CompressionCodec::type& type);
49 std::ostream& operator<<(std::ostream& os, const parquet::Type::type& type);
50 
51 std::string PrintTuple(const Tuple* t, const TupleDescriptor& d);
52 std::string PrintRow(TupleRow* row, const RowDescriptor& d);
53 std::string PrintBatch(RowBatch* batch);
54 std::string PrintId(const TUniqueId& id, const std::string& separator = ":");
55 std::string PrintPlanNodeType(const TPlanNodeType::type& type);
56 std::string PrintTCatalogObjectType(const TCatalogObjectType::type& type);
57 std::string PrintTDdlType(const TDdlType::type& type);
58 std::string PrintTCatalogOpType(const TCatalogOpType::type& type);
59 std::string PrintTSessionType(const TSessionType::type& type);
60 std::string PrintTStmtType(const TStmtType::type& type);
61 std::string PrintQueryState(const beeswax::QueryState::type& type);
62 std::string PrintEncoding(const parquet::Encoding::type& type);
63 std::string PrintAsHex(const char* bytes, int64_t len);
64 std::string PrintTMetricKind(const TMetricKind::type& type);
65 std::string PrintTUnit(const TUnit::type& type);
66 std::string PrintPath(const std::vector<int>& path);
67 
71 bool ParseId(const std::string& s, TUniqueId* id);
72 
76 std::string GetBuildVersion(bool compact = false);
77 
79 std::string GetVersionString(bool compact = false);
80 
84 std::string GetStackTrace();
85 
86 }
87 
88 #endif
string path("/usr/lib/sasl2:/usr/lib64/sasl2:/usr/local/lib/sasl2:/usr/lib/x86_64-linux-gnu/sasl2")
bool ParseId(const string &s, TUniqueId *id)
Definition: debug-util.cc:112
std::string PrintTUnit(const TUnit::type &type)
string GetVersionString(bool compact)
Returns "<program short name> version <GetBuildVersion(compact)>".
Definition: debug-util.cc:239
string PrintPath(const vector< int > &path)
Definition: debug-util.cc:211
std::string PrintQueryState(const beeswax::QueryState::type &type)
string GetBuildVersion(bool compact)
Definition: debug-util.cc:223
std::string PrintTCatalogOpType(const TCatalogOpType::type &type)
string PrintId(const TUniqueId &id, const string &separator)
Definition: debug-util.cc:97
std::string PrintTCatalogObjectType(const TCatalogObjectType::type &type)
std::string PrintTSessionType(const TSessionType::type &type)
std::string PrintTMetricKind(const TMetricKind::type &type)
std::string PrintTStmtType(const TStmtType::type &type)
string PrintBatch(RowBatch *batch)
Definition: debug-util.cc:203
std::string PrintTDdlType(const TDdlType::type &type)
std::string PrintEncoding(const parquet::Encoding::type &type)
string PrintPlanNodeType(const TPlanNodeType::type &type)
Definition: debug-util.cc:157
string GetStackTrace()
Definition: debug-util.cc:246
string PrintRow(TupleRow *row, const RowDescriptor &d)
Definition: debug-util.cc:192
string PrintTuple(const Tuple *t, const TupleDescriptor &d)
Definition: debug-util.cc:166
ostream & operator<<(ostream &os, const map< TNetworkAddress, llama::TAllocatedResource > &resources)
string PrintAsHex(const char *bytes, int64_t len)
Definition: debug-util.cc:103