Commit 2cede616 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:2843] Move require_local_checkpoint() function to brt.c, remove inclusion...

[t:2843] Move require_local_checkpoint() function to brt.c, remove inclusion of brt-internal.h from src/indexer.c.

git-svn-id: file:///svn/toku/tokudb@25767 c7de825b-a66e-492c-adef-691d508d4ae1
parent bc03f282
......@@ -5456,6 +5456,18 @@ int toku_brt_destroy(void) {
return r;
}
// Require that dictionary specified by brt is fully written to disk before
// transaction txn is committed.
void
toku_brt_require_local_checkpoint (BRT brt, TOKUTXN txn) {
toku_brtheader_lock(brt->h);
toku_list_push(&txn->checkpoint_before_commit,
&brt->h->checkpoint_before_commit_link);
toku_brtheader_unlock(brt->h);
}
//Suppress both rollback and recovery logs.
void
toku_brt_suppress_recovery_logs (BRT brt, TOKUTXN txn) {
......
......@@ -210,6 +210,12 @@ void toku_maybe_truncate_cachefile (CACHEFILE cf, int fd, u_int64_t size_used);
int maybe_preallocate_in_file (int fd, u_int64_t size) __attribute__ ((warn_unused_result));
// Effect: If file size is less than SIZE, make it bigger by either doubling it or growing by 16MB whichever is less.
void toku_brt_require_local_checkpoint (BRT brt, TOKUTXN txn);
// Require that dictionary specified by brt is fully written to disk before
// transaction txn is committed.
void toku_brt_header_suppress_rollbacks(struct brt_header *h, TOKUTXN txn);
//Effect: suppresses rollback logs
......
......@@ -17,7 +17,6 @@
#include "ydb-internal.h"
#include "le-cursor.h"
#include "indexer.h"
#include "brt-internal.h"
#include "toku_atomic.h"
#include "tokuconst.h"
#include "brt.h"
......@@ -284,14 +283,6 @@ build_index(DB_INDEXER *indexer) {
return result;
}
static void
require_local_checkpoint (BRT brt, TOKUTXN txn) {
toku_brtheader_lock(brt->h);
toku_list_push(&txn->checkpoint_before_commit,
&brt->h->checkpoint_before_commit_link);
toku_brtheader_unlock(brt->h);
}
static int
close_indexer(DB_INDEXER *indexer) {
int r = 0;
......@@ -310,7 +301,7 @@ close_indexer(DB_INDEXER *indexer) {
for (int which_db = 0; which_db < indexer->i->N ; which_db++) {
db = indexer->i->dest_dbs[which_db];
brt = db_struct_i(db)->brt;
require_local_checkpoint(brt, tokutxn);
toku_brt_require_local_checkpoint(brt, tokutxn);
}
// Disassociate the indexer from the hot db and free_indexer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment