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
5b1a7811
Commit
5b1a7811
authored
Oct 02, 2007
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push commands down to in memory nodes
git-svn-id:
file:///svn/tokudb@382
c7de825b-a66e-492c-adef-691d508d4ae1
parent
fe3aebd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
30 deletions
+52
-30
newbrt/brt.c
newbrt/brt.c
+52
-30
No files found.
newbrt/brt.c
View file @
5b1a7811
...
...
@@ -844,6 +844,48 @@ static unsigned int brtnode_which_child (BRTNODE node , DBT *k, BRT t, DB *db) {
return
node
->
u
.
n
.
n_children
-
1
;
}
static
int
brt_nonleaf_put_cmd_child
(
BRT
t
,
BRTNODE
node
,
BRT_CMD
*
cmd
,
int
*
did_split
,
BRTNODE
*
nodea
,
BRTNODE
*
nodeb
,
DBT
*
splitk
,
int
debug
,
TOKUTXN
txn
,
int
childnum
,
int
maybe
)
{
int
r
;
void
*
child_v
;
BRTNODE
child
;
int
child_did_split
;
BRTNODE
childa
,
childb
;
DBT
childsplitk
;
*
did_split
=
0
;
if
(
maybe
)
r
=
cachetable_maybe_get_and_pin
(
t
->
cf
,
node
->
u
.
n
.
children
[
childnum
],
&
child_v
);
else
r
=
cachetable_get_and_pin
(
t
->
cf
,
node
->
u
.
n
.
children
[
childnum
],
&
child_v
,
brtnode_flush_callback
,
brtnode_fetch_callback
,
(
void
*
)(
long
)
t
->
h
->
nodesize
);
if
(
r
!=
0
)
return
r
;
child
=
child_v
;
child_did_split
=
0
;
r
=
brtnode_put_cmd
(
t
,
child
,
cmd
,
&
child_did_split
,
&
childa
,
&
childb
,
&
childsplitk
,
debug
,
txn
);
assert
(
r
==
0
);
if
(
child_did_split
)
{
if
(
0
)
printf
(
"brt_nonleaf_insert child_split %p
\n
"
,
child
);
assert
(
cmd
->
type
==
BRT_INSERT
||
cmd
->
type
==
BRT_DELETE
);
DBT
*
k
=
cmd
->
u
.
id
.
key
;
DB
*
db
=
cmd
->
u
.
id
.
db
;
r
=
handle_split_of_child
(
t
,
node
,
childnum
,
childa
,
childb
,
&
childsplitk
,
did_split
,
nodea
,
nodeb
,
splitk
,
k
->
app_private
,
db
,
txn
);
assert
(
r
==
0
);
}
else
{
r
=
cachetable_unpin_size
(
t
->
cf
,
child
->
thisnodename
,
child
->
dirty
,
brtnode_size
(
child
));
assert
(
r
==
0
);
}
return
r
;
}
static
int
brt_nonleaf_put_cmd
(
BRT
t
,
BRTNODE
node
,
BRT_CMD
*
cmd
,
int
*
did_split
,
BRTNODE
*
nodea
,
BRTNODE
*
nodeb
,
...
...
@@ -864,40 +906,12 @@ static int brt_nonleaf_put_cmd (BRT t, BRTNODE node, BRT_CMD *cmd,
/* non-buffering mode when cursors are open on this child */
if
(
node
->
u
.
n
.
n_cursors
[
childnum
]
>
0
)
{
int
r
;
void
*
child_v
;
BRTNODE
child
;
int
child_did_split
;
BRTNODE
childa
,
childb
;
DBT
childsplitk
;
assert
(
node
->
u
.
n
.
n_bytes_in_hashtable
[
childnum
]
==
0
);
*
did_split
=
0
;
r
=
cachetable_get_and_pin
(
t
->
cf
,
node
->
u
.
n
.
children
[
childnum
],
&
child_v
,
brtnode_flush_callback
,
brtnode_fetch_callback
,
(
void
*
)(
long
)
t
->
h
->
nodesize
);
assert
(
r
==
0
);
child
=
child_v
;
child_did_split
=
0
;
r
=
brtnode_put_cmd
(
t
,
child
,
cmd
,
&
child_did_split
,
&
childa
,
&
childb
,
&
childsplitk
,
0
,
txn
);
assert
(
r
==
0
);
if
(
child_did_split
)
{
if
(
0
)
printf
(
"brt_nonleaf_insert child_split %p
\n
"
,
child
);
r
=
handle_split_of_child
(
t
,
node
,
childnum
,
childa
,
childb
,
&
childsplitk
,
did_split
,
nodea
,
nodeb
,
splitk
,
k
->
app_private
,
db
,
txn
);
assert
(
r
==
0
);
}
else
{
r
=
cachetable_unpin_size
(
t
->
cf
,
child
->
thisnodename
,
child
->
dirty
,
brtnode_size
(
child
));
assert
(
r
==
0
);
}
int
r
=
brt_nonleaf_put_cmd_child
(
t
,
node
,
cmd
,
did_split
,
nodea
,
nodeb
,
splitk
,
debug
,
txn
,
childnum
,
0
);
return
r
;
}
found
=
!
toku_hash_find
(
node
->
u
.
n
.
htables
[
childnum
],
k
->
data
,
k
->
size
,
&
olddata
,
&
olddatalen
,
&
type
);
if
(
0
)
{
// It is faster to do this, except on yobiduck where things grind to a halt.
...
...
@@ -947,6 +961,14 @@ static int brt_nonleaf_put_cmd (BRT t, BRTNODE node, BRT_CMD *cmd,
brtnode_set_dirty
(
node
);
//printf("%s:%d deleted %d bytes\n", __FILE__, __LINE__, diff);
}
/* if the child is in the cache table then push the cmd to it
otherwise just put it into this node's buffer */
if
(
1
)
{
int
r
=
brt_nonleaf_put_cmd_child
(
t
,
node
,
cmd
,
did_split
,
nodea
,
nodeb
,
splitk
,
debug
,
txn
,
childnum
,
1
);
if
(
r
==
0
)
return
r
;
}
{
int
diff
=
k
->
size
+
v
->
size
+
KEY_VALUE_OVERHEAD
+
BRT_CMD_OVERHEAD
;
int
r
=
toku_hash_insert
(
node
->
u
.
n
.
htables
[
childnum
],
k
->
data
,
k
->
size
,
v
->
data
,
v
->
size
,
type
);
...
...
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