summaryrefslogtreecommitdiff
path: root/storage/perfschema/table_replication_applier_status_by_worker.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/perfschema/table_replication_applier_status_by_worker.h')
-rw-r--r--storage/perfschema/table_replication_applier_status_by_worker.h51
1 files changed, 35 insertions, 16 deletions
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h
index ed0ce7480b2..cc62dbee0a3 100644
--- a/storage/perfschema/table_replication_applier_status_by_worker.h
+++ b/storage/perfschema/table_replication_applier_status_by_worker.h
@@ -1,14 +1,21 @@
/*
- Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
@@ -74,14 +81,16 @@ struct st_row_worker {
};
/**
- Index 1 for replication channel
- Index 2 for worker
+ Position in table replication_applier_status_by_worker.
+ Index 1 for replication channel.
+ Index 2 for worker:
+ - position [0] is for Single Thread Slave (Master_info)
+ - position [1] .. [N] is for Multi Thread Slave (Slave_worker)
*/
-struct workers_per_channel
-:public PFS_double_index
+struct pos_replication_applier_status_by_worker : public PFS_double_index
{
- workers_per_channel()
- :PFS_double_index(0,0)
+
+ pos_replication_applier_status_by_worker() : PFS_double_index(0, 0)
{}
inline void reset(void)
@@ -98,12 +107,26 @@ struct workers_per_channel
m_index_1++;
m_index_2= 0;
}
+
+ inline void next_worker()
+ {
+ m_index_2++;
+ }
+
+ inline void
+ set_channel_after(const pos_replication_applier_status_by_worker *other)
+ {
+ m_index_1 = other->m_index_1 + 1;
+ m_index_2 = 0;
+ }
};
/** Table PERFORMANCE_SCHEMA.replication_applier_status_by_worker */
class table_replication_applier_status_by_worker: public PFS_engine_table
{
+ typedef pos_replication_applier_status_by_worker pos_t;
+
private:
void make_row(Slave_worker *);
/*
@@ -121,13 +144,9 @@ private:
/** True is the current row exists. */
bool m_row_exists;
/** Current position. */
- workers_per_channel m_pos;
- /** Next position. */
- workers_per_channel m_next_pos;
- /** Current position. */
- PFS_simple_index m_applier_pos;
+ pos_t m_pos;
/** Next position. */
- PFS_simple_index m_applier_next_pos;
+ pos_t m_next_pos;
protected:
/**