#include <LbmEntryDump.h>
Inheritance diagram for LbmEntryDump:
Public Member Functions | |
LbmEntryDump (TraceLevel traceLevelInit, SharedTraceTarget pTraceTarget, string name) | |
uint | dump (BTreeDescriptor const &treeDescriptor, bool printRID=false) |
virtual void | initTraceSource (SharedTraceTarget pTraceTarget, std::string name) |
For use when initialization has to be deferred until after construction. | |
void | trace (TraceLevel level, std::string message) const |
Records a trace message. | |
bool | isTracing () const |
| |
bool | isTracingLevel (TraceLevel level) const |
Determines whether a particular level is being traced. | |
TraceTarget & | getTraceTarget () const |
| |
SharedTraceTarget | getSharedTraceTarget () const |
| |
std::string | getTraceSourceName () const |
Gets the name of this source. | |
void | setTraceSourceName (std::string const &n) |
Sets the name of this source. | |
TraceLevel | getMinimumTraceLevel () const |
void | disableTracing () |
Private Attributes | |
TraceLevel | traceLevel |
The level at which tracing of cluster dump will be done. | |
Static Private Attributes | |
static const uint | lineLen = 80 |
Definition at line 42 of file LbmEntryDump.h.
LbmEntryDump::LbmEntryDump | ( | TraceLevel | traceLevelInit, | |
SharedTraceTarget | pTraceTarget, | |||
string | name | |||
) | [explicit] |
Definition at line 27 of file LbmEntryDump.cpp.
References traceLevel.
00030 : 00031 TraceSource(pTraceTargetInit, nameInit) 00032 { 00033 traceLevel = traceLevelInit; 00034 }
uint LbmEntryDump::dump | ( | BTreeDescriptor const & | treeDescriptor, | |
bool | printRID = false | |||
) |
Definition at line 37 of file LbmEntryDump.cpp.
References TupleData::compute(), opaqueToInt(), LbmEntry::toString(), traceLevel, BTreeDescriptor::tupleDescriptor, and TupleAccessor::unmarshal().
00038 { 00039 uint numTuples = 0; 00040 TupleData indexTuple; 00041 TupleDescriptor indexTupleDesc = treeDescriptor.tupleDescriptor; 00042 SharedBTreeReader pReader = SharedBTreeReader( 00043 new BTreeReader(treeDescriptor)); 00044 00045 TupleAccessor const& indexTupleAccessor 00046 = pReader->getTupleAccessorForRead(); 00047 00048 indexTuple.compute(indexTupleDesc); 00049 00050 ostringstream treeRootPageId; 00051 treeRootPageId << "RootPageId " << opaqueToInt(treeDescriptor.rootPageId); 00052 FENNEL_TRACE(traceLevel, treeRootPageId.str()); 00053 00054 if (!pReader->searchFirst()) { 00055 pReader->endSearch(); 00056 } 00057 00058 while (pReader->isPositioned()) { 00059 indexTupleAccessor.unmarshal(indexTuple); 00060 FENNEL_TRACE(traceLevel, LbmEntry::toString(indexTuple, printRID)); 00061 numTuples ++; 00062 00063 if (!pReader->searchNext()) { 00064 pReader->endSearch(); 00065 break; 00066 } 00067 } 00068 00069 return numTuples; 00070 }
void TraceSource::initTraceSource | ( | SharedTraceTarget | pTraceTarget, | |
std::string | name | |||
) | [virtual, inherited] |
For use when initialization has to be deferred until after construction.
pTraceTarget | the TraceTarget to which messages will be sent | |
name | the name of this source |
Definition at line 46 of file TraceSource.cpp.
References TraceSource::isTracing(), TraceSource::minimumLevel, TraceSource::name, TraceSource::pTraceTarget, and TRACE_OFF.
Referenced by TestBase::beforeTestCase(), TestBase::TestBase(), and TraceSource::TraceSource().
00049 { 00050 assert(!pTraceTarget.get()); 00051 00052 pTraceTarget = pTraceTargetInit; 00053 name = nameInit; 00054 if (isTracing()) { 00055 minimumLevel = pTraceTarget->getSourceTraceLevel(name); 00056 } else { 00057 minimumLevel = TRACE_OFF; 00058 } 00059 }
void TraceSource::trace | ( | TraceLevel | level, | |
std::string | message | |||
) | const [inherited] |
Records a trace message.
Normally only called via FENNEL_TRACE.
level | severity level of event being trace | |
message | the text of the message |
Definition at line 61 of file TraceSource.cpp.
References TraceSource::getTraceTarget(), TraceSource::isTracing(), TraceSource::name, and TraceTarget::notifyTrace().
Referenced by Calculator::exec(), and ExecStreamScheduler::traceStreamBufferContents().
00062 { 00063 if (isTracing()) { 00064 getTraceTarget().notifyTrace(name,level,message); 00065 } 00066 }
bool TraceSource::isTracing | ( | ) | const [inline, inherited] |
Definition at line 88 of file TraceSource.h.
Referenced by TraceSource::initTraceSource(), CalcExecStream::prepare(), and TraceSource::trace().
00089 { 00090 return pTraceTarget.get() ? true : false; 00091 }
bool TraceSource::isTracingLevel | ( | TraceLevel | level | ) | const [inline, inherited] |
Determines whether a particular level is being traced.
level | trace level to test |
Definition at line 100 of file TraceSource.h.
Referenced by ExecStreamScheduler::addGraph(), SimpleExecStreamGovernor::assignCachePages(), SimpleExecStreamGovernor::distributeCachePages(), Calculator::exec(), ExecStreamScheduler::ExecStreamScheduler(), LcsClusterNodeWriter::getLastClusterPageForWrite(), LcsClusterNodeWriter::moveFromTempToIndex(), JavaSinkExecStream::stuffByteBuffer(), and ExecStreamScheduler::traceStreamBuffers().
00101 { 00102 return level >= minimumLevel; 00103 }
TraceTarget& TraceSource::getTraceTarget | ( | ) | const [inline, inherited] |
Definition at line 108 of file TraceSource.h.
Referenced by TraceSource::trace().
00109 { 00110 assert(isTracing()); 00111 return *(pTraceTarget.get()); 00112 }
SharedTraceTarget TraceSource::getSharedTraceTarget | ( | ) | const [inline, inherited] |
Definition at line 117 of file TraceSource.h.
Referenced by Database::init(), LcsClusterAppendExecStream::initLoad(), and CalcExecStream::prepare().
00118 { 00119 return pTraceTarget; 00120 }
std::string TraceSource::getTraceSourceName | ( | ) | const [inline, inherited] |
Gets the name of this source.
Useful to construct nested names for subcomponents that are also TraceSources.
Definition at line 127 of file TraceSource.h.
Referenced by LcsClusterAppendExecStream::initLoad().
00128 { 00129 return name; 00130 }
void TraceSource::setTraceSourceName | ( | std::string const & | n | ) | [inline, inherited] |
Sets the name of this source.
Useful to construct dynamic names for fine-grained filtering.
Definition at line 136 of file TraceSource.h.
00137 { 00138 name = n; 00139 }
TraceLevel TraceSource::getMinimumTraceLevel | ( | ) | const [inline, inherited] |
void TraceSource::disableTracing | ( | ) | [inherited] |
Definition at line 68 of file TraceSource.cpp.
References TraceSource::minimumLevel, TraceSource::pTraceTarget, and TRACE_OFF.
Referenced by TestBase::afterTestCase().
00069 { 00070 pTraceTarget.reset(); 00071 minimumLevel = TRACE_OFF; 00072 }
const uint LbmEntryDump::lineLen = 80 [static, private] |
Definition at line 45 of file LbmEntryDump.h.
TraceLevel LbmEntryDump::traceLevel [private] |
The level at which tracing of cluster dump will be done.
I.e., the caller of this object can control the level at which dumps are generated.
Definition at line 52 of file LbmEntryDump.h.
Referenced by dump(), and LbmEntryDump().