Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7a502eba
Commit
7a502eba
authored
Dec 17, 2004
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed more duplicated commands for management server
parent
5712bc55
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
408 deletions
+7
-408
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+0
-38
ndb/src/mgmsrv/CommandInterpreter.cpp
ndb/src/mgmsrv/CommandInterpreter.cpp
+7
-293
ndb/src/mgmsrv/CommandInterpreter.hpp
ndb/src/mgmsrv/CommandInterpreter.hpp
+0
-77
No files found.
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
7a502eba
...
...
@@ -110,7 +110,6 @@ public:
void
executeRestart
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLogLevel
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeError
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeTrace
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLog
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLogIn
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLogOut
(
int
processId
,
const
char
*
parameters
,
bool
all
);
...
...
@@ -729,7 +728,6 @@ static const CommandInterpreter::CommandFunctionPair commands[] = {
#ifdef ERROR_INSERT
,{
"ERROR"
,
&
CommandInterpreter
::
executeError
}
#endif
,{
"TRACE"
,
&
CommandInterpreter
::
executeTrace
}
,{
"LOG"
,
&
CommandInterpreter
::
executeLog
}
,{
"LOGIN"
,
&
CommandInterpreter
::
executeLogIn
}
,{
"LOGOUT"
,
&
CommandInterpreter
::
executeLogOut
}
...
...
@@ -1676,42 +1674,6 @@ void CommandInterpreter::executeError(int processId,
ndb_mgm_insert_error
(
m_mgmsrv
,
processId
,
errorNo
,
NULL
);
}
//*****************************************************************************
//*****************************************************************************
void
CommandInterpreter
::
executeTrace
(
int
/*processId*/
,
const
char
*
/*parameters*/
,
bool
/*all*/
)
{
#if 0
if (emptyString(parameters)) {
ndbout << "Missing trace number." << endl;
return;
}
char* newpar = my_strdup(parameters,MYF(MY_WME));
My_auto_ptr<char> ap1(newpar);
char* firstParameter = strtok(newpar, " ");
int traceNo;
if (! convert(firstParameter, traceNo)) {
ndbout << "Expected an integer." << endl;
return;
}
char* allAfterFirstParameter = strtok(NULL, "\0");
if (! emptyString(allAfterFirstParameter)) {
ndbout << "Nothing expected after trace number." << endl;
return;
}
int result = _mgmtSrvr.setTraceNo(processId, traceNo);
if (result != 0) {
ndbout << get_error_text(result) << endl;
}
#endif
}
//*****************************************************************************
//*****************************************************************************
...
...
ndb/src/mgmsrv/CommandInterpreter.cpp
View file @
7a502eba
This diff is collapsed.
Click to expand it.
ndb/src/mgmsrv/CommandInterpreter.hpp
View file @
7a502eba
...
...
@@ -17,52 +17,21 @@
#ifndef CommandInterpreter_H
#define CommandInterpreter_H
//*****************************************************************************
// Author: Peter Lind
//*****************************************************************************
#include <ndb_global.h>
#include <Vector.hpp>
#include <BaseString.hpp>
class
MgmtSrvr
;
/**
* @class CommandInterpreter
* @brief Reads command line in management client
*
* This class has one public method which reads a command line
* from a stream. It then interpret that commmand line and calls a suitable
* method in the MgmtSrvr class which executes the command.
*
* For command syntax, see the HELP command.
*/
class
CommandInterpreter
{
public:
/**
* Constructor
* @param mgmtSrvr: Management server to use when executing commands
*/
CommandInterpreter
(
MgmtSrvr
&
mgmtSrvr
);
/**
* Reads one line from the stream, parse the line to find
* a command and then calls a suitable method which executes
* the command.
*
* @return true until quit/bye/exit has been typed
*/
int
readAndExecute
();
private:
char
m_err_str
[
1024
];
const
char
*
get_error_text
(
int
err_no
);
/**
* Read a string, and return a pointer to it.
*
* @return NULL on EOF.
*/
char
*
readline_gets
()
{
static
char
linebuffer
[
254
];
...
...
@@ -89,61 +58,15 @@ private:
return
(
line_read
);
}
/**
* Analyse the command line, after the first token.
*
* @param processId: DB process id to send command to or -1 if
* command will be sent to all DB processes.
* @param allAfterFirstToken: What the client gave after the
* first token on the command line
*/
void
analyseAfterFirstToken
(
int
processId
,
char
*
allAfterFirstTokenCstr
);
/**
* Parse the block specification part of the LOG* commands,
* things after LOG*: [BLOCK = {ALL|<blockName>+}]
*
* @param allAfterLog: What the client gave after the second token
* (LOG*) on the command line
* @param blocks, OUT: ALL or name of all the blocks
* @return: true if correct syntax, otherwise false
*/
bool
parseBlockSpecification
(
const
char
*
allAfterLog
,
Vector
<
BaseString
>&
blocks
);
/**
* A bunch of execute functions: Executes one of the commands
*
* @param processId: DB process id to send command to
* @param parameters: What the client gave after the command name
* on the command line.
* For example if complete input from user is: "1 LOGLEVEL 22" then the
* parameters argument is the string with everything after LOGLEVEL, in this
* case "22". Each function is responsible to check the parameters argument.
*/
void
executeHelp
(
char
*
parameters
);
void
executeShow
(
char
*
parameters
);
void
executeRun
(
char
*
parameters
);
void
executeInfo
(
char
*
parameters
);
public:
void
executeStop
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeStart
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeRestart
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeError
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeTrace
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLog
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLogIn
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLogOut
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeLogOff
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeTestOn
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeTestOff
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeStatus
(
int
processId
,
const
char
*
parameters
,
bool
all
);
void
executeDumpState
(
int
processId
,
const
char
*
parameters
,
bool
all
);
/**
* A execute function definition
*/
public:
typedef
void
(
CommandInterpreter
::*
ExecuteFunction
)(
int
processId
,
const
char
*
param
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment