MySQL 8.0.29
Source Code Documentation
cursor_by_host.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
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, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#ifndef CURSOR_BY_HOST_H
25#define CURSOR_BY_HOST_H
26
27/**
28 @file storage/perfschema/cursor_by_host.h
29 Cursor CURSOR_BY_HOST (declarations).
30*/
31
35
36/**
37 @addtogroup performance_schema_tables
38 @{
39*/
40
42 public:
43 explicit PFS_index_hosts(PFS_engine_key *key_1) : PFS_engine_index(key_1) {}
44
45 ~PFS_index_hosts() override = default;
46
47 virtual bool match(PFS_host *pfs) = 0;
48};
49
50/** Cursor CURSOR_BY_HOST. */
52 public:
53 static ha_rows get_row_count();
54
55 void reset_position(void) override;
56
57 int rnd_next() override;
58 int rnd_pos(const void *pos) override;
59
60 int index_next() override;
61
62 protected:
63 explicit cursor_by_host(const PFS_engine_table_share *share);
64
65 public:
66 ~cursor_by_host() override = default;
67
68 protected:
69 virtual int make_row(PFS_host *host) = 0;
70
71 private:
72 /** Current position. */
74 /** Next position. */
76
77 protected:
79};
80
81/** @} */
82#endif
Definition: pfs_engine_table.h:299
Definition: pfs_engine_table.h:267
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: cursor_by_host.h:41
virtual bool match(PFS_host *pfs)=0
~PFS_index_hosts() override=default
PFS_index_hosts(PFS_engine_key *key_1)
Definition: cursor_by_host.h:43
Cursor CURSOR_BY_HOST.
Definition: cursor_by_host.h:51
cursor_by_host(const PFS_engine_table_share *share)
Definition: cursor_by_host.cc:39
int index_next() override
Find key in index, read record.
Definition: cursor_by_host.cc:74
virtual int make_row(PFS_host *host)=0
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: cursor_by_host.cc:61
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: cursor_by_host.cc:42
~cursor_by_host() override=default
PFS_simple_index m_next_pos
Next position.
Definition: cursor_by_host.h:75
PFS_simple_index m_pos
Current position.
Definition: cursor_by_host.h:73
PFS_index_hosts * m_opened_index
Definition: cursor_by_host.h:78
static ha_rows get_row_count()
Definition: cursor_by_host.cc:35
int rnd_next() override
Fetch the next row in this cursor.
Definition: cursor_by_host.cc:47
char * pos
Definition: do_ctype.cc:76
my_off_t ha_rows
Definition: my_base.h:1139
const char * host
Definition: mysqladmin.cc:58
Performance schema tables (declarations).
Performance schema host (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Per host statistics.
Definition: pfs_host.h:62
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
Helpers to implement a performance schema table.