MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AtrtClient.hpp
1 /*
2  Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef ATRT_CLIENT_HPP
20 #define ATRT_CLIENT_HPP
21 
22 #include <DbUtil.hpp>
23 
24 class AtrtClient: public DbUtil {
25 public:
26 
27  enum AtrtCommandType {
28  ATCT_CHANGE_VERSION= 1,
29  ATCT_RESET_PROC= 2
30  };
31 
32  AtrtClient(const char* _suffix= ".1.atrt");
33  AtrtClient(MYSQL*);
34  ~AtrtClient();
35 
36 
37  // Command functions
38  bool changeVersion(int process_id, const char* process_args);
39  bool resetProc(int process_id);
40 
41  // Query functions
42  bool getConnectString(int cluster_id, SqlResultSet& result);
43  bool getClusters(SqlResultSet& result);
44  bool getMgmds(int cluster_id, SqlResultSet& result);
45  bool getNdbds(int cluster_id, SqlResultSet& result);
46  int getOwnProcessId();
47 
48 private:
49  int writeCommand(AtrtCommandType _type,
50  const Properties& args);
51  bool readCommand(uint command_id,
52  SqlResultSet& result);
53 
54  bool doCommand(AtrtCommandType _type,
55  const Properties& args);
56 };
57 
58 #endif