Commit 507e490c authored by Dave Wells's avatar Dave Wells Committed by Yoni Fogel

change temp prefix to tokuld, closes #2536 [t:2536]

git-svn-id: file:///svn/toku/tokudb@20149 c7de825b-a66e-492c-adef-691d508d4ae1
parent 52b5bafc
......@@ -122,7 +122,8 @@ static int verify_empty(DB *db, DB_TXN *txn)
return r;
}
static const char *loader_temp_prefix = "temp";
//static const char *loader_temp_prefix = "temp";
static const char *loader_temp_prefix = "tokuld"; // 2536
static const char *loader_temp_suffix = "XXXXXX";
int toku_loader_create_loader(DB_ENV *env,
......
......@@ -79,7 +79,7 @@ enum {MAGIC=311};
DBT old_inames[MAX_DBS];
DBT new_inames[MAX_DBS];
static const char *loader_temp_prefix = "tokuld"; // 2536
static int count_temp(char * dirname);
static void get_inames(DBT* inames, DB** dbs);
static int verify_file(char * dirname, char * filename);
......@@ -139,7 +139,7 @@ count_temp(char * dirname) {
struct dirent *ent;
while ((ent=readdir(dir))) {
if (ent->d_type==DT_REG && strncmp(ent->d_name, "temp", 4)==0) {
if (ent->d_type==DT_REG && strncmp(ent->d_name, loader_temp_prefix, 6)==0) {
n++;
}
}
......
......@@ -303,12 +303,10 @@ static void run_test(void)
r = env->set_cachesize(env, CACHESIZE / 1024, (CACHESIZE % 1024)*1024*1024, 1); CKERR(r);
r = env->set_generate_row_callback_for_put(env, put_multiple_generate);
CKERR(r);
// int envflags = DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_TXN | DB_CREATE | DB_PRIVATE;
int envflags = DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN | DB_CREATE | DB_PRIVATE;
r = env->open(env, ENVDIR, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr);
//Disable auto-checkpointing
r = env->checkpointing_set_period(env, 0); CKERR(r);
r = env->checkpointing_set_period(env, 60); CKERR(r);
DBT desc;
dbt_init(&desc, "foo", sizeof("foo"));
......@@ -328,11 +326,9 @@ static void run_test(void)
generate_permute_tables();
// printf("running test_loader()\n");
// -------------------------- //
test_loader(dbs);
// -------------------------- //
// printf("done test_loader()\n");
for(int i=0;i<NUM_DBS;i++) {
dbs[i]->close(dbs[i], 0); CKERR(r);
......
......@@ -12,7 +12,6 @@ enum {MAX_NAME=128};
enum {MAX_DBS=16};
enum {MAX_ROW_LEN=1024};
int NUM_DBS=10;
int NUM_ROWS=100000;
int USE_PUTS=0;
int USE_REGION=0;
......@@ -438,11 +437,8 @@ static void do_args(int argc, char * const argv[]) {
} else if (strcmp(argv[0], "-h")==0) {
resultcode=0;
do_usage:
fprintf(stderr, "Usage: -h -c -d <num_dbs> -r <num_rows>\n%s\n", cmd);
fprintf(stderr, "Usage: -h -p -g\n%s\n", cmd);
exit(resultcode);
} else if (strcmp(argv[0], "-r")==0) {
argc--; argv++;
NUM_ROWS = atoi(argv[0]);
} else if (strcmp(argv[0], "-p")==0) {
USE_PUTS = 1;
} else if (strcmp(argv[0], "-g")==0) {
......
......@@ -67,7 +67,7 @@ static char const * const new_iname_str[NUM_DBS] = {"qo_0000_35_c_L_0.tokudb",
"qo_0003_35_c_L_3.tokudb",
"qo_0004_35_c_L_4.tokudb"};
static const char *loader_temp_prefix = "tokuld"; // 2536
static int count_temp(char * dirname);
static void get_inames(DBT* inames, DB** dbs);
static int verify_file(char const * const dirname, char const * const filename);
......@@ -82,7 +82,7 @@ count_temp(char * dirname) {
struct dirent *ent;
while ((ent=readdir(dir))) {
if (ent->d_type==DT_REG && strncmp(ent->d_name, "temp", 4)==0) {
if (ent->d_type==DT_REG && strncmp(ent->d_name, loader_temp_prefix, 6)==0) {
n++;
}
}
......
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