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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4b6e1f0b
Commit
4b6e1f0b
authored
Apr 16, 2013
by
Leif Walsh
Committed by
Yoni Fogel
Apr 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
committed too much
git-svn-id:
file:///svn/toku/tokudb@35542
c7de825b-a66e-492c-adef-691d508d4ae1
parent
43628dab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
newbrt/tests/orthopush-flush.c
newbrt/tests/orthopush-flush.c
+17
-12
No files found.
newbrt/tests/orthopush-flush.c
View file @
4b6e1f0b
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "$Id$"
#ident "$Id
: orthopush-flush.c 35539 2011-10-11 02:13:02Z leifwalsh
$"
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
#include "test.h"
...
...
@@ -33,13 +33,14 @@ rand_bytes(void *dest, int size)
}
}
#if 0
static void
rand_bytes_limited(void *dest, int size)
{
long *l;
for (l = dest; (unsigned int) size >= (sizeof *l); ++l, size -= (sizeof *l)) {
char c = random() & 0xff;
unsigned
int
i
=
0
;
int i = 0;
for (char *p = (char *) l; i < (sizeof *l); ++i) {
*p = c;
}
...
...
@@ -49,6 +50,7 @@ rand_bytes_limited(void *dest, int size)
*p = c;
}
}
#endif
static
void
insert_random_message
(
NONLEAF_CHILDINFO
bnc
,
BRT_MSG_S
**
save
,
bool
*
is_fresh_out
,
XIDS
xids
,
int
pfx
)
...
...
@@ -83,6 +85,7 @@ insert_random_message(NONLEAF_CHILDINFO bnc, BRT_MSG_S **save, bool *is_fresh_ou
assert_zero
(
r
);
}
#if 0
static void
insert_random_message_to_leaf(BRT t, BASEMENTNODE blb, LEAFENTRY *save, XIDS xids, int pfx)
{
...
...
@@ -94,6 +97,7 @@ insert_random_message_to_leaf(BRT t, BASEMENTNODE blb, LEAFENTRY *save, XIDS xid
rand_bytes_limited((char *) key + (sizeof pfx), keylen);
rand_bytes(val, vallen);
MSN msn = next_dummymsn();
bool is_fresh = (random() & 0x100) == 0;
DBT *keydbt, *valdbt;
keydbt = toku_xmalloc(sizeof *keydbt);
...
...
@@ -159,6 +163,7 @@ insert_random_update_message(NONLEAF_CHILDINFO bnc, BRT_MSG_S **save, bool *is_f
NULL, dummy_cmp);
assert_zero(r);
}
#endif
const
int
M
=
1024
*
1024
;
...
...
@@ -417,6 +422,7 @@ flush_to_internal_multiple(BRT t) {
toku_free
(
child_messages_is_fresh
);
}
#if 0
static void
flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) {
int r;
...
...
@@ -451,7 +457,7 @@ flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) {
u_int32_t keylen;
char *key = le_key_and_len(child_messages[i], &keylen);
DBT keydbt;
if
(
dummy_cmp
(
NULL
,
toku_fill_dbt
(
&
keydbt
,
key
,
keylen
),
&
childkeys
[
i
%
8
])
>
0
)
{
if (dummy_cmp(NULL, toku_fill_dbt(&keydbt, key, keylen), childkeys[i%8]) > 0) {
toku_fill_dbt(&childkeys[i%8], key, keylen);
}
}
...
...
@@ -484,13 +490,9 @@ flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) {
toku_apply_cmd_to_leaf(t, child, parent_messages[i], &made_change, &workdone, NULL, NULL);
}
}
for
(
i
=
0
;
i
<
8
;
++
i
)
{
BLB
(
child
,
i
)
->
stale_ancestor_messages_applied
=
true
;
}
child->stale_ancestor_messages_applied = true;
} else {
for
(
i
=
0
;
i
<
8
;
++
i
)
{
BLB
(
child
,
i
)
->
stale_ancestor_messages_applied
=
false
;
}
child->stale_ancestor_messages_applied = false;
}
if (use_flush) {
...
...
@@ -499,9 +501,9 @@ flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) {
BRTNODE XMALLOC(parentnode);
BLOCKNUM parentblocknum = { 17 };
toku_initialize_empty_brtnode(parentnode, parentblocknum, 1, 1, BRT_LAYOUT_VERSION, 4*M, 0);
destroy_nonleaf_childinfo
(
BNC
(
parent
node
,
0
));
set_BNC
(
parent
node
,
0
,
parent_bnc
);
BP_STATE
(
parent
node
,
0
)
=
PT_AVAIL
;
destroy_nonleaf_childinfo(BNC(parent, 0));
set_BNC(parent, 0, parent_bnc);
BP_STATE(parent, 0) = PT_AVAIL;
struct ancestors ancestors = { .node = parentnode, .childnum = 0, .next = NULL };
const struct pivot_bounds infinite_bounds = { .lower_bound_exclusive = NULL, .upper_bound_inclusive = NULL };
maybe_apply_ancestors_messages_to_node(t, child, &ancestors, &infinite_bounds);
...
...
@@ -587,6 +589,7 @@ flush_to_leaf(BRT t, bool make_leaf_up_to_date, bool use_flush) {
toku_free(parent_messages_is_fresh);
toku_free(child_messages_is_fresh);
}
#endif
int
test_main
(
int
argc
,
const
char
*
argv
[])
{
...
...
@@ -608,6 +611,7 @@ test_main (int argc, const char *argv[]) {
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
flush_to_internal_multiple
(
t
);
}
#if 0
r = toku_brt_set_update(t, orthopush_flush_update_fun); assert(r==0);
for (int i = 0; i < 10; ++i) {
flush_to_leaf(t, false, false);
...
...
@@ -615,6 +619,7 @@ test_main (int argc, const char *argv[]) {
flush_to_leaf(t, true, false);
flush_to_leaf(t, true, true);
}
#endif
r
=
toku_close_brt
(
t
,
0
);
assert
(
r
==
0
);
r
=
toku_cachetable_close
(
&
ct
);
assert
(
r
==
0
);
...
...
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