1 /* 2 Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2.0, 6 as published by the Free Software Foundation. 7 8 This program is also distributed with certain software (including 9 but not limited to OpenSSL) that is licensed under separate terms, 10 as designated in a particular file or component or in included license 11 documentation. The authors of MySQL hereby grant you an additional 12 permission to link the program and your derivative works with the 13 separately licensed software that they have included with MySQL. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License, version 2.0, for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 */ 24 25 #ifndef ABSTRACT_PROGRESS_REPORTER_INCLUDED 26 #define ABSTRACT_PROGRESS_REPORTER_INCLUDED 27 28 #include <vector> 29 30 #include "client/dump/i_crawler.h" 31 #include "client/dump/i_progress_reporter.h" 32 33 namespace Mysql { 34 namespace Tools { 35 namespace Dump { 36 37 class Abstract_progress_reporter : public virtual I_progress_reporter { 38 public: 39 /** 40 Add new Progress Watcher to report to. 41 */ 42 void register_progress_watcher(I_progress_watcher *new_progress_watcher); 43 44 protected: 45 /** 46 Specifies if have any Progress Watcher registered. 47 */ 48 bool have_progress_watcher(); 49 50 /** 51 Reports new non-empty chain being created by Chain Maker or new row 52 fetched from table by Table Reader. Called from Crawler or Table Reader. 53 */ 54 void report_new_chain_created(Item_processing_data *new_chain_creator); 55 /** 56 Report new object(table, row or any other) was started processing by 57 specified Object Reader, Table Reader, Formatter or Row Formatter. Reported 58 by these types. Is not reported by queues on enqueue but on dequeue. 59 */ 60 void report_object_processing_started(Item_processing_data *process_data); 61 /** 62 Report object(table, row or any other) finished being processed. In case of 63 table, this does not necessarily mean that all rows were processed. That 64 does not necessarily mean t3hat object was successfully written by 65 Output Writers. 66 */ 67 void report_object_processing_ended( 68 Item_processing_data *finished_process_data); 69 /** 70 Reports crawler ended enumerating objects and creating chains for them. 71 */ 72 virtual void report_crawler_completed(I_crawler *crawler); 73 74 void register_progress_watchers_in_child(I_progress_reporter *reporter); 75 76 private: 77 std::vector<I_progress_watcher *> m_progress_watchers; 78 }; 79 80 } // namespace Dump 81 } // namespace Tools 82 } // namespace Mysql 83 84 #endif 85