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
6bb927b0
Commit
6bb927b0
authored
Nov 20, 2007
by
Yoni Fogel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB_ENV->set_lg_dir functionality added.
git-svn-id:
file:///svn/tokudb@684
c7de825b-a66e-492c-adef-691d508d4ae1
parent
ad5233e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
src/ydb.c
src/ydb.c
+19
-8
No files found.
src/ydb.c
View file @
6bb927b0
...
@@ -66,6 +66,7 @@ struct __toku_db_env_internal {
...
@@ -66,6 +66,7 @@ struct __toku_db_env_internal {
char
*
errpfx
;
char
*
errpfx
;
char
*
dir
;
/* A malloc'd copy of the directory. */
char
*
dir
;
/* A malloc'd copy of the directory. */
char
*
tmp_dir
;
char
*
tmp_dir
;
char
*
lg_dir
;
char
*
data_dir
;
char
*
data_dir
;
//void (*noticecall)(DB_ENV *, db_notices);
//void (*noticecall)(DB_ENV *, db_notices);
long
cachetable_size
;
long
cachetable_size
;
...
@@ -141,7 +142,7 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
...
@@ -141,7 +142,7 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
BOOL
eof
=
FALSE
;
BOOL
eof
=
FALSE
;
char
*
temp
;
char
*
temp
;
char
*
end
;
char
*
end
;
int
index
=
0
;
int
index
;
buffersize
=
1
<<
10
;
//1KB
buffersize
=
1
<<
10
;
//1KB
linebuffer
=
toku_malloc
(
buffersize
);
linebuffer
=
toku_malloc
(
buffersize
);
...
@@ -149,9 +150,9 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
...
@@ -149,9 +150,9 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
r
=
ENOMEM
;
r
=
ENOMEM
;
goto
cleanup
;
goto
cleanup
;
}
}
for
(
linenumber
=
0
;
!
eof
;
linenumber
++
)
{
for
(
linenumber
=
1
;
!
eof
;
linenumber
++
)
{
/* Read a single line. */
/* Read a single line. */
while
(
TRUE
)
{
for
(
index
=
0
;
TRUE
;
index
++
)
{
if
((
ch
=
getc
(
fp
))
==
EOF
)
{
if
((
ch
=
getc
(
fp
))
==
EOF
)
{
eof
=
TRUE
;
eof
=
TRUE
;
if
(
ferror
(
fp
))
{
if
(
ferror
(
fp
))
{
...
@@ -171,7 +172,7 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
...
@@ -171,7 +172,7 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
goto
cleanup
;
goto
cleanup
;
}
}
}
}
linebuffer
[
index
++
]
=
ch
;
linebuffer
[
index
]
=
ch
;
}
}
linebuffer
[
index
]
=
'\0'
;
linebuffer
[
index
]
=
'\0'
;
end
=
&
linebuffer
[
index
];
end
=
&
linebuffer
[
index
];
...
@@ -186,7 +187,7 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
...
@@ -186,7 +187,7 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
*
temp
++
=
'\0'
;
//Null terminate command.
*
temp
++
=
'\0'
;
//Null terminate command.
value
=
temp
;
value
=
temp
;
//Strip leading spaces.
//Strip leading spaces.
while
(
!
isspace
(
*
value
)
&&
value
<
end
)
value
++
;
while
(
isspace
(
*
value
)
&&
value
<
end
)
value
++
;
if
(
value
<
end
)
{
if
(
value
<
end
)
{
//Strip trailing spaces.
//Strip trailing spaces.
temp
=
end
;
temp
=
end
;
...
@@ -195,7 +196,6 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
...
@@ -195,7 +196,6 @@ static int db_env_read_config(DB_ENV *env, u_int32_t flags) {
*
temp
=
'\0'
;
*
temp
=
'\0'
;
}
}
//Parse the line.
//Parse the line.
if
(
strlen
(
command
)
==
0
||
command
[
0
]
==
'#'
)
continue
;
//Ignore Comments.
if
(
strlen
(
command
)
==
0
||
command
[
0
]
==
'#'
)
continue
;
//Ignore Comments.
r
=
db_env_parse_config_line
(
env
,
command
,
value
<
end
?
value
:
""
);
r
=
db_env_parse_config_line
(
env
,
command
,
value
<
end
?
value
:
""
);
if
(
r
!=
0
)
goto
parseerror
;
if
(
r
!=
0
)
goto
parseerror
;
...
@@ -257,7 +257,11 @@ int __toku_db_env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode
...
@@ -257,7 +257,11 @@ int __toku_db_env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode
env
->
i
->
open_mode
=
mode
;
env
->
i
->
open_mode
=
mode
;
if
(
flags
&
(
DB_INIT_TXN
|
DB_INIT_LOG
))
{
if
(
flags
&
(
DB_INIT_TXN
|
DB_INIT_LOG
))
{
r
=
tokulogger_create_and_open_logger
(
env
->
i
->
dir
,
&
env
->
i
->
logger
);
char
*
full_dir
=
NULL
;
if
(
env
->
i
->
lg_dir
)
full_dir
=
construct_full_name
(
env
->
i
->
dir
,
env
->
i
->
lg_dir
);
r
=
tokulogger_create_and_open_logger
(
full_dir
?
full_dir
:
env
->
i
->
dir
,
&
env
->
i
->
logger
);
if
(
full_dir
)
toku_free
(
full_dir
);
if
(
r
!=
0
)
goto
died1
;
if
(
r
!=
0
)
goto
died1
;
if
(
0
)
{
if
(
0
)
{
died2:
died2:
...
@@ -280,6 +284,8 @@ int __toku_db_env_close(DB_ENV * env, u_int32_t flags) {
...
@@ -280,6 +284,8 @@ int __toku_db_env_close(DB_ENV * env, u_int32_t flags) {
r1
=
tokulogger_log_close
(
&
env
->
i
->
logger
);
r1
=
tokulogger_log_close
(
&
env
->
i
->
logger
);
if
(
env
->
i
->
data_dir
)
if
(
env
->
i
->
data_dir
)
toku_free
(
env
->
i
->
data_dir
);
toku_free
(
env
->
i
->
data_dir
);
if
(
env
->
i
->
lg_dir
)
toku_free
(
env
->
i
->
lg_dir
);
if
(
env
->
i
->
tmp_dir
)
if
(
env
->
i
->
tmp_dir
)
toku_free
(
env
->
i
->
tmp_dir
);
toku_free
(
env
->
i
->
tmp_dir
);
if
(
env
->
i
->
errpfx
)
if
(
env
->
i
->
errpfx
)
...
@@ -337,7 +343,12 @@ int __toku_db_env_set_lg_bsize(DB_ENV * env, u_int32_t bsize) {
...
@@ -337,7 +343,12 @@ int __toku_db_env_set_lg_bsize(DB_ENV * env, u_int32_t bsize) {
}
}
int
__toku_db_env_set_lg_dir
(
DB_ENV
*
env
,
const
char
*
dir
)
{
int
__toku_db_env_set_lg_dir
(
DB_ENV
*
env
,
const
char
*
dir
)
{
return
1
;
if
(
db_env_opened
(
env
))
return
EINVAL
;
if
(
env
->
i
->
lg_dir
)
toku_free
(
env
->
i
->
lg_dir
);
if
(
dir
)
env
->
i
->
lg_dir
=
toku_strdup
(
dir
);
else
env
->
i
->
lg_dir
=
NULL
;
return
0
;
}
}
int
__toku_db_env_set_lg_max
(
DB_ENV
*
env
,
u_int32_t
lg_max
)
{
int
__toku_db_env_set_lg_max
(
DB_ENV
*
env
,
u_int32_t
lg_max
)
{
...
...
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