예제 #1
0
파일: table.cpp 프로젝트: aamadeo27/voltdb
std::string Table::debug(const std::string &spacer) const {
    VOLT_DEBUG("tabledebug start");
    std::ostringstream buffer;
    std::string infoSpacer = spacer + "  |";

    buffer << infoSpacer << tableType() << "(" << name() << "):\n";
    buffer << infoSpacer << "\tAllocated Tuples:  " << allocatedTupleCount() << "\n";
    buffer << infoSpacer << "\tNumber of Columns: " << columnCount() << "\n";

    //
    // Columns
    //
    buffer << infoSpacer << "===========================================================\n";
    buffer << infoSpacer << "\tCOLUMNS\n";
    buffer << infoSpacer << m_schema->debug();
    //buffer << infoSpacer << " - TupleSchema needs a \"debug\" method. Add one for output here.\n";

#ifdef VOLT_TRACE_ENABLED
    //
    // Tuples
    //
    if (tableType().compare("LargeTempTable") != 0) {
        buffer << infoSpacer << "===========================================================\n";
        buffer << infoSpacer << "\tDATA\n";

        TableIterator iter = const_cast<Table*>(this)->iterator();
        TableTuple tuple(m_schema);
        if (this->activeTupleCount() == 0) {
            buffer << infoSpacer << "\t<NONE>\n";
        } else {
            std::string lastTuple = "";
            while (iter.next(tuple)) {
                if (tuple.isActive()) {
                    buffer << infoSpacer << "\t" << tuple.debug(this->name().c_str()) << "\n";
                }
            }
        }
        buffer << infoSpacer << "===========================================================\n";
    }
#endif
    std::string ret(buffer.str());
    VOLT_DEBUG("tabledebug end");

    return ret;
}
예제 #2
0
std::string Table::debug() {
    VOLT_DEBUG("tabledebug start");
    std::ostringstream buffer;

    buffer << tableType() << "(" << name() << "):\n";
    buffer << "\tAllocated Tuples:  " << allocatedTupleCount() << "\n";
    buffer << "\tNumber of Columns: " << columnCount() << "\n";

    //
    // Columns
    //
    buffer << "===========================================================\n";
    buffer << "\tCOLUMNS\n";
    buffer << m_schema->debug();
    //buffer << " - TupleSchema needs a \"debug\" method. Add one for output here.\n";

    //
    // Tuples
    //
    buffer << "===========================================================\n";
    buffer << "\tDATA\n";

    TableIterator iter = iterator();
    TableTuple tuple(m_schema);
    if (this->activeTupleCount() == 0) {
        buffer << "\t<NONE>\n";
    } else {
        std::string lastTuple = "";
        while (iter.next(tuple)) {
            if (tuple.isActive()) {
                buffer << "\t" << tuple.debug(this->name().c_str()) << "\n";
            }
        }
    }
    buffer << "===========================================================\n";

    std::string ret(buffer.str());
    VOLT_DEBUG("tabledebug end");

    return ret;
}