MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ha_ndbcluster_connection.h
1 /*
2  Copyright (C) 2000-2003 MySQL AB
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 int ndbcluster_connect(int (*connect_callback)(void),
19  ulong wait_connected,
20  uint connection_pool_size,
21  bool optimized_node_select,
22  const char* connect_string, uint force_nodeid);
23 void ndbcluster_disconnect(void);
24 
25 Ndb_cluster_connection *ndb_get_cluster_connection();
26 ulonglong ndb_get_latest_trans_gci();
27 void ndb_set_latest_trans_gci(ulonglong val);
28 int ndb_has_node_id(uint id);
29 void ndb_get_connection_stats(Uint64* statsArr);
30 
31 /* perform random sleep in the range milli_sleep to 2*milli_sleep */
32 inline void do_retry_sleep(unsigned milli_sleep)
33 {
34  my_sleep(1000*(milli_sleep + 5*(rand()%(milli_sleep/5))));
35 }