mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
added ndb_init.h to distribution
added missing copyright text moved ndb_init things to separate header file removed ndb_global include documented cluster connection class moved internal constants to NdbImpl.hpp class changed wait_until_ready behaviour somewhat ndb/config/type_ndbapitest.mk.am: corrected -I flag ndb/include/Makefile.am: added ndb_init.h to distribution ndb/include/ndb_global.h.in: added copyright text moved ndb_init things to separate header file ndb/include/ndbapi/NdbBlob.hpp: moved error codes and internal constants to NdbBlobImpl.hpp ndb/include/ndbapi/NdbReceiver.hpp: removed ndb_global include ndb/include/ndbapi/ndb_cluster_connection.hpp: documented cluster connection class changed wait_until_ready behaviour somewhat ndb/src/ndbapi/Ndb.cpp: documented cluster connection class changed wait_until_ready behaviour somewhat ndb/src/ndbapi/NdbBlob.cpp: moved internal constants to NdbImpl.hpp class ndb/src/ndbapi/NdbDictionaryImpl.cpp: moved internal constants to NdbImpl.hpp class ndb/src/ndbapi/NdbOperationInt.cpp: changed includes ndb/src/ndbapi/ndb_cluster_connection.cpp: changed wait_until_ready behaviour somewhat ndb/test/ndbapi/testBlobs.cpp: use impl class to get constants
This commit is contained in:
@ -18,28 +18,72 @@
|
||||
#ifndef CLUSTER_CONNECTION_HPP
|
||||
#define CLUSTER_CONNECTION_HPP
|
||||
|
||||
struct Ndb_cluster_connection_node_iter;
|
||||
|
||||
/**
|
||||
* @class Ndb_cluster_connection
|
||||
* @brief Represents a connection to a cluster of storage nodes
|
||||
*
|
||||
* Always start your application program by creating a
|
||||
* Ndb_cluster_connection object. Your application should contain
|
||||
* only one Ndb_cluster_connection. Your application connects to
|
||||
* a cluster management server when method connect() is called.
|
||||
* With the method wait_until_ready() it is possible to wait
|
||||
* for the connection to one or several storage nodes.
|
||||
*/
|
||||
class Ndb_cluster_connection {
|
||||
public:
|
||||
/**
|
||||
* Create a connection to a cluster of storage nodes
|
||||
*
|
||||
* @param specify the connectstring for where to find the
|
||||
* management server
|
||||
*/
|
||||
Ndb_cluster_connection(const char * connect_string = 0);
|
||||
~Ndb_cluster_connection();
|
||||
int connect(int no_retries, int retry_delay_in_seconds, int verbose);
|
||||
int start_connect_thread(int (*connect_callback)(void)= 0);
|
||||
|
||||
// add check coupled to init state of cluster connection
|
||||
// timeout_after_first_alive negative - ok only if all alive
|
||||
// timeout_after_first_alive positive - ok if some alive
|
||||
/**
|
||||
* Connect to a cluster management server
|
||||
*
|
||||
* @param no_retries specifies the number of retries to perform
|
||||
* if the connect fails, negative number results in infinite
|
||||
* number of retries
|
||||
* @param retry_delay_in_seconds specifies how often retries should
|
||||
* be performed
|
||||
* @param verbose specifies if the method should print progess
|
||||
*
|
||||
* @return 0 if success,
|
||||
* 1 if retriable error,
|
||||
* -1 if non-retriable error
|
||||
*/
|
||||
int connect(int no_retries=0, int retry_delay_in_seconds=1, int verbose=0);
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
int start_connect_thread(int (*connect_callback)(void)= 0);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Wait until one or several storage nodes are connected
|
||||
*
|
||||
* @param time_out_for_first_alive number of seconds to wait until
|
||||
* first alive node is detected
|
||||
* @param timeout_after_first_alive number of seconds to wait after
|
||||
* first alive node is detected
|
||||
*
|
||||
* @return 0 all nodes alive,
|
||||
* > 0 at least one node alive,
|
||||
* < 0 error
|
||||
*/
|
||||
int wait_until_ready(int timeout_for_first_alive,
|
||||
int timeout_after_first_alive);
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
|
||||
const char *get_connectstring(char *buf, int buf_sz) const;
|
||||
int get_connected_port() const;
|
||||
const char *get_connected_host() const;
|
||||
|
||||
void set_optimized_node_selection(int val);
|
||||
|
||||
Uint32 no_db_nodes();
|
||||
int no_db_nodes();
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend class Ndb;
|
||||
|
Reference in New Issue
Block a user