My Project
|
00001 /* 00002 Copyright (C) 2000-2003 MySQL AB 00003 All rights reserved. Use is subject to license terms. 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; version 2 of the License. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00017 */ 00018 int ndbcluster_connect(int (*connect_callback)(void), 00019 ulong wait_connected, 00020 uint connection_pool_size, 00021 bool optimized_node_select, 00022 const char* connect_string, uint force_nodeid); 00023 void ndbcluster_disconnect(void); 00024 00025 Ndb_cluster_connection *ndb_get_cluster_connection(); 00026 ulonglong ndb_get_latest_trans_gci(); 00027 void ndb_set_latest_trans_gci(ulonglong val); 00028 int ndb_has_node_id(uint id); 00029 void ndb_get_connection_stats(Uint64* statsArr); 00030 00031 /* perform random sleep in the range milli_sleep to 2*milli_sleep */ 00032 inline void do_retry_sleep(unsigned milli_sleep) 00033 { 00034 my_sleep(1000*(milli_sleep + 5*(rand()%(milli_sleep/5)))); 00035 }