summaryrefslogtreecommitdiff
path: root/ndb/include/util
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-12-31 06:36:32 +0100
committerunknown <joreland@mysql.com>2004-12-31 06:36:32 +0100
commit5098405248ef944f5ef61052a9ea3baa5885a571 (patch)
treea1d6407a6626529b28b62eaf78d244fe41fa644f /ndb/include/util
parentaf2a68488bd28479b929c8825af80559b980cef1 (diff)
parent5df5f5c174299fc76e65e8273570f09090b41df5 (diff)
downloadmariadb-git-5098405248ef944f5ef61052a9ea3baa5885a571.tar.gz
merge
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
Diffstat (limited to 'ndb/include/util')
-rw-r--r--ndb/include/util/BaseString.hpp10
-rw-r--r--ndb/include/util/ndb_opts.h59
2 files changed, 43 insertions, 26 deletions
diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp
index 066a24f294e..02a6a3b3e66 100644
--- a/ndb/include/util/BaseString.hpp
+++ b/ndb/include/util/BaseString.hpp
@@ -48,10 +48,10 @@ public:
bool empty() const;
/** @brief Convert to uppercase */
- void ndb_toupper();
+ BaseString& ndb_toupper();
/** @brief Convert to lowercase */
- void ndb_tolower();
+ BaseString& ndb_tolower();
/** @brief Assigns from a char * */
BaseString& assign(const char* s);
@@ -206,16 +206,18 @@ BaseString::empty() const
return m_len == 0;
}
-inline void
+inline BaseString&
BaseString::ndb_toupper() {
for(unsigned i = 0; i < length(); i++)
m_chr[i] = toupper(m_chr[i]);
+ return *this;
}
-inline void
+inline BaseString&
BaseString::ndb_tolower() {
for(unsigned i = 0; i < length(); i++)
m_chr[i] = tolower(m_chr[i]);
+ return *this;
}
inline bool
diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h
index f7ae3b5489e..4bac36f5e5e 100644
--- a/ndb/include/util/ndb_opts.h
+++ b/ndb/include/util/ndb_opts.h
@@ -17,47 +17,62 @@
#ifndef _NDB_OPTS_H
#define _NDB_OPTS_H
+#include <ndb_global.h>
#include <my_sys.h>
#include <my_getopt.h>
#include <mysql_version.h>
#include <ndb_version.h>
-#ifndef DBUG_OFF
-#define NDB_STD_OPTS(prog_name) \
- { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
- 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "usage", '?', "Display this help and exit.", \
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "help", '?', "Display this help and exit.", \
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "version", 'V', "Output version information and exit.", 0, 0, 0, \
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "ndb-connectstring", 'c', \
- "Set connect string for connecting to ndb_mgmd. " \
- "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
- "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
- { "connect-string", 'c', "same as --ndb-connectstring",\
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
+#define NDB_STD_OPTS_VARS \
+const char *opt_connect_str= 0;\
+my_bool opt_ndb_shm;\
+my_bool opt_ndb_optimized_node_selection
+
+#define NDB_STD_OPTS_OPTIONS \
+OPT_NDB_SHM= 256,\
+OPT_NDB_OPTIMIZED_NODE_SELECTION
+
+#define OPT_NDB_CONNECTSTRING 'c'
+
+#ifdef NDB_SHM_TRANSPORTER
+#define OPT_NDB_SHM_DEFAULT 1
#else
-#define NDB_STD_OPTS(prog_name) \
+#define OPT_NDB_SHM_DEFAULT 0
+#endif
+
+#define NDB_STD_OPTS_COMMON \
{ "usage", '?', "Display this help and exit.", \
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
{ "help", '?', "Display this help and exit.", \
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
{ "version", 'V', "Output version information and exit.", 0, 0, 0, \
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "ndb-connectstring", 'c', \
+ { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \
"Set connect string for connecting to ndb_mgmd. " \
"Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
"Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \
(gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
- { "connect-string", 'c', "same as --ndb-connectstring",\
+ { "ndb-shm", OPT_NDB_SHM,\
+ "Allow optimizing using shared memory connections when available",\
+ (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, 0,\
+ GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\
+ {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\
+ "Select nodes for transactions in a more optimal way",\
+ (gptr*) &opt_ndb_optimized_node_selection,\
+ (gptr*) &opt_ndb_optimized_node_selection, 0,\
+ GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\
+ { "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\
(gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
+
+#ifndef DBUG_OFF
+#define NDB_STD_OPTS(prog_name) \
+ { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
+ 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
+ NDB_STD_OPTS_COMMON
+#else
+#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON
#endif
#endif /*_NDB_OPTS_H */