MySQL  8.0.17
Source Code Documentation
dd_resource_group.h
Go to the documentation of this file.
1 /* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
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 also distributed 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 included with MySQL.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License, version 2.0, for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
21 
22 #ifndef DD_RESOURCE_GROUP_INCLUDED
23 #define DD_RESOURCE_GROUP_INCLUDED
24 
25 #include "sql/dd/string_type.h" // dd::String_type
26 
27 class THD;
28 namespace resourcegroups {
29 class Resource_group;
30 }
31 namespace dd {
32 namespace cache {
33 class Dictionary_client;
34 }
35 
36 /**
37  Check if resource group exists in the data dictionary.
38 
39  @param dd_client Dictionary client.
40  @param resource_group_name Name of the resource group.
41  @param [out] exists Value set to true if DD object found
42  else false.
43  @retval true Failure (error has been reported).
44  @retval false Success.
45 */
46 
48  const String_type &resource_group_name,
49  bool *exists);
50 
51 /**
52  Create a DD object and persist it to DD table resourcegroup.
53 
54  @param thd Thread handle.
55  @param res_grp_ref Reference to resource group.
56 
57  @retval true Resource group creation failed.
58  @retval false Resource group creation succeeded.
59 */
60 
61 bool create_resource_group(THD *thd,
62  const resourcegroups::Resource_group &res_grp_ref);
63 
64 /**
65  Update a resource group and persist it to DD table resourcegroup.
66 
67  @param thd Thread handle
68  @param resource_grp_name Name of the resource group.
69  @param res_grp_ref Reference to resource group.
70 
71  @retval true Updating Resource group failed.
72  @retval false Updating Resource group succeeded.
73 */
74 
75 bool update_resource_group(THD *thd, const String_type &resource_grp_name,
76  const resourcegroups::Resource_group &res_grp_ref);
77 
78 /**
79  Drop a resource group from DD table resourcegroup.
80 
81  @param thd Thread handle.
82  @param resource_grp_name Name of resource group to be dropped.
83 
84  @retval true if resource group drop failed.
85  @retval false if resource group drop succeeded.
86 */
87 
88 bool drop_resource_group(THD *thd, const String_type resource_grp_name);
89 } // namespace dd
90 #endif // DD_RESOURCE_GROUP_INCLUDED
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:38
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:73
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
Class that represents an abstraction of the Resource Group.
Definition: resource_group.h:43
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:144
Definition: dictionary_client.h:145
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:113
Definition: dd_resource_group.h:28
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:39
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:777