Commit 3bfdfa29 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Get rid of the gratuitous IDX files.

git-svn-id: file:///svn/toku/tokudb@18835 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0db1dce5
......@@ -41,7 +41,6 @@ struct brtloader_s {
const char *temp_file_template;
FIDX fprimary_rows; // the file index (in the file_infos) for the data
FIDX fprimary_idx; // the file index for the index
u_int64_t fprimary_offset;
CACHETABLE cachetable;
/* To make it easier to recover from errors, we don't use FILE*, instead we use an index into the file_infos. */
......@@ -74,7 +73,7 @@ int init_rowset (struct rowset *rows);
void destroy_rowset (struct rowset *rows);
void add_row (struct rowset *rows, DBT *key, DBT *val);
int loader_write_row(DBT *key, DBT *val, FIDX data, FIDX idx, u_int64_t *dataoff, BRTLOADER bl);
int loader_write_row(DBT *key, DBT *val, FIDX data, u_int64_t *dataoff, BRTLOADER bl);
int loader_read_row (FIDX f, DBT *key, DBT *val, BRTLOADER bl);
struct error_callback_s {
......@@ -93,7 +92,6 @@ int mergesort_row_array (struct row rows[/*n*/], int n, DB *dest_db, brt_compare
struct merge_fileset {
int n_temp_files, n_temp_files_limit;
FIDX *data_fidxs;
FIDX *idx_fidxs;
};
void init_merge_fileset (struct merge_fileset *fs);
......
This diff is collapsed.
......@@ -169,10 +169,6 @@ static void test_read_write_rows (char *template) {
r = brtloader_open_temp_file(&bl, &file);
CKERR(r);
FIDX idx;
r = brtloader_open_temp_file(&bl, &idx);
CKERR(r);
u_int64_t dataoff=0;
char *keystrings[] = {"abc", "b", "cefgh"};
......@@ -181,7 +177,7 @@ static void test_read_write_rows (char *template) {
for (int i=0; i<3; i++) {
DBT key = {.size=strlen(keystrings[i]), .data=keystrings[i]};
DBT val = {.size=strlen(valstrings[i]), .data=valstrings[i]};
r = loader_write_row(&key, &val, file, idx, &dataoff, &bl);
r = loader_write_row(&key, &val, file, &dataoff, &bl);
CKERR(r);
actual_size+=key.size + val.size + 8;
}
......@@ -212,13 +208,9 @@ static void test_read_write_rows (char *template) {
}
r = brtloader_fi_close(&bl.file_infos, file);
CKERR(r);
r = brtloader_fi_close(&bl.file_infos, idx);
CKERR(r);
r = brtloader_fi_unlink(&bl.file_infos, file);
CKERR(r);
r = brtloader_fi_unlink(&bl.file_infos, idx);
CKERR(r);
assert(bl.file_infos.n_files_open==0);
assert(bl.file_infos.n_files_extant==0);
......@@ -264,7 +256,7 @@ static void test_merge_files (char *template) {
assert(fs.n_temp_files==2 && fs.n_temp_files_limit >= fs.n_temp_files);
destroy_rowset(&aset);
destroy_rowset(&bset);
for (int i=0; i<2; i++) assert(fs.data_fidxs[i].idx != -1 && fs.idx_fidxs[i].idx != -1);
for (int i=0; i<2; i++) assert(fs.data_fidxs[i].idx != -1);
r = merge_files(&fs, &bl, dest_db, compare_ints, &cb, 0); CKERR(r);
......@@ -284,8 +276,6 @@ static void test_merge_files (char *template) {
CKERR(r);
r = brtloader_fi_unlink(&bl.file_infos, fs.data_fidxs[0]);
CKERR(r);
r = brtloader_fi_unlink(&bl.file_infos, fs.idx_fidxs[0]);
CKERR(r);
destroy_merge_fileset(&fs);
brtloader_fi_destroy(&bl.file_infos, FALSE);
......
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