From bb5a2f280f41178cb132e6c0e9db205cbc4abc9f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 21:07:22 +1100 Subject: Use the mgm connection used for fetching configuration as a transporter. ndb/include/mgmapi/mgmapi.h: Add mgmapi call: ndb_mgm_get_mgmd_nodeid() - returns the node id that the handle is connected to. - returns 0 on error. ndb/include/transporter/TransporterRegistry.hpp: Add TransporterRegistry::connect_client(NdbMgmHandle h) - uses a connected NdbMgmHandle to connect to the mgm server as a client. - sets up a transporter connection - used to transform the initial mgm connection (used for fetching configuration) into a transporter connection Added connect_ndb_mgmd(NdbMgmHandle h) - turn the supplied mgm connection into a transporter connection - return the socket Improve comments on connect_ndb_mgmd(SocketClient) ndb/src/common/transporter/Transporter.cpp: Add Transporter::connect_client(NDB_SOCKET_TYPE) - use an existing socket to make a transporter connection ndb/src/common/transporter/Transporter.hpp: Add connect_client(NDB_SOCKET_TYPE) ndb/src/common/transporter/TransporterRegistry.cpp: Add TransporterRegistry::connect_client(NdbMgmHandle) - use an existing mgm connection to connect a transporter - used to change the mgm connection used for fetching configuration into a transporter Add connect_ndb_mgmd(NdbMgmHandle) - use existing NdbMgmHandle - convert to transporter - return socket ndb/src/kernel/vm/Configuration.cpp: After fetching configuration, use the mgm connection as a transporter. Fail fatally if this fails. ndb/src/mgmapi/mgmapi.cpp: Add ndb_mgm_get_mgmd_nodeid(h) - returns the node id of the mgm server you're connected to. ndb/src/mgmsrv/Services.cpp: Add "get mgmd nodeid" mgmd call returns 'nodeid' - the node id of the mgm server your connected to ndb/src/mgmsrv/Services.hpp: add prototype for get_mgmd_nodeid --- ndb/include/transporter/TransporterRegistry.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ndb/include/transporter/TransporterRegistry.hpp') diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index a31fa1d5ce2..f69cd058c65 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -116,11 +116,20 @@ public: */ bool connect_server(NDB_SOCKET_TYPE sockfd); + int TransporterRegistry::connect_client(NdbMgmHandle h); + /** - * use a mgmd connection to connect as a transporter + * Given a SocketClient, creates a NdbMgmHandle, turns it into a transporter + * and returns the socket. */ NDB_SOCKET_TYPE connect_ndb_mgmd(SocketClient *sc); + /** + * Given a connected NdbMgmHandle, turns it into a transporter + * and returns the socket. + */ + NDB_SOCKET_TYPE connect_ndb_mgmd(NdbMgmHandle h); + /** * Remove all transporters */ -- cgit v1.2.1