mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
5098405248
BitKeeper/etc/logging_ok: auto-union ndb/docs/wl2077.txt: Auto merged ndb/include/Makefile.am: Auto merged ndb/include/ndbapi/NdbTransaction.hpp: Auto merged ndb/src/common/debugger/EventLogger.cpp: Auto merged ndb/src/common/debugger/signaldata/DictTabInfo.cpp: Auto merged ndb/src/common/logger/Logger.cpp: Auto merged ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged ndb/src/common/util/Makefile.am: Auto merged ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Auto merged ndb/src/kernel/blocks/dbacc/Makefile.am: Auto merged ndb/src/kernel/main.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Auto merged ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: Auto merged ndb/src/kernel/vm/Configuration.cpp: Auto merged ndb/src/kernel/vm/Configuration.hpp: Auto merged ndb/src/mgmapi/mgmapi.cpp: Auto merged ndb/src/mgmsrv/CommandInterpreter.cpp: Auto merged ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged ndb/src/mgmsrv/Services.cpp: Auto merged ndb/src/mgmsrv/Services.hpp: Auto merged ndb/src/mgmsrv/main.cpp: Auto merged ndb/src/ndbapi/NdbBlob.cpp: Auto merged ndb/src/ndbapi/NdbDictionary.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.hpp: Auto merged ndb/src/ndbapi/NdbOperationExec.cpp: Auto merged ndb/src/ndbapi/NdbReceiver.cpp: Auto merged ndb/src/ndbapi/NdbScanOperation.cpp: Auto merged ndb/src/ndbapi/NdbTransaction.cpp: Auto merged ndb/src/ndbapi/Ndbif.cpp: Auto merged ndb/src/ndbapi/Ndbinit.cpp: Auto merged ndb/src/ndbapi/Ndblist.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.hpp: Auto merged ndb/src/ndbapi/ndberror.c: Auto merged ndb/test/ndbapi/Makefile.am: Auto merged ndb/test/ndbapi/testDict.cpp: Auto merged ndb/test/ndbapi/testNdbApi.cpp: Auto merged ndb/test/src/NdbRestarter.cpp: Auto merged ndb/test/tools/Makefile.am: Auto merged ndb/tools/Makefile.am: Auto merged ndb/tools/delete_all.cpp: Auto merged ndb/tools/desc.cpp: Auto merged ndb/tools/select_all.cpp: Auto merged ndb/tools/select_count.cpp: Auto merged scripts/make_win_src_distribution.sh: Auto merged sql/ha_ndbcluster.h: Auto merged
96 lines
3.1 KiB
C++
96 lines
3.1 KiB
C++
/* Copyright (C) 2003 MySQL AB
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
#ifndef CLUSTER_CONNECTION_HPP
|
|
#define CLUSTER_CONNECTION_HPP
|
|
|
|
/**
|
|
* @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();
|
|
|
|
/**
|
|
* 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);
|
|
|
|
unsigned no_db_nodes();
|
|
#endif
|
|
|
|
private:
|
|
friend class Ndb;
|
|
friend class NdbImpl;
|
|
friend class Ndb_cluster_connection_impl;
|
|
class Ndb_cluster_connection_impl & m_impl;
|
|
Ndb_cluster_connection(Ndb_cluster_connection_impl&);
|
|
};
|
|
|
|
#endif
|