MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
consumer_printer.cpp
1 /*
2  Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #include "consumer_printer.hpp"
20 extern FilteredNdbOut info;
21 extern bool ga_dont_ignore_systab_0;
22 extern NdbRecordPrintFormat g_ndbrecord_print_format;
23 extern const char *tab_path;
24 
25 bool
26 BackupPrinter::table(const TableS & tab)
27 {
28  if (m_print || m_print_meta)
29  {
30  m_ndbout << tab;
31  info.setLevel(254);
32  info << "Successfully printed table: ", tab.m_dictTable->getName();
33  }
34  return true;
35 }
36 
37 void
38 BackupPrinter::tuple(const TupleS & tup, Uint32 fragId)
39 {
40  m_dataCount++;
41  if (m_print || m_print_data)
42  {
43  if (m_ndbout.m_out == info.m_out)
44  {
45  info.setLevel(254);
46  info << tup.getTable()->getTableName() << "; ";
47  }
48  const TableS * table = tup.getTable();
49  if ((!ga_dont_ignore_systab_0) && table->isSYSTAB_0())
50  return;
51  m_ndbout << tup << g_ndbrecord_print_format.lines_terminated_by;
52  }
53 }
54 
55 void
56 BackupPrinter::logEntry(const LogEntry & logE)
57 {
58  if (m_print || m_print_log)
59  m_ndbout << logE << endl;
60  m_logCount++;
61 }
62 
63 void
64 BackupPrinter::endOfLogEntrys()
65 {
66  if (m_print || m_print_log)
67  {
68  info.setLevel(254);
69  info << "Printed " << m_dataCount << " tuples and "
70  << m_logCount << " log entries"
71  << " to stdout." << endl;
72  }
73 }
74 bool
75 BackupPrinter::update_apply_status(const RestoreMetaData &metaData)
76 {
77  if (m_print)
78  {
79  }
80  return true;
81 }