Commit 62b7146b 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 b15e793a
...@@ -122,7 +122,8 @@ static int verify_empty(DB *db, DB_TXN *txn) ...@@ -122,7 +122,8 @@ static int verify_empty(DB *db, DB_TXN *txn)
return r; 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"; static const char *loader_temp_suffix = "XXXXXX";
int toku_loader_create_loader(DB_ENV *env, int toku_loader_create_loader(DB_ENV *env,
......
...@@ -79,7 +79,7 @@ enum {MAGIC=311}; ...@@ -79,7 +79,7 @@ enum {MAGIC=311};
DBT old_inames[MAX_DBS]; DBT old_inames[MAX_DBS];
DBT new_inames[MAX_DBS]; DBT new_inames[MAX_DBS];
static const char *loader_temp_prefix = "tokuld"; // 2536
static int count_temp(char * dirname); static int count_temp(char * dirname);
static void get_inames(DBT* inames, DB** dbs); static void get_inames(DBT* inames, DB** dbs);
static int verify_file(char * dirname, char * filename); static int verify_file(char * dirname, char * filename);
...@@ -139,7 +139,7 @@ count_temp(char * dirname) { ...@@ -139,7 +139,7 @@ count_temp(char * dirname) {
struct dirent *ent; struct dirent *ent;
while ((ent=readdir(dir))) { 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++; n++;
} }
} }
......
...@@ -295,7 +295,7 @@ static void run_test(void) ...@@ -295,7 +295,7 @@ static void run_test(void)
assert(r<len); assert(r<len);
r = system(syscmd); CKERR(r); r = system(syscmd); CKERR(r);
} }
r = toku_os_mkdir(env_dir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r); r = toku_os_mkdir(env_dir, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = db_env_create(&env, 0); CKERR(r); r = db_env_create(&env, 0); CKERR(r);
r = env->set_default_bt_compare(env, uint_dbt_cmp); CKERR(r); r = env->set_default_bt_compare(env, uint_dbt_cmp); CKERR(r);
...@@ -303,12 +303,10 @@ static void run_test(void) ...@@ -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_cachesize(env, CACHESIZE / 1024, (CACHESIZE % 1024)*1024*1024, 1); CKERR(r);
r = env->set_generate_row_callback_for_put(env, put_multiple_generate); r = env->set_generate_row_callback_for_put(env, put_multiple_generate);
CKERR(r); 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; 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); r = env->open(env, ENVDIR, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
env->set_errfile(env, stderr); env->set_errfile(env, stderr);
//Disable auto-checkpointing r = env->checkpointing_set_period(env, 60); CKERR(r);
r = env->checkpointing_set_period(env, 0); CKERR(r);
DBT desc; DBT desc;
dbt_init(&desc, "foo", sizeof("foo")); dbt_init(&desc, "foo", sizeof("foo"));
...@@ -328,11 +326,9 @@ static void run_test(void) ...@@ -328,11 +326,9 @@ static void run_test(void)
generate_permute_tables(); generate_permute_tables();
// printf("running test_loader()\n");
// -------------------------- // // -------------------------- //
test_loader(dbs); test_loader(dbs);
// -------------------------- // // -------------------------- //
// printf("done test_loader()\n");
for(int i=0;i<NUM_DBS;i++) { for(int i=0;i<NUM_DBS;i++) {
dbs[i]->close(dbs[i], 0); CKERR(r); dbs[i]->close(dbs[i], 0); CKERR(r);
......
...@@ -12,7 +12,6 @@ enum {MAX_NAME=128}; ...@@ -12,7 +12,6 @@ enum {MAX_NAME=128};
enum {MAX_DBS=16}; enum {MAX_DBS=16};
enum {MAX_ROW_LEN=1024}; enum {MAX_ROW_LEN=1024};
int NUM_DBS=10; int NUM_DBS=10;
int NUM_ROWS=100000;
int USE_PUTS=0; int USE_PUTS=0;
int USE_REGION=0; int USE_REGION=0;
...@@ -438,11 +437,8 @@ static void do_args(int argc, char * const argv[]) { ...@@ -438,11 +437,8 @@ static void do_args(int argc, char * const argv[]) {
} else if (strcmp(argv[0], "-h")==0) { } else if (strcmp(argv[0], "-h")==0) {
resultcode=0; resultcode=0;
do_usage: 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); exit(resultcode);
} else if (strcmp(argv[0], "-r")==0) {
argc--; argv++;
NUM_ROWS = atoi(argv[0]);
} else if (strcmp(argv[0], "-p")==0) { } else if (strcmp(argv[0], "-p")==0) {
USE_PUTS = 1; USE_PUTS = 1;
} else if (strcmp(argv[0], "-g")==0) { } 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", ...@@ -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_0003_35_c_L_3.tokudb",
"qo_0004_35_c_L_4.tokudb"}; "qo_0004_35_c_L_4.tokudb"};
static const char *loader_temp_prefix = "tokuld"; // 2536
static int count_temp(char * dirname); static int count_temp(char * dirname);
static void get_inames(DBT* inames, DB** dbs); static void get_inames(DBT* inames, DB** dbs);
static int verify_file(char const * const dirname, char const * const filename); static int verify_file(char const * const dirname, char const * const filename);
...@@ -82,7 +82,7 @@ count_temp(char * dirname) { ...@@ -82,7 +82,7 @@ count_temp(char * dirname) {
struct dirent *ent; struct dirent *ent;
while ((ent=readdir(dir))) { 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++; 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