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
e38381f2
Commit
e38381f2
authored
Jan 23, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backported from 5.0 extra option to ndb_waiter
parent
0b61a16f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
ndb/tools/waiter.cpp
ndb/tools/waiter.cpp
+21
-6
No files found.
ndb/tools/waiter.cpp
View file @
e38381f2
...
@@ -31,11 +31,13 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
...
@@ -31,11 +31,13 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status,
unsigned
int
_timeout
);
unsigned
int
_timeout
);
enum
ndb_waiter_options
{
enum
ndb_waiter_options
{
NDB_STD_OPTS_OPTIONS
NDB_STD_OPTS_OPTIONS
,
OPT_WAIT_STATUS_NOT_STARTED
};
};
NDB_STD_OPTS_VARS
;
NDB_STD_OPTS_VARS
;
static
int
_no_contact
=
0
;
static
int
_no_contact
=
0
;
static
int
_not_started
=
0
;
static
int
_timeout
=
120
;
static
int
_timeout
=
120
;
static
struct
my_option
my_long_options
[]
=
static
struct
my_option
my_long_options
[]
=
{
{
...
@@ -43,6 +45,9 @@ static struct my_option my_long_options[] =
...
@@ -43,6 +45,9 @@ static struct my_option my_long_options[] =
{
"no-contact"
,
'n'
,
"Wait for cluster no contact"
,
{
"no-contact"
,
'n'
,
"Wait for cluster no contact"
,
(
gptr
*
)
&
_no_contact
,
(
gptr
*
)
&
_no_contact
,
0
,
(
gptr
*
)
&
_no_contact
,
(
gptr
*
)
&
_no_contact
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"not-started"
,
OPT_WAIT_STATUS_NOT_STARTED
,
"Wait for cluster not started"
,
(
gptr
*
)
&
_not_started
,
(
gptr
*
)
&
_not_started
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"timeout"
,
't'
,
"Timeout to wait"
,
{
"timeout"
,
't'
,
"Timeout to wait"
,
(
gptr
*
)
&
_timeout
,
(
gptr
*
)
&
_timeout
,
0
,
(
gptr
*
)
&
_timeout
,
(
gptr
*
)
&
_timeout
,
0
,
GET_INT
,
REQUIRED_ARG
,
120
,
0
,
0
,
0
,
0
,
0
},
GET_INT
,
REQUIRED_ARG
,
120
,
0
,
0
,
0
,
0
,
0
},
...
@@ -91,12 +96,22 @@ int main(int argc, char** argv){
...
@@ -91,12 +96,22 @@ int main(int argc, char** argv){
if
(
_hostName
==
0
)
if
(
_hostName
==
0
)
_hostName
=
opt_connect_str
;
_hostName
=
opt_connect_str
;
if
(
_no_contact
)
{
enum
ndb_mgm_node_status
wait_status
;
if
(
waitClusterStatus
(
_hostName
,
NDB_MGM_NODE_STATUS_NO_CONTACT
,
_timeout
)
!=
0
)
if
(
_no_contact
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
{
}
else
if
(
waitClusterStatus
(
_hostName
,
NDB_MGM_NODE_STATUS_STARTED
,
_timeout
)
!=
0
)
wait_status
=
NDB_MGM_NODE_STATUS_NO_CONTACT
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
else
if
(
_not_started
)
{
wait_status
=
NDB_MGM_NODE_STATUS_NOT_STARTED
;
}
else
{
wait_status
=
NDB_MGM_NODE_STATUS_STARTED
;
}
if
(
waitClusterStatus
(
_hostName
,
wait_status
,
_timeout
)
!=
0
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_OK
);
return
NDBT_ProgramExit
(
NDBT_OK
);
}
}
...
...
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