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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3c33df38
Commit
3c33df38
authored
Oct 27, 2004
by
petr@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more review fixes
parent
73aeeaf4
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
50 deletions
+41
-50
server-tools/instance-manager/command.cc
server-tools/instance-manager/command.cc
+2
-2
server-tools/instance-manager/commands.cc
server-tools/instance-manager/commands.cc
+9
-9
server-tools/instance-manager/commands.h
server-tools/instance-manager/commands.h
+6
-6
server-tools/instance-manager/guardian.cc
server-tools/instance-manager/guardian.cc
+1
-1
server-tools/instance-manager/instance_map.cc
server-tools/instance-manager/instance_map.cc
+7
-13
server-tools/instance-manager/instance_map.h
server-tools/instance-manager/instance_map.h
+16
-19
No files found.
server-tools/instance-manager/command.cc
View file @
3c33df38
...
...
@@ -21,8 +21,8 @@
#include "command.h"
Command
::
Command
(
Instance_map
*
imap_arg
)
:
instance_map
(
imap_arg
)
Command
::
Command
(
Instance_map
*
i
nstance_
map_arg
)
:
instance_map
(
i
nstance_
map_arg
)
{}
Command
::~
Command
()
...
...
server-tools/instance-manager/commands.cc
View file @
3c33df38
...
...
@@ -60,7 +60,7 @@ int Show_instances::do_command(struct st_net *net)
{
Instance
*
instance
;
I
map_i
terator
iterator
(
instance_map
);
I
nstance_map
::
I
terator
iterator
(
instance_map
);
instance_map
->
lock
();
while
(
instance
=
iterator
.
next
())
...
...
@@ -110,9 +110,9 @@ int Flush_instances::execute(struct st_net *net, ulong connection_id)
/* implementation for Show_instance_status: */
Show_instance_status
::
Show_instance_status
(
Instance_map
*
imap_arg
,
Show_instance_status
::
Show_instance_status
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
)
:
Command
(
imap_arg
)
:
Command
(
i
nstance_
map_arg
)
{
Instance
*
instance
;
...
...
@@ -212,9 +212,9 @@ int Show_instance_status::execute(struct st_net *net, ulong connection_id)
/* Implementation for Show_instance_options */
Show_instance_options
::
Show_instance_options
(
Instance_map
*
imap_arg
,
Show_instance_options
::
Show_instance_options
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
)
:
Command
(
imap_arg
)
Command
(
i
nstance_
map_arg
)
{
Instance
*
instance
;
...
...
@@ -333,9 +333,9 @@ int Show_instance_options::execute(struct st_net *net, ulong connection_id)
/* Implementation for Start_instance */
Start_instance
::
Start_instance
(
Instance_map
*
imap_arg
,
Start_instance
::
Start_instance
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
)
:
Command
(
imap_arg
)
:
Command
(
i
nstance_
map_arg
)
{
/* we make a search here, since we don't want t store the name */
if
(
instance
=
instance_map
->
find
(
name
,
len
))
...
...
@@ -366,9 +366,9 @@ int Start_instance::execute(struct st_net *net, ulong connection_id)
/* Implementation for Stop_instance: */
Stop_instance
::
Stop_instance
(
Instance_map
*
imap_arg
,
Stop_instance
::
Stop_instance
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
)
:
Command
(
imap_arg
)
:
Command
(
i
nstance_
map_arg
)
{
/* we make a search here, since we don't want t store the name */
if
(
instance
=
instance_map
->
find
(
name
,
len
))
...
...
server-tools/instance-manager/commands.h
View file @
3c33df38
...
...
@@ -27,7 +27,7 @@
class
Show_instances
:
public
Command
{
public:
Show_instances
(
Instance_map
*
i
map_arg
)
:
Command
(
i
map_arg
)
Show_instances
(
Instance_map
*
i
nstance_map_arg
)
:
Command
(
instance_
map_arg
)
{}
int
do_command
(
struct
st_net
*
net
);
...
...
@@ -43,7 +43,7 @@ class Show_instances : public Command
class
Flush_instances
:
public
Command
{
public:
Flush_instances
(
Instance_map
*
i
map_arg
)
:
Command
(
i
map_arg
)
Flush_instances
(
Instance_map
*
i
nstance_map_arg
)
:
Command
(
instance_
map_arg
)
{}
int
execute
(
struct
st_net
*
net
,
ulong
connection_id
);
...
...
@@ -59,7 +59,7 @@ class Show_instance_status : public Command
{
public:
Show_instance_status
(
Instance_map
*
imap_arg
,
const
char
*
name
,
uint
len
);
Show_instance_status
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
);
int
do_command
(
struct
st_net
*
net
,
const
char
*
instance_name
);
int
execute
(
struct
st_net
*
net
,
ulong
connection_id
);
const
char
*
instance_name
;
...
...
@@ -75,7 +75,7 @@ class Show_instance_options : public Command
{
public:
Show_instance_options
(
Instance_map
*
imap_arg
,
const
char
*
name
,
uint
len
);
Show_instance_options
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
);
int
execute
(
struct
st_net
*
net
,
ulong
connection_id
);
int
do_command
(
struct
st_net
*
net
,
const
char
*
instance_name
);
...
...
@@ -91,7 +91,7 @@ class Show_instance_options : public Command
class
Start_instance
:
public
Command
{
public:
Start_instance
(
Instance_map
*
imap_arg
,
const
char
*
name
,
uint
len
);
Start_instance
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
);
int
execute
(
struct
st_net
*
net
,
ulong
connection_id
);
const
char
*
instance_name
;
...
...
@@ -107,7 +107,7 @@ class Start_instance : public Command
class
Stop_instance
:
public
Command
{
public:
Stop_instance
(
Instance_map
*
imap_arg
,
const
char
*
name
,
uint
len
);
Stop_instance
(
Instance_map
*
i
nstance_
map_arg
,
const
char
*
name
,
uint
len
);
Instance
*
instance
;
int
execute
(
struct
st_net
*
net
,
ulong
connection_id
);
...
...
server-tools/instance-manager/guardian.cc
View file @
3c33df38
...
...
@@ -107,7 +107,7 @@ void Guardian_thread::run()
int
Guardian_thread
::
start
()
{
Instance
*
instance
;
I
map_i
terator
iterator
(
instance_map
);
I
nstance_map
::
I
terator
iterator
(
instance_map
);
instance_map
->
lock
();
while
(
instance
=
iterator
.
next
())
...
...
server-tools/instance-manager/instance_map.cc
View file @
3c33df38
...
...
@@ -226,26 +226,20 @@ int Instance_map::load()
}
Instance
*
Instance_map
::
get_instance
(
uint
instance_number
)
{
if
(
instance_number
<
hash
.
records
)
return
(
Instance
*
)
hash_element
(
&
hash
,
instance_number
);
else
return
NULL
;
}
/*--- Implementaton of the Instance map iterator class ---*/
/*--- Implementaton of the Instance map iterator class (Imap_iterator) ---*/
void
Imap_iterator
::
go_to_first
()
void
Instance_map
::
Iterator
::
go_to_first
()
{
current_instance
=
0
;
}
Instance
*
I
map_i
terator
::
next
()
Instance
*
I
nstance_map
::
I
terator
::
next
()
{
return
instance_map
->
get_instance
(
current_instance
++
);
if
(
current_instance
<
instance_map
->
hash
.
records
)
return
(
Instance
*
)
hash_element
(
&
instance_map
->
hash
,
current_instance
++
);
else
return
NULL
;
}
server-tools/instance-manager/instance_map.h
View file @
3c33df38
...
...
@@ -38,6 +38,22 @@ extern void free_groups(char **groups);
class
Instance_map
{
friend
class
Iterator
;
public:
/* Instance_map iterator */
class
Iterator
{
private:
uint
current_instance
;
Instance_map
*
instance_map
;
public:
Iterator
(
Instance_map
*
instance_map_arg
)
:
instance_map
(
instance_map_arg
),
current_instance
(
0
)
{}
void
go_to_first
();
Instance
*
next
();
};
public:
/* returns a pointer to the instance or NULL, if there is no such instance */
Instance
*
find
(
const
char
*
name
,
uint
name_len
);
...
...
@@ -47,7 +63,6 @@ class Instance_map
int
cleanup
();
int
lock
();
int
unlock
();
Instance
*
get_instance
(
uint
instance_number
);
Instance_map
();
~
Instance_map
();
...
...
@@ -72,22 +87,4 @@ class Instance_map
HASH
hash
;
};
/* Instance_map iterator */
class
Imap_iterator
{
private:
uint
current_instance
;
Instance_map
*
instance_map
;
public:
Imap_iterator
(
Instance_map
*
instance_map_arg
)
:
instance_map
(
instance_map_arg
),
current_instance
(
0
)
{}
void
go_to_first
();
Instance
*
next
();
};
#endif
/* INCLUDES_MYSQL_INSTANCE_MANAGER_INSTANCE_MAP_H */
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