diff options
author | unknown <stewart@mysql.com> | 2004-12-20 12:24:40 +1100 |
---|---|---|
committer | unknown <stewart@mysql.com> | 2004-12-20 12:24:40 +1100 |
commit | 87c85d6f34e9aa58c81bb730a61ffcd8319b1ad4 (patch) | |
tree | f5c523f0019f8b2e0a57505bbe477a1c082e8cd8 /ndb/src/mgmapi | |
parent | 9035f5cf79415335f83336fd623c09db58320618 (diff) | |
download | mariadb-git-87c85d6f34e9aa58c81bb730a61ffcd8319b1ad4.tar.gz |
Part 1 of impl2 of WL2278 (Dynamic port allocation of cluster nodes).
Implementation of "get connection parameter" mgmd call for getting from mgmd what port to use for a connection between two nodes.
(The actual use of this function is not yet implemented)
ndb/include/mgmapi/mgmapi_debug.h:
Add ndb_mgm_get_connection_int_parameter() prototype
ndb/src/mgmapi/mgmapi.cpp:
Add ndb_mgm_get_connection_int_parameter() implementation
ndb/src/mgmsrv/MgmtSrvr.cpp:
Add implementation of MgmtSrvr::getConnectionDbParameter()
ndb/src/mgmsrv/MgmtSrvr.hpp:
Add prototype for get_connectionDbParemeter
ndb/src/mgmsrv/Services.cpp:
Add "get connection parameter" mgmd command (for over the wire)
add getConnectionParameter handler for it
ndb/src/mgmsrv/Services.hpp:
Add prototype for getConnectionParameter
Diffstat (limited to 'ndb/src/mgmapi')
-rw-r--r-- | ndb/src/mgmapi/mgmapi.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 9206b3e0a58..13176fd9273 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -2020,5 +2020,49 @@ ndb_mgm_set_connection_int_parameter(NdbMgmHandle handle, return res; } +extern "C" +int +ndb_mgm_get_connection_int_parameter(NdbMgmHandle handle, + int node1, + int node2, + int param, + unsigned *value, + struct ndb_mgm_reply* mgmreply){ + DBUG_ENTER("ndb_mgm_get_connection_int_parameter"); + CHECK_HANDLE(handle, -1); + CHECK_CONNECTED(handle, -1); + + Properties args; + args.put("node1", node1); + args.put("node2", node2); + args.put("param", param); + + const ParserRow<ParserDummy> reply[]= { + MGM_CMD("get connection parameter reply", NULL, ""), + MGM_ARG("result", String, Mandatory, "Error message"), + MGM_ARG("value", Int, Mandatory, "Current Value"), + MGM_END() + }; + + const Properties *prop; + prop= ndb_mgm_call(handle, reply, "get connection parameter", &args); + CHECK_REPLY(prop, -1); + + int res= -1; + do { + const char * buf; + if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ + ndbout_c("ERROR Message: %s\n", buf); + break; + } + res= 0; + } while(0); + + prop->get("value",value); + + delete prop; + return res; +} + template class Vector<const ParserRow<ParserDummy>*>; |