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
0d835833
Commit
0d835833
authored
Nov 16, 2007
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BRTNODEs no longer point to BRTs
git-svn-id:
file:///svn/tokudb@602
c7de825b-a66e-492c-adef-691d508d4ae1
parent
2ad8c103
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
newbrt/brt-internal.h
newbrt/brt-internal.h
+1
-1
newbrt/brt.c
newbrt/brt.c
+5
-3
No files found.
newbrt/brt-internal.h
View file @
0d835833
...
@@ -23,7 +23,7 @@ typedef struct brtnode *BRTNODE;
...
@@ -23,7 +23,7 @@ typedef struct brtnode *BRTNODE;
/* Internal nodes. */
/* Internal nodes. */
struct
brtnode
{
struct
brtnode
{
enum
typ_tag
tag
;
enum
typ_tag
tag
;
BRT
brt
;
// The containing BRT
//
BRT brt; // The containing BRT
unsigned
int
nodesize
;
unsigned
int
nodesize
;
DISKOFF
thisnodename
;
// The size of the node allocated on disk. Not all is necessarily in use.
DISKOFF
thisnodename
;
// The size of the node allocated on disk. Not all is necessarily in use.
LSN
lsn
;
// Need the LSN as of the most recent modification.
LSN
lsn
;
// Need the LSN as of the most recent modification.
...
...
newbrt/brt.c
View file @
0d835833
...
@@ -142,6 +142,7 @@ void brtnode_flush_callback (CACHEFILE cachefile, DISKOFF nodename, void *brtnod
...
@@ -142,6 +142,7 @@ void brtnode_flush_callback (CACHEFILE cachefile, DISKOFF nodename, void *brtnod
//printf(" %lld\n", parent->u.n.children[i]);
//printf(" %lld\n", parent->u.n.children[i]);
if
(
parent
->
u
.
n
.
children
[
i
]
==
nodename
)
{
if
(
parent
->
u
.
n
.
children
[
i
]
==
nodename
)
{
// Rename the block, informing the parent of the new block
// Rename the block, informing the parent of the new block
#if 0
if (rename_p) {
if (rename_p) {
DISKOFF newnodename = malloc_diskblock(brtnode->brt, brtnode->nodesize);
DISKOFF newnodename = malloc_diskblock(brtnode->brt, brtnode->nodesize);
int r=tokulogger_log_block_rename(cachefile_logger(cachefile), cachefile_filenum(cachefile), nodename, newnodename, parent->thisnodename, i);
int r=tokulogger_log_block_rename(cachefile_logger(cachefile), cachefile_filenum(cachefile), nodename, newnodename, parent->thisnodename, i);
...
@@ -151,6 +152,7 @@ void brtnode_flush_callback (CACHEFILE cachefile, DISKOFF nodename, void *brtnod
...
@@ -151,6 +152,7 @@ void brtnode_flush_callback (CACHEFILE cachefile, DISKOFF nodename, void *brtnod
parent->u.n.children[i] = newnodename;
parent->u.n.children[i] = newnodename;
cachetable_rename(cachefile, nodename, newnodename);
cachetable_rename(cachefile, nodename, newnodename);
}
}
#endif
goto
ok
;
goto
ok
;
}
}
}
}
...
@@ -269,7 +271,7 @@ DISKOFF malloc_diskblock (BRT brt, int size) {
...
@@ -269,7 +271,7 @@ DISKOFF malloc_diskblock (BRT brt, int size) {
static
void
initialize_brtnode
(
BRT
t
,
BRTNODE
n
,
DISKOFF
nodename
,
int
height
)
{
static
void
initialize_brtnode
(
BRT
t
,
BRTNODE
n
,
DISKOFF
nodename
,
int
height
)
{
int
i
;
int
i
;
n
->
tag
=
TYP_BRTNODE
;
n
->
tag
=
TYP_BRTNODE
;
n
->
brt
=
t
;
//
n->brt = t;
n
->
nodesize
=
t
->
h
->
nodesize
;
n
->
nodesize
=
t
->
h
->
nodesize
;
n
->
thisnodename
=
nodename
;
n
->
thisnodename
=
nodename
;
n
->
lsn
.
lsn
=
0
;
// a new one can always be 0.
n
->
lsn
.
lsn
=
0
;
// a new one can always be 0.
...
@@ -315,7 +317,7 @@ static void create_new_brtnode (BRT t, BRTNODE *result, int height, BRTNODE pare
...
@@ -315,7 +317,7 @@ static void create_new_brtnode (BRT t, BRTNODE *result, int height, BRTNODE pare
*
result
=
n
;
*
result
=
n
;
assert
(
n
->
nodesize
>
0
);
assert
(
n
->
nodesize
>
0
);
n
->
parent_brtnode
=
parent_brtnode
;
n
->
parent_brtnode
=
parent_brtnode
;
n
->
brt
=
t
;
//
n->brt = t;
//printf("%s:%d putting %p (%lld) parent=%p\n", __FILE__, __LINE__, n, n->thisnodename, parent_brtnode);
//printf("%s:%d putting %p (%lld) parent=%p\n", __FILE__, __LINE__, n, n->thisnodename, parent_brtnode);
r
=
cachetable_put
(
t
->
cf
,
n
->
thisnodename
,
n
,
brtnode_size
(
n
),
r
=
cachetable_put
(
t
->
cf
,
n
->
thisnodename
,
n
,
brtnode_size
(
n
),
brtnode_flush_callback
,
brtnode_fetch_callback
,
(
void
*
)(
long
)
t
->
h
->
nodesize
);
brtnode_flush_callback
,
brtnode_fetch_callback
,
(
void
*
)(
long
)
t
->
h
->
nodesize
);
...
@@ -1166,7 +1168,7 @@ static int setup_brt_root_node (BRT t, DISKOFF offset) {
...
@@ -1166,7 +1168,7 @@ static int setup_brt_root_node (BRT t, DISKOFF offset) {
offset
,
/* the location is one nodesize offset from 0. */
offset
,
/* the location is one nodesize offset from 0. */
0
);
0
);
node
->
parent_brtnode
=
0
;
node
->
parent_brtnode
=
0
;
node
->
brt
=
t
;
//
node->brt = t;
if
(
0
)
{
if
(
0
)
{
printf
(
"%s:%d for tree %p node %p mdict_create--> %p
\n
"
,
__FILE__
,
__LINE__
,
t
,
node
,
node
->
u
.
l
.
buffer
);
printf
(
"%s:%d for tree %p node %p mdict_create--> %p
\n
"
,
__FILE__
,
__LINE__
,
t
,
node
,
node
->
u
.
l
.
buffer
);
printf
(
"%s:%d put root at %lld
\n
"
,
__FILE__
,
__LINE__
,
offset
);
printf
(
"%s:%d put root at %lld
\n
"
,
__FILE__
,
__LINE__
,
offset
);
...
...
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