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
d7b8320f
Commit
d7b8320f
authored
Oct 14, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#87 add callback to allow loader memory size to be a session variable
parent
7c455cbf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
9 deletions
+19
-9
buildheader/make_tdb.cc
buildheader/make_tdb.cc
+1
-1
src/loader.cc
src/loader.cc
+3
-3
src/tests/env_loader_memory.cc
src/tests/env_loader_memory.cc
+8
-1
src/ydb-internal.h
src/ydb-internal.h
+1
-1
src/ydb.cc
src/ydb.cc
+6
-3
No files found.
buildheader/make_tdb.cc
View file @
d7b8320f
...
...
@@ -459,7 +459,7 @@ static void print_db_env_struct (void) {
"void (*change_fsync_log_period) (DB_ENV*, uint32_t)"
,
"int (*iterate_live_transactions) (DB_ENV *env, iterate_transactions_callback callback, void *extra)"
,
"int (*iterate_pending_lock_requests) (DB_ENV *env, iterate_requests_callback callback, void *extra)"
,
"void (*set_loader_memory_size)(DB_ENV *env, uint64_t
loader_memory_size
)"
,
"void (*set_loader_memory_size)(DB_ENV *env, uint64_t
(*get_loader_memory_size_callback)(void)
)"
,
"uint64_t (*get_loader_memory_size)(DB_ENV *env)"
,
NULL
};
...
...
src/loader.cc
View file @
d7b8320f
...
...
@@ -319,8 +319,8 @@ toku_loader_create_loader(DB_ENV *env,
}
TOKUTXN
ttxn
=
txn
?
db_txn_struct_i
(
txn
)
->
tokutxn
:
NULL
;
rval
=
toku_ft_loader_open
(
&
loader
->
i
->
ft_loader
,
loader
->
i
->
env
->
i
->
cachetable
,
loader
->
i
->
env
->
i
->
generate_row_for_put
,
env
->
i
->
cachetable
,
env
->
i
->
generate_row_for_put
,
src_db
,
N
,
brts
,
dbs
,
...
...
@@ -330,7 +330,7 @@ toku_loader_create_loader(DB_ENV *env,
load_lsn
,
ttxn
,
puts_allowed
,
loader
->
i
->
env
->
i
->
loader_memory_size
,
env
->
get_loader_memory_size
(
env
)
,
compress_intermediates
);
if
(
rval
!=
0
)
{
toku_free
(
new_inames_in_env
);
...
...
src/tests/env_loader_memory.cc
View file @
d7b8320f
...
...
@@ -91,14 +91,21 @@ PATENT RIGHTS GRANT:
#include "test.h"
#include <db.h>
static
uint64_t
my_loader_memory_size
;
static
uint64_t
get_loader_memory_size
(
void
)
{
return
my_loader_memory_size
;
}
int
test_main
(
int
argc
,
char
*
const
argv
[])
{
parse_args
(
argc
,
argv
);
int
r
;
DB_ENV
*
env
;
r
=
db_env_create
(
&
env
,
0
);
assert_zero
(
r
);
env
->
set_loader_memory_size
(
env
,
get_loader_memory_size
);
for
(
uint64_t
n
=
0
;
n
<
10000000000
;
n
+=
1000000000
)
{
env
->
set_loader_memory_size
(
env
,
n
)
;
my_loader_memory_size
=
n
;
assert
(
env
->
get_loader_memory_size
(
env
)
==
n
);
}
r
=
env
->
close
(
env
,
0
);
...
...
src/ydb-internal.h
View file @
d7b8320f
...
...
@@ -182,7 +182,7 @@ struct __toku_db_env_internal {
int
datadir_lockfd
;
int
logdir_lockfd
;
int
tmpdir_lockfd
;
uint64_t
loader_memory_size
;
uint64_t
(
*
get_loader_memory_size_callback
)(
void
)
;
};
// test-only environment function for running lock escalation
...
...
src/ydb.cc
View file @
d7b8320f
...
...
@@ -2416,12 +2416,15 @@ env_iterate_live_transactions(DB_ENV *env,
return
toku_txn_manager_iter_over_live_root_txns
(
txn_manager
,
iter_txns_callback
,
&
e
);
}
static
void
env_set_loader_memory_size
(
DB_ENV
*
env
,
uint64_t
loader_memory_size
)
{
env
->
i
->
loader_memory_size
=
loader_memory_size
;
static
void
env_set_loader_memory_size
(
DB_ENV
*
env
,
uint64_t
(
*
get_loader_memory_size_callback
)(
void
)
)
{
env
->
i
->
get_loader_memory_size_callback
=
get_loader_memory_size_callback
;
}
static
uint64_t
env_get_loader_memory_size
(
DB_ENV
*
env
)
{
return
env
->
i
->
loader_memory_size
;
uint64_t
memory_size
=
0
;
if
(
env
->
i
->
get_loader_memory_size_callback
)
memory_size
=
env
->
i
->
get_loader_memory_size_callback
();
return
memory_size
;
}
static
int
...
...
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