MySQL 9.1.0
Source Code Documentation
dd_resource_group.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2 This program is free software; you can redistribute it and/or modify
3 it under the terms of the GNU General Public License, version 2.0,
4 as published by the Free Software Foundation.
5
6 This program is designed to work with certain software (including
7 but not limited to OpenSSL) that is licensed under separate terms,
8 as designated in a particular file or component or in included license
9 documentation. The authors of MySQL hereby grant you an additional
10 permission to link the program and your derivative works with the
11 separately licensed software that they have either included with
12 the program or referenced in the documentation.
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#ifndef DD_RESOURCE_GROUP_INCLUDED
24#define DD_RESOURCE_GROUP_INCLUDED
25
26#include "sql/dd/string_type.h" // dd::String_type
27
28class THD;
29namespace resourcegroups {
30class Resource_group;
31}
32namespace dd {
33namespace cache {
34class Dictionary_client;
35}
36
37/**
38 Check if resource group exists in the data dictionary.
39
40 @param dd_client Dictionary client.
41 @param resource_group_name Name of the resource group.
42 @param [out] exists Value set to true if DD object found
43 else false.
44 @retval true Failure (error has been reported).
45 @retval false Success.
46*/
47
49 const String_type &resource_group_name,
50 bool *exists);
51
52/**
53 Create a DD object and persist it to DD table resourcegroup.
54
55 @param thd Thread handle.
56 @param res_grp_ref Reference to resource group.
57
58 @retval true Resource group creation failed.
59 @retval false Resource group creation succeeded.
60*/
61
63 const resourcegroups::Resource_group &res_grp_ref);
64
65/**
66 Update a resource group and persist it to DD table resourcegroup.
67
68 @param thd Thread handle
69 @param resource_grp_name Name of the resource group.
70 @param res_grp_ref Reference to resource group.
71
72 @retval true Updating Resource group failed.
73 @retval false Updating Resource group succeeded.
74*/
75
76bool update_resource_group(THD *thd, const String_type &resource_grp_name,
77 const resourcegroups::Resource_group &res_grp_ref);
78
79/**
80 Drop a resource group from DD table resourcegroup.
81
82 @param thd Thread handle.
83 @param resource_grp_name Name of resource group to be dropped.
84
85 @retval true if resource group drop failed.
86 @retval false if resource group drop succeeded.
87*/
88
89bool drop_resource_group(THD *thd, const String_type resource_grp_name);
90} // namespace dd
91#endif // DD_RESOURCE_GROUP_INCLUDED
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: dictionary_client.h:149
Class that represents an abstraction of the Resource Group.
Definition: resource_group.h:44
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
bool update_resource_group(THD *thd, const String_type &resource_grp_name, const resourcegroups::Resource_group &res_grp_ref)
Update a resource group and persist it to DD table resourcegroup.
Definition: dd_resource_group.cc:114
bool drop_resource_group(THD *thd, const String_type resource_grp_name)
Drop a resource group from DD table resourcegroup.
Definition: dd_resource_group.cc:145
bool create_resource_group(THD *thd, const resourcegroups::Resource_group &res_grp_ref)
Create a DD object and persist it to DD table resourcegroup.
Definition: dd_resource_group.cc:74
bool resource_group_exists(dd::cache::Dictionary_client *dd_client, const String_type &resource_group_name, bool *exists)
Check if resource group exists in the data dictionary.
Definition: dd_resource_group.cc:39
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
Definition: dd_resource_group.h:29
static int exists(node_address *name, node_list const *nodes, u_int with_uid)
Definition: node_list.cc:106