Skip to content

Commit

Permalink
FT-396 Rename various tokudb-containing functions and comments to
Browse files Browse the repository at this point in the history
instead refer to tokuft
  • Loading branch information
esmet committed Aug 21, 2014
1 parent 7316bac commit f176b29
Show file tree
Hide file tree
Showing 70 changed files with 159 additions and 164 deletions.
12 changes: 6 additions & 6 deletions buildheader/make_tdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ static void print_defines (void) {
dodefine_from_track(txn_flags, DB_TXN_READ_ONLY);
}

/* TOKUDB specific error codes*/
printf("/* TOKUDB specific error codes */\n");
/* TokuFT specific error codes*/
printf("/* TokuFT specific error codes */\n");
dodefine(TOKUDB_OUT_OF_LOCKS);
dodefine(TOKUDB_SUCCEEDED_EARLY);
dodefine(TOKUDB_FOUND_BUT_REJECTED);
Expand Down Expand Up @@ -422,7 +422,7 @@ static void print_db_env_struct (void) {
"int (*cleaner_set_iterations) (DB_ENV*, uint32_t) /* Change the number of attempts on each cleaner invokation. 0 means disabled. */",
"int (*cleaner_get_iterations) (DB_ENV*, uint32_t*) /* Retrieve the number of attempts on each cleaner invokation. 0 means disabled. */",
"int (*checkpointing_postpone) (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */",
"int (*checkpointing_resume) (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */",
"int (*checkpointing_resume) (DB_ENV*) /* Alert tokuft that 'postpone' is no longer necessary */",
"int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */",
"int (*checkpointing_end_atomic_operation) (DB_ENV*) /* End a set of operations (that must be atomic as far as checkpoints are concerned). */",
"int (*set_default_bt_compare) (DB_ENV*,int (*bt_compare) (DB *, const DBT *, const DBT *)) /* Set default (key) comparison function for all DBs in this environment. Required for RECOVERY since you cannot open the DBs manually. */",
Expand Down Expand Up @@ -575,7 +575,7 @@ static void print_db_txn_struct (void) {
STRUCT_SETUP(DB_TXN, prepare, "int (*%s) (DB_TXN*, uint8_t gid[DB_GID_SIZE])");
STRUCT_SETUP(DB_TXN, discard, "int (*%s) (DB_TXN*, uint32_t)");
STRUCT_SETUP(DB_TXN, id, "uint32_t (*%s) (DB_TXN *)");
STRUCT_SETUP(DB_TXN, mgrp, "DB_ENV *%s /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/");
STRUCT_SETUP(DB_TXN, mgrp, "DB_ENV *%s /* In TokuFT, mgrp is a DB_ENV, not a DB_TXNMGR */");
STRUCT_SETUP(DB_TXN, parent, "DB_TXN *%s");
const char *extra[] = {
"int (*txn_stat)(DB_TXN *, struct txn_stat **)",
Expand Down Expand Up @@ -639,9 +639,9 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {

printf("#define DB_VERSION_MAJOR %d\n", DB_VERSION_MAJOR);
printf("#define DB_VERSION_MINOR %d\n", DB_VERSION_MINOR);
printf("/* As of r40364 (post TokuDB 5.2.7), the patch version number is 100+ the BDB header patch version number.*/\n");
printf("/* As of r40364 (post TokuFT 5.2.7), the patch version number is 100+ the BDB header patch version number.*/\n");
printf("#define DB_VERSION_PATCH %d\n", 100+DB_VERSION_PATCH);
printf("#define DB_VERSION_STRING \"Tokutek: TokuDB %d.%d.%d\"\n", DB_VERSION_MAJOR, DB_VERSION_MINOR, 100+DB_VERSION_PATCH);
printf("#define DB_VERSION_STRING \"Tokutek: TokuFT %d.%d.%d\"\n", DB_VERSION_MAJOR, DB_VERSION_MINOR, 100+DB_VERSION_PATCH);

#ifndef DB_GID_SIZE
#define DB_GID_SIZE DB_XIDDATASIZE
Expand Down
2 changes: 1 addition & 1 deletion ft/cachetable/cachetable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static CACHETABLE_STATUS_S ct_status;

// Note, toku_cachetable_get_status() is below, after declaration of cachetable.

#define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ct_status, k, c, t, "cachetable: " l, inc)
#define STATUS_INIT(k,c,t,l,inc) TOKUFT_STATUS_INIT(ct_status, k, c, t, "cachetable: " l, inc)

static void
status_init(void) {
Expand Down
2 changes: 1 addition & 1 deletion ft/cachetable/checkpoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ PATENT RIGHTS GRANT:

static CHECKPOINT_STATUS_S cp_status;

#define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(cp_status, k, c, t, "checkpoint: " l, inc)
#define STATUS_INIT(k,c,t,l,inc) TOKUFT_STATUS_INIT(cp_status, k, c, t, "checkpoint: " l, inc)

static void
status_init(void) {
Expand Down
2 changes: 1 addition & 1 deletion ft/ft-flusher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ PATENT RIGHTS GRANT:
*/
static FT_FLUSHER_STATUS_S ft_flusher_status;

#define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ft_flusher_status, k, c, t, "ft flusher: " l, inc)
#define STATUS_INIT(k,c,t,l,inc) TOKUFT_STATUS_INIT(ft_flusher_status, k, c, t, "ft flusher: " l, inc)

#define STATUS_VALUE(x) ft_flusher_status.status[x].value.num
void toku_ft_flusher_status_init(void) {
Expand Down
2 changes: 1 addition & 1 deletion ft/ft-hot-flusher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ struct hot_flusher_extra {

static FT_HOT_STATUS_S hot_status;

#define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(hot_status, k, c, t, "hot: " l, inc)
#define STATUS_INIT(k,c,t,l,inc) TOKUFT_STATUS_INIT(hot_status, k, c, t, "hot: " l, inc)

#define STATUS_VALUE(x) hot_status.status[x].value.num

Expand Down
2 changes: 1 addition & 1 deletion ft/ft-ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ basement nodes, bulk fetch, and partial fetch:
*/
static FT_STATUS_S ft_status;

#define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(ft_status, k, c, t, "ft: " l, inc)
#define STATUS_INIT(k,c,t,l,inc) TOKUFT_STATUS_INIT(ft_status, k, c, t, "ft: " l, inc)

static toku_mutex_t ft_open_close_lock;

Expand Down
2 changes: 1 addition & 1 deletion ft/ft-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ bool toku_ft_is_empty_fast (FT_HANDLE ft_h) __attribute__ ((warn_unused_result))
int toku_ft_strerror_r(int error, char *buf, size_t buflen);
// Effect: LIke the XSI-compliant strerorr_r, extended to db_strerror().
// If error>=0 then the result is to do strerror_r(error, buf, buflen), that is fill buf with a descriptive error message.
// If error<0 then return a TokuDB-specific error code. For unknown cases, we return -1 and set errno=EINVAL, even for cases that *should* be known. (Not all DB errors are known by this function which is a bug.)
// If error<0 then return a TokuFT-specific error code. For unknown cases, we return -1 and set errno=EINVAL, even for cases that *should* be known. (Not all DB errors are known by this function which is a bug.)

extern bool garbage_collection_debug;

Expand Down
17 changes: 7 additions & 10 deletions ft/ft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1090,8 +1090,6 @@ void toku_ft_get_garbage(FT ft, uint64_t *total_space, uint64_t *used_space) {
#error
#endif



#define xstr(X) str(X)
#define str(X) #X
#define static_version_string xstr(DB_VERSION_MAJOR) "." \
Expand All @@ -1101,10 +1099,9 @@ void toku_ft_get_garbage(FT ft, uint64_t *total_space, uint64_t *used_space) {
struct toku_product_name_strings_struct toku_product_name_strings;

char toku_product_name[TOKU_MAX_PRODUCT_NAME_LENGTH];
void
tokudb_update_product_name_strings(void) {
//DO ALL STRINGS HERE.. maybe have a separate FT layer version as well
{ // Version string
void tokuft_update_product_name_strings(void) {
// DO ALL STRINGS HERE.. maybe have a separate FT layer version as well
{
int n = snprintf(toku_product_name_strings.db_version,
sizeof(toku_product_name_strings.db_version),
"%s %s", toku_product_name, static_version_string);
Expand Down Expand Up @@ -1156,7 +1153,7 @@ toku_single_process_lock(const char *lock_dir, const char *which, int *lockfd) {
*lockfd = toku_os_lock_file(lockfname);
if (*lockfd < 0) {
int e = get_error_errno();
fprintf(stderr, "Couldn't start tokudb because some other tokudb process is using the same directory [%s] for [%s]\n", lock_dir, which);
fprintf(stderr, "Couldn't start tokuft because some other tokuft process is using the same directory [%s] for [%s]\n", lock_dir, which);
return e;
}
return 0;
Expand All @@ -1174,10 +1171,10 @@ toku_single_process_unlock(int *lockfd) {
return 0;
}

int tokudb_num_envs = 0;
int tokuft_num_envs = 0;
int
db_env_set_toku_product_name(const char *name) {
if (tokudb_num_envs > 0) {
if (tokuft_num_envs > 0) {
return EINVAL;
}
if (!name || strlen(name) < 1) {
Expand All @@ -1188,7 +1185,7 @@ db_env_set_toku_product_name(const char *name) {
}
if (strncmp(toku_product_name, name, sizeof(toku_product_name))) {
strcpy(toku_product_name, name);
tokudb_update_product_name_strings();
tokuft_update_product_name_strings();
}
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions ft/ft.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ struct toku_thread_pool *get_ft_pool(void);
int toku_single_process_lock(const char *lock_dir, const char *which, int *lockfd);
int toku_single_process_unlock(int *lockfd);

void tokudb_update_product_name_strings(void);
void tokuft_update_product_name_strings(void);
#define TOKU_MAX_PRODUCT_NAME_LENGTH (256)
extern char toku_product_name[TOKU_MAX_PRODUCT_NAME_LENGTH];

Expand All @@ -232,4 +232,4 @@ struct toku_product_name_strings_struct {
};

extern struct toku_product_name_strings_struct toku_product_name_strings;
extern int tokudb_num_envs;
extern int tokuft_num_envs;
2 changes: 1 addition & 1 deletion ft/logger/log-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct tokulogger {
DIR *dir; // descriptor for directory
int fd;
CACHETABLE ct;
int lg_max; // The size of the single file in the log. Default is 100MB in TokuDB
int lg_max; // The size of the single file in the log. Default is 100MB.

// To access these, you must have the input lock
LSN lsn; // the next available lsn
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 @@ -228,7 +228,7 @@ verify_clean_shutdown_of_log_version(const char *log_dir, uint32_t version, LSN
FOOTPRINT(1);
r = verify_clean_shutdown_of_log_version_old(log_dir, last_lsn, last_xid, version);
if (r != 0) {
fprintf(stderr, "Cannot upgrade TokuDB version %d database.", version);
fprintf(stderr, "Cannot upgrade TokuFT version %d database.", version);
fprintf(stderr, " Previous improper shutdown detected.\n");
}
}
Expand Down
14 changes: 7 additions & 7 deletions ft/logger/logcursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int lc_check_lsn(TOKULOGCURSOR lc, int dir) {
// int index = lc->cur_logfiles_index;
// fprintf(stderr, "Bad LSN: %d %s direction = %d, lsn.lsn = %" PRIu64 ", cur_lsn.lsn=%" PRIu64 "\n",
// index, lc->logfiles[index], dir, lsn.lsn, lc->cur_lsn.lsn);
if (tokudb_recovery_trace)
if (tokuft_recovery_trace)
printf("DB_RUNRECOVERY: %s:%d r=%d\n", __FUNCTION__, __LINE__, 0);
return LC_LSN_ERROR;
}
Expand Down Expand Up @@ -307,10 +307,10 @@ static int lc_log_read(TOKULOGCURSOR lc)
toku_log_free_log_entry_resources(&(lc->entry));
time_t tnow = time(NULL);
if (r==DB_BADFORMAT) {
fprintf(stderr, "%.24s Tokudb bad log format in %s\n", ctime(&tnow), lc->logfiles[lc->cur_logfiles_index]);
fprintf(stderr, "%.24s TokuFT bad log format in %s\n", ctime(&tnow), lc->logfiles[lc->cur_logfiles_index]);
}
else {
fprintf(stderr, "%.24s Tokudb unexpected log format error '%s' in %s\n", ctime(&tnow), strerror(r), lc->logfiles[lc->cur_logfiles_index]);
fprintf(stderr, "%.24s TokuFT unexpected log format error '%s' in %s\n", ctime(&tnow), strerror(r), lc->logfiles[lc->cur_logfiles_index]);
}
}
return r;
Expand Down Expand Up @@ -339,10 +339,10 @@ static int lc_log_read_backward(TOKULOGCURSOR lc)
toku_log_free_log_entry_resources(&(lc->entry));
time_t tnow = time(NULL);
if (r==DB_BADFORMAT) {
fprintf(stderr, "%.24s Tokudb bad log format in %s\n", ctime(&tnow), lc->logfiles[lc->cur_logfiles_index]);
fprintf(stderr, "%.24s TokuFT bad log format in %s\n", ctime(&tnow), lc->logfiles[lc->cur_logfiles_index]);
}
else {
fprintf(stderr, "%.24s Tokudb uUnexpected log format error '%s' in %s\n", ctime(&tnow), strerror(r), lc->logfiles[lc->cur_logfiles_index]);
fprintf(stderr, "%.24s TokuFT uUnexpected log format error '%s' in %s\n", ctime(&tnow), strerror(r), lc->logfiles[lc->cur_logfiles_index]);
}
}
return r;
Expand Down Expand Up @@ -460,10 +460,10 @@ int toku_logcursor_last(TOKULOGCURSOR lc, struct log_entry **le) {
// probably a corrupted last log entry due to a crash
// try scanning forward from the beginning to find the last good entry
time_t tnow = time(NULL);
fprintf(stderr, "%.24s Tokudb recovery repairing log\n", ctime(&tnow));
fprintf(stderr, "%.24s TokuFT recovery repairing log\n", ctime(&tnow));
r = lc_fix_bad_logfile(lc);
if ( r != 0 ) {
fprintf(stderr, "%.24s Tokudb recovery repair unsuccessful\n", ctime(&tnow));
fprintf(stderr, "%.24s TokuFT recovery repair unsuccessful\n", ctime(&tnow));
return DB_BADFORMAT;
}
// try reading again
Expand Down
2 changes: 1 addition & 1 deletion ft/logger/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ void toku_logger_note_checkpoint(TOKULOGGER logger, LSN lsn) {

static LOGGER_STATUS_S logger_status;

#define STATUS_INIT(k,c,t,l,inc) TOKUDB_STATUS_INIT(logger_status, k, c, t, "logger: " l, inc)
#define STATUS_INIT(k,c,t,l,inc) TOKUFT_STATUS_INIT(logger_status, k, c, t, "logger: " l, inc)

static void
status_init(void) {
Expand Down
Loading

0 comments on commit f176b29

Please sign in to comment.