~michaeleguo/ubuntu/trusty/percona-xtradb-cluster-5.5/arm64fix

« back to all changes in this revision

Viewing changes to storage/ndb/tools/restore/consumer_printer.cpp

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-10 14:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20140210144423-f2134l2gxuvq2m6l
Tags: upstream-5.5.34-25.9+dfsg
ImportĀ upstreamĀ versionĀ 5.5.34-25.9+dfsg

Show diffs side-by-side

added added

removed removed

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