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
17c5b4d9
Commit
17c5b4d9
authored
Jul 08, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-300 Block allocator trace replay tool
parent
e9de0225
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
384 additions
and
3 deletions
+384
-3
ft/serialize/block_allocator.cc
ft/serialize/block_allocator.cc
+10
-2
ft/serialize/block_allocator.h
ft/serialize/block_allocator.h
+8
-0
tools/CMakeLists.txt
tools/CMakeLists.txt
+1
-1
tools/ba_replay.cc
tools/ba_replay.cc
+365
-0
No files found.
ft/serialize/block_allocator.cc
View file @
17c5b4d9
...
...
@@ -129,7 +129,7 @@ void block_allocator::create(uint64_t reserve_at_beginning, uint64_t alignment)
VALIDATE
();
if
(
ba_trace_enabled
())
{
fprintf
(
stderr
,
"ba_trace_create %p"
,
this
);
fprintf
(
stderr
,
"ba_trace_create %p
\n
"
,
this
);
}
}
...
...
@@ -137,7 +137,7 @@ void block_allocator::destroy() {
toku_free
(
_blocks_array
);
if
(
ba_trace_enabled
())
{
fprintf
(
stderr
,
"ba_trace_destroy %p"
,
this
);
fprintf
(
stderr
,
"ba_trace_destroy %p
\n
"
,
this
);
}
}
...
...
@@ -460,6 +460,14 @@ void block_allocator::get_unused_statistics(TOKU_DB_FRAGMENTATION report) {
}
}
void
block_allocator
::
get_statistics
(
TOKU_DB_FRAGMENTATION
report
)
{
report
->
data_bytes
=
_n_bytes_in_use
;
report
->
data_blocks
=
_n_blocks
;
report
->
file_size_bytes
=
0
;
report
->
checkpoint_bytes_additional
=
0
;
get_unused_statistics
(
report
);
}
void
block_allocator
::
validate
()
const
{
uint64_t
n_bytes_in_use
=
_reserve_at_beginning
;
for
(
uint64_t
i
=
0
;
i
<
_n_blocks
;
i
++
)
{
...
...
ft/serialize/block_allocator.h
View file @
17c5b4d9
...
...
@@ -213,6 +213,14 @@ class block_allocator {
// report->checkpoint_bytes_additional is filled in
void
get_unused_statistics
(
TOKU_DB_FRAGMENTATION
report
);
// Effect: Fill in report->data_bytes with the number of bytes in use
// Fill in report->data_blocks with the number of blockpairs in use
// Fill in unused statistics using this->get_unused_statistics()
// Requires:
// report->file_size is ignored on return
// report->checkpoint_bytes_additional is ignored on return
void
get_statistics
(
TOKU_DB_FRAGMENTATION
report
);
// Effect: Merge dst[d] and src[s] into dst[d+s], merging in place.
// Initially dst and src hold sorted arrays (sorted by increasing offset).
// Finally dst contains all d+s elements sorted in order.
...
...
tools/CMakeLists.txt
View file @
17c5b4d9
set_property
(
DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPRECATE_ERRNO
)
set
(
tools tokudb_dump tokuftdump tdb_logprint tdb-recover ftverify
)
set
(
tools tokudb_dump tokuftdump tdb_logprint tdb-recover ftverify
ba_replay
)
foreach
(
tool
${
tools
}
)
add_executable
(
${
tool
}
${
tool
}
)
add_dependencies
(
${
tool
}
install_tdb_h
)
...
...
tools/ba_replay.cc
0 → 100644
View file @
17c5b4d9
This diff is collapsed.
Click to expand it.
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