1 /* Copyright (c) 2003-2007 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
17 #ifndef CLUSTER_CONNECTION_IMPL_HPP
18 #define CLUSTER_CONNECTION_IMPL_HPP
20 #include <ndb_cluster_connection.hpp>
24 extern NdbMutex
*g_ndb_connection_mutex
;
26 class TransporterFacade
;
27 class ConfigRetriever
;
29 class ndb_mgm_configuration
;
32 void* run_ndb_cluster_connection_connect_thread(void*);
35 class Ndb_cluster_connection_impl
: public Ndb_cluster_connection
37 Ndb_cluster_connection_impl(const char *connectstring
);
38 ~Ndb_cluster_connection_impl();
42 void init_get_next_node(Ndb_cluster_connection_node_iter
&iter
);
43 Uint32
get_next_node(Ndb_cluster_connection_node_iter
&iter
);
45 inline unsigned get_connect_count() const;
47 inline Uint64
*get_latest_trans_gci() { return &m_latest_trans_gci
; }
52 friend void* run_ndb_cluster_connection_connect_thread(void*);
53 friend class Ndb_cluster_connection
;
54 friend class NdbEventBuffer
;
58 Node(Uint32 _g
= 0, Uint32 _id
= 0) : this_group(0),
68 Vector
<Node
> m_all_nodes
;
69 int init_nodes_vector(Uint32 nodeid
, const ndb_mgm_configuration
&config
);
70 void connect_thread();
71 void set_name(const char *name
);
73 TransporterFacade
*m_transporter_facade
;
74 ConfigRetriever
*m_config_retriever
;
75 NdbThread
*m_connect_thread
;
76 int (*m_connect_callback
)(void);
78 int m_optimized_node_selection
;
80 int m_run_connect_thread
;
81 NdbMutex
*m_event_add_drop_mutex
;
82 Uint64 m_latest_trans_gci
;