Skip to content

Commit

Permalink
FT-294 Move cachetable files to ft/cachetable, txn files to ft/txn
Browse files Browse the repository at this point in the history
FT-295 Move ybt.h to utils/dbt.h
  • Loading branch information
esmet committed Jul 3, 2014
1 parent c821fd5 commit 157e180
Show file tree
Hide file tree
Showing 111 changed files with 369 additions and 378 deletions.
27 changes: 13 additions & 14 deletions ft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ add_custom_target(
)

set(FT_SOURCES
background_job_manager
bndata
cachetable
checkpoint
cachetable/background_job_manager
cachetable/cachetable
cachetable/checkpoint
cursor
ft
ft-cachetable-wrappers
Expand All @@ -45,16 +45,11 @@ set(FT_SOURCES
logger/logfilemgr
logger/logger
logger/log_upgrade
logger/recover
msg
msg_buffer
node
pivotkeys
recover
rollback
rollback-apply
rollback-ct-callbacks
rollback_log_node_cache
roll
serialize/block_allocator
serialize/block_table
serialize/compress
Expand All @@ -63,12 +58,16 @@ set(FT_SOURCES
serialize/ft-serialize
serialize/quicklz
serialize/sub_block
txn
txn_child_manager
txn_manager
txn/rollback
txn/rollback-apply
txn/rollback-ct-callbacks
txn/rollback_log_node_cache
txn/roll
txn/txn
txn/txn_child_manager
txn/txn_manager
txn/xids
ule
xids
ybt
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ PATENT RIGHTS GRANT:
#include <memory.h>
#include <toku_pthread.h>

#include "background_job_manager.h"
#include "cachetable/background_job_manager.h"

struct background_job_manager_struct {
bool accepting_jobs;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."

#include "background_job_manager.h"
#include "cachetable/background_job_manager.h"
#include <portability/toku_random.h>
#include <util/frwlock.h>
#include <util/kibbutz.h>
Expand Down
13 changes: 7 additions & 6 deletions ft/cachetable.cc → ft/cachetable/cachetable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ PATENT RIGHTS GRANT:

#include <string.h>
#include <time.h>
#include <stdarg.h>

#include <portability/memory.h>
#include <portability/toku_race_tools.h>
Expand All @@ -100,9 +101,9 @@ PATENT RIGHTS GRANT:
#include <portability/toku_stdlib.h>
#include <portability/toku_time.h>

#include "ft/cachetable.h"
#include "ft/cachetable-internal.h"
#include "ft/checkpoint.h"
#include "ft/cachetable/cachetable.h"
#include "ft/cachetable/cachetable-internal.h"
#include "ft/cachetable/checkpoint.h"
#include "ft/logger/log-internal.h"
#include "util/rwlock.h"
#include "util/status.h"
Expand Down Expand Up @@ -1588,7 +1589,7 @@ int toku_cachetable_get_and_pin_with_dep_pairs (
PAIR* dependent_pairs,
enum cachetable_dirty* dependent_dirty // array stating dirty/cleanness of dependent pairs
)
// See cachetable.h
// See cachetable/cachetable.h
{
CACHETABLE ct = cachefile->cachetable;
bool wait = false;
Expand Down Expand Up @@ -2024,7 +2025,7 @@ int toku_cachetable_get_and_pin_nonblocking(
void *read_extraargs,
UNLOCKERS unlockers
)
// See cachetable.h.
// See cachetable/cachetable.h.
{
CACHETABLE ct = cf->cachetable;
assert(lock_type == PL_READ ||
Expand Down Expand Up @@ -2207,7 +2208,7 @@ int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, uint32_t fullhash,
CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
void *read_extraargs,
bool *doing_prefetch)
// Effect: See the documentation for this function in cachetable.h
// Effect: See the documentation for this function in cachetable/cachetable.h
{
int r = 0;
PAIR p = NULL;
Expand Down
4 changes: 2 additions & 2 deletions ft/cachetable.h → ft/cachetable/cachetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ PATENT RIGHTS GRANT:

#include <fcntl.h>

#include "ft/serialize/block_table.h"
#include "ft/logger/logger.h"
#include "ft/txn.h"
#include "ft/serialize/block_table.h"
#include "ft/txn/txn.h"
#include "util/minicron.h"

// Maintain a cache mapping from cachekeys to values (void*)
Expand Down
6 changes: 3 additions & 3 deletions ft/checkpoint.cc → ft/cachetable/checkpoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ PATENT RIGHTS GRANT:
#include "portability/toku_portability.h"
#include "portability/toku_atomic.h"

#include "ft/cachetable.h"
#include "ft/cachetable/cachetable.h"
#include "ft/cachetable/checkpoint.h"
#include "ft/ft.h"
#include "ft/logger/log-internal.h"
#include "ft/logger/logger.h"
#include "ft/checkpoint.h"
#include "ft/logger/recover.h"
#include "util/frwlock.h"
#include "util/status.h"

Expand Down
6 changes: 3 additions & 3 deletions ft/checkpoint.h → ft/cachetable/checkpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ident "$Id$"

#include "cachetable.h"

#include <stdint.h>

void toku_set_checkpoint_period(CACHETABLE ct, uint32_t new_period);
#include "ft/cachetable/cachetable.h"

//Effect: Change [end checkpoint (n) - begin checkpoint (n+1)] delay to
// new_period seconds. 0 means disable.
void toku_set_checkpoint_period(CACHETABLE ct, uint32_t new_period);

uint32_t toku_get_checkpoint_period_unlocked(CACHETABLE ct);

Expand Down
6 changes: 3 additions & 3 deletions ft/comparator.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ PATENT RIGHTS GRANT:
#include <db.h>
#include <string.h>

#include <ft/ybt.h>
//#include <ft/fttypes.h>
#include <portability/memory.h>
#include "portability/memory.h"

#include "util/dbt.h"

typedef int (*ft_compare_func)(DB *db, const DBT *a, const DBT *b);

Expand Down
4 changes: 2 additions & 2 deletions ft/cursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ PATENT RIGHTS GRANT:

#include "ft/cursor.h"
#include "ft/leafentry.h"
#include "ft/txn.h"
#include "ft/ybt.h"
#include "ft/txn/txn.h"
#include "util/dbt.h"

int toku_ft_cursor_create(FT_HANDLE ft_handle, FT_CURSOR cursor, TOKUTXN ttxn,
bool is_snapshot_read,
Expand Down
2 changes: 1 addition & 1 deletion ft/ft-cachetable-wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."

#include "ft/cachetable.h"
#include "ft/cachetable/cachetable.h"
#include "ft/ft-internal.h"
#include "ft/node.h"

Expand Down
4 changes: 2 additions & 2 deletions ft/ft-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ PATENT RIGHTS GRANT:
#include "portability/toku_list.h"
#include "portability/toku_race_tools.h"

#include "ft/cachetable.h"
#include "ft/cachetable/cachetable.h"
#include "ft/comparator.h"
#include "ft/ft.h"
#include "ft/ft-ops.h"
#include "ft/node.h"
#include "ft/rollback.h"
#include "ft/txn/rollback.h"

// Symbol TOKUDB_REVISION is not defined by fractal-tree makefiles, so
// BUILD_ID of 1000 indicates development build of main, not a release build.
Expand Down
6 changes: 3 additions & 3 deletions ft/ft-ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ basement nodes, bulk fetch, and partial fetch:
*/

#include "ft/checkpoint.h"
#include "ft/cachetable/checkpoint.h"
#include "ft/cursor.h"
#include "ft/ft.h"
#include "ft/ft-cachetable-wrappers.h"
Expand All @@ -215,9 +215,9 @@ basement nodes, bulk fetch, and partial fetch:
#include "ft/serialize/ft-serialize.h"
#include "ft/serialize/ft_layout_version.h"
#include "ft/serialize/ft_node-serialize.h"
#include "ft/txn_manager.h"
#include "ft/txn/txn_manager.h"
#include "ft/ule.h"
#include "ft/xids.h"
#include "ft/txn/xids.h"

#include <toku_race_tools.h>

Expand Down
4 changes: 2 additions & 2 deletions ft/ft-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ PATENT RIGHTS GRANT:

#include <db.h>

#include "ft/cachetable.h"
#include "ft/cachetable/cachetable.h"
#include "ft/comparator.h"
#include "ft/msg.h"
#include "ft/ybt.h"
#include "util/dbt.h"

typedef struct ft_handle *FT_HANDLE;

Expand Down
4 changes: 2 additions & 2 deletions ft/ft.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ PATENT RIGHTS GRANT:

#include <db.h>

#include "ft/cachetable.h"
#include "ft/cachetable/cachetable.h"
#include "ft/ft-ops.h"
#include "ft/logger/log.h"
#include "ft/ybt.h"
#include "util/dbt.h"

typedef struct ft *FT;
typedef struct ft_options *FT_OPTIONS;
Expand Down
2 changes: 1 addition & 1 deletion ft/leafentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ PATENT RIGHTS GRANT:
#include <util/mempool.h>
#include <util/omt.h>

#include "ft/txn_manager.h"
#include "ft/txn/txn_manager.h"
#include "ft/serialize/rbuf.h"
#include "ft/msg.h"

Expand Down
2 changes: 1 addition & 1 deletion ft/loader/callbacks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ PATENT RIGHTS GRANT:
#include <string.h>

#include "loader/loader-internal.h"
#include "ybt.h"
#include "util/dbt.h"

static void error_callback_lock(ft_loader_error_callback loader_error) {
toku_mutex_lock(&loader_error->mutex);
Expand Down
4 changes: 2 additions & 2 deletions ft/loader/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."

#include "ft/txn.h"
#include "ft/cachetable.h"
#include "ft/txn/txn.h"
#include "ft/cachetable/cachetable.h"
#include "ft/comparator.h"
#include "ft/ft-ops.h"

Expand Down
6 changes: 3 additions & 3 deletions ft/logger/log-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ PATENT RIGHTS GRANT:
#include "ft/ft-internal.h"
#include "ft/logger/log.h"
#include "ft/logger/logfilemgr.h"
#include "ft/txn.h"
#include "ft/txn_manager.h"
#include "ft/rollback_log_node_cache.h"
#include "ft/txn/txn.h"
#include "ft/txn/txn_manager.h"
#include "ft/txn/rollback_log_node_cache.h"

#include "util/memarena.h"
#include "util/omt.h"
Expand Down
7 changes: 3 additions & 4 deletions ft/logger/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ PATENT RIGHTS GRANT:
#include "portability/memory.h"
#include "portability/toku_portability.h"

#include "ft/logger/logger.h"
#include "ft/rollback.h"
#include "ft/recover.h"
#include "ft/txn.h"
#include "ft/logger/recover.h"
#include "ft/txn/rollback.h"
#include "ft/txn/txn.h"
#include "util/bytestring.h"

struct roll_entry;
Expand Down
2 changes: 1 addition & 1 deletion ft/logger/log_upgrade.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ PATENT RIGHTS GRANT:

#include "log-internal.h"
#include "logger/logcursor.h"
#include "checkpoint.h"
#include "cachetable/checkpoint.h"

static uint64_t footprint = 0; // for debug and accountability

Expand Down
4 changes: 2 additions & 2 deletions ft/logger/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ PATENT RIGHTS GRANT:
#include "ft/serialize/block_table.h"
#include "ft/ft.h"
#include "ft/logger/log-internal.h"
#include "ft/txn_manager.h"
#include "ft/rollback_log_node_cache.h"
#include "ft/txn/txn_manager.h"
#include "ft/txn/rollback_log_node_cache.h"

#include "util/status.h"

Expand Down
2 changes: 1 addition & 1 deletion ft/logger/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ PATENT RIGHTS GRANT:

#include "ft/serialize/block_table.h"
#include "ft/serialize/ft_layout_version.h"
#include "ft/txn.h"
#include "ft/txn/txn.h"

typedef struct tokulogger *TOKULOGGER;

Expand Down
6 changes: 3 additions & 3 deletions ft/recover.cc → ft/logger/recover.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."


#include "ft/cachetable.h"
#include "ft/checkpoint.h"
#include "ft/cachetable/cachetable.h"
#include "ft/cachetable/checkpoint.h"
#include "ft/ft.h"
#include "ft/log_header.h"
#include "ft/logger/log-internal.h"
#include "ft/logger/logcursor.h"
#include "ft/txn_manager.h"
#include "ft/txn/txn_manager.h"
#include "util/omt.h"

int tokudb_recovery_trace = 0; // turn on recovery tracing, default off.
Expand Down
25 changes: 13 additions & 12 deletions ft/recover.h → ft/logger/recover.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,22 @@ PATENT RIGHTS GRANT:
#include "ft/ft-ops.h"
#include "util/x1764.h"

typedef void (*prepared_txn_callback_t)(DB_ENV*, TOKUTXN);
typedef void (*keep_cachetable_callback_t)(DB_ENV*, CACHETABLE);
typedef void (*prepared_txn_callback_t)(DB_ENV *env, struct tokutxn *txn);
typedef void (*keep_cachetable_callback_t)(DB_ENV *env, struct cachetable *ct);

// Run tokudb recovery from the log
// Returns 0 if success
int tokudb_recover (DB_ENV *env,
prepared_txn_callback_t prepared_txn_callback,
keep_cachetable_callback_t keep_cachetable_callback,
struct tokulogger *logger,
const char *env_dir, const char *log_dir,
ft_compare_func bt_compare,
ft_update_func update_function,
generate_row_for_put_func generate_row_for_put,
generate_row_for_del_func generate_row_for_del,
size_t cachetable_size);
int tokudb_recover(DB_ENV *env,
prepared_txn_callback_t prepared_txn_callback,
keep_cachetable_callback_t keep_cachetable_callback,
struct tokulogger *logger,
const char *env_dir,
const char *log_dir,
ft_compare_func bt_compare,
ft_update_func update_function,
generate_row_for_put_func generate_row_for_put,
generate_row_for_del_func generate_row_for_del,
size_t cachetable_size);

// Effect: Check the tokudb logs to determine whether or not we need to run recovery.
// If the log is empty or if there is a clean shutdown at the end of the log, then we
Expand Down
Loading

0 comments on commit 157e180

Please sign in to comment.