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
05b84405
Commit
05b84405
authored
Jan 22, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #156 Add a parameter for the nonleaf partial eviction strategy
parent
3bc76c74
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
13 deletions
+43
-13
buildheader/make_tdb.cc
buildheader/make_tdb.cc
+1
-0
ft/ft-ops.cc
ft/ft-ops.cc
+34
-13
ft/ft-ops.h
ft/ft-ops.h
+3
-0
src/export.map
src/export.map
+1
-0
src/ydb_env_func.cc
src/ydb_env_func.cc
+4
-0
No files found.
buildheader/make_tdb.cc
View file @
05b84405
...
...
@@ -828,6 +828,7 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
printf
(
"int toku_set_trace_file (const char *fname) %s;
\n
"
,
VISIBLE
);
printf
(
"int toku_close_trace_file (void) %s;
\n
"
,
VISIBLE
);
printf
(
"void db_env_set_direct_io (bool direct_io_on) %s;
\n
"
,
VISIBLE
);
printf
(
"void db_env_set_compress_buffers_before_eviction (bool compress_buffers) %s;
\n
"
,
VISIBLE
);
printf
(
"void db_env_set_func_fsync (int (*)(int)) %s;
\n
"
,
VISIBLE
);
printf
(
"void db_env_set_func_free (void (*)(void*)) %s;
\n
"
,
VISIBLE
);
printf
(
"void db_env_set_func_malloc (void *(*)(size_t)) %s;
\n
"
,
VISIBLE
);
...
...
ft/ft-ops.cc
View file @
05b84405
...
...
@@ -979,6 +979,12 @@ int toku_ftnode_fetch_callback (CACHEFILE UU(cachefile), PAIR p, int fd, BLOCKNU
return
r
;
}
static
bool
ft_compress_buffers_before_eviction
=
true
;
void
toku_ft_set_compress_buffers_before_eviction
(
bool
compress_buffers
)
{
ft_compress_buffers_before_eviction
=
compress_buffers
;
}
void
toku_ftnode_pe_est_callback
(
void
*
ftnode_pv
,
void
*
disk_data
,
...
...
@@ -1010,16 +1016,20 @@ void toku_ftnode_pe_est_callback(
// we compress this node and add it to
// bytes_to_free
// first get an estimate for how much space will be taken
// after compression, it is simply the size of compressed
// data on disk plus the size of the struct that holds it
FTNODE_DISK_DATA
ndd
=
(
FTNODE_DISK_DATA
)
disk_data
;
uint32_t
compressed_data_size
=
BP_SIZE
(
ndd
,
i
);
compressed_data_size
+=
sizeof
(
struct
sub_block
);
// now get the space taken now
uint32_t
decompressed_data_size
=
get_avail_internal_node_partition_size
(
node
,
i
);
bytes_to_free
+=
(
decompressed_data_size
-
compressed_data_size
);
if
(
ft_compress_buffers_before_eviction
)
{
// first get an estimate for how much space will be taken
// after compression, it is simply the size of compressed
// data on disk plus the size of the struct that holds it
FTNODE_DISK_DATA
ndd
=
(
FTNODE_DISK_DATA
)
disk_data
;
uint32_t
compressed_data_size
=
BP_SIZE
(
ndd
,
i
);
compressed_data_size
+=
sizeof
(
struct
sub_block
);
// now get the space taken now
uint32_t
decompressed_data_size
=
get_avail_internal_node_partition_size
(
node
,
i
);
bytes_to_free
+=
(
decompressed_data_size
-
compressed_data_size
);
}
else
{
bytes_to_free
+=
get_avail_internal_node_partition_size
(
node
,
i
);
}
}
}
...
...
@@ -1088,9 +1098,20 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
if
(
num_partial_evictions
++
==
0
)
{
size_before
=
ftnode_memory_size
(
node
);
}
compress_internal_node_partition
(
node
,
i
,
// When partially evicting, always compress with quicklz,
TOKU_QUICKLZ_METHOD
);
if
(
ft_compress_buffers_before_eviction
)
{
// When partially evicting, always compress with quicklz
compress_internal_node_partition
(
node
,
i
,
TOKU_QUICKLZ_METHOD
);
}
else
{
// We're not compressing buffers before eviction. Simply
// detach the buffer and set the child's state to on-disk.
destroy_nonleaf_childinfo
(
BNC
(
node
,
i
));
set_BNULL
(
node
,
i
);
BP_STATE
(
node
,
i
)
=
PT_ON_DISK
;
}
}
else
{
BP_SWEEP_CLOCK
(
node
,
i
);
...
...
ft/ft-ops.h
View file @
05b84405
...
...
@@ -351,5 +351,8 @@ int toku_ft_strerror_r(int error, char *buf, size_t buflen);
extern
bool
garbage_collection_debug
;
// This is a poor place to put global options like these.
void
toku_ft_set_direct_io
(
bool
direct_io_on
);
void
toku_ft_set_compress_buffers_before_eviction
(
bool
compress_buffers
);
#endif
src/export.map
View file @
05b84405
...
...
@@ -5,6 +5,7 @@
db_strerror;
db_version;
db_env_set_direct_io;
db_env_set_compress_buffers_before_eviction;
db_env_set_func_fsync;
db_env_set_func_malloc;
db_env_set_func_realloc;
...
...
src/ydb_env_func.cc
View file @
05b84405
...
...
@@ -117,6 +117,10 @@ void db_env_set_direct_io (bool direct_io_on) {
toku_ft_set_direct_io
(
direct_io_on
);
}
void
db_env_set_compress_buffers_before_eviction
(
bool
compress_buffers
)
{
toku_ft_set_compress_buffers_before_eviction
(
compress_buffers
);
}
void
db_env_set_func_fsync
(
int
(
*
fsync_function
)(
int
))
{
toku_set_func_fsync
(
fsync_function
);
}
...
...
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