summaryrefslogtreecommitdiff
path: root/storage/tokudb/ft-index/ft/ftloader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/tokudb/ft-index/ft/ftloader.cc')
-rw-r--r--storage/tokudb/ft-index/ft/ftloader.cc72
1 files changed, 36 insertions, 36 deletions
diff --git a/storage/tokudb/ft-index/ft/ftloader.cc b/storage/tokudb/ft-index/ft/ftloader.cc
index d5673ccfe0d..2df6d0a1cda 100644
--- a/storage/tokudb/ft-index/ft/ftloader.cc
+++ b/storage/tokudb/ft-index/ft/ftloader.cc
@@ -91,9 +91,7 @@ PATENT RIGHTS GRANT:
#include <toku_portability.h>
-#if !TOKU_WINDOWS
#include <arpa/inet.h>
-#endif
#include <stdio.h>
#include <memory.h>
@@ -101,7 +99,9 @@ PATENT RIGHTS GRANT:
#include <toku_assert.h>
#include <string.h>
#include <fcntl.h>
-#include "x1764.h"
+
+#include <util/x1764.h>
+
#include "ftloader-internal.h"
#include "ft-internal.h"
#include "sub_block.h"
@@ -535,7 +535,7 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
CACHETABLE cachetable,
generate_row_for_put_func g,
DB *src_db,
- int N, FT_HANDLE brts[/*N*/], DB* dbs[/*N*/],
+ int N, FT_HANDLE fts[/*N*/], DB* dbs[/*N*/],
const char *new_fnames_in_env[/*N*/],
ft_compare_func bt_compare_functions[/*N*/],
const char *temp_file_template,
@@ -581,11 +581,11 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
#define SET_TO_MY_STRDUP(lval, s) do { char *v = toku_strdup(s); if (!v) { int r = get_error_errno(); toku_ft_loader_internal_destroy(bl, true); return r; } lval = v; } while (0)
MY_CALLOC_N(N, bl->root_xids_that_created);
- for (int i=0; i<N; i++) if (brts[i]) bl->root_xids_that_created[i]=brts[i]->ft->h->root_xid_that_created;
+ for (int i=0; i<N; i++) if (fts[i]) bl->root_xids_that_created[i]=fts[i]->ft->h->root_xid_that_created;
MY_CALLOC_N(N, bl->dbs);
- for (int i=0; i<N; i++) if (brts[i]) bl->dbs[i]=dbs[i];
+ for (int i=0; i<N; i++) if (fts[i]) bl->dbs[i]=dbs[i];
MY_CALLOC_N(N, bl->descriptors);
- for (int i=0; i<N; i++) if (brts[i]) bl->descriptors[i]=&brts[i]->ft->descriptor;
+ for (int i=0; i<N; i++) if (fts[i]) bl->descriptors[i]=&fts[i]->ft->descriptor;
MY_CALLOC_N(N, bl->new_fnames_in_env);
for (int i=0; i<N; i++) SET_TO_MY_STRDUP(bl->new_fnames_in_env[i], new_fnames_in_env[i]);
MY_CALLOC_N(N, bl->extracted_datasizes); // the calloc_n zeroed everything, which is what we want
@@ -642,7 +642,7 @@ int toku_ft_loader_open (/* out */ FTLOADER *blp,
CACHETABLE cachetable,
generate_row_for_put_func g,
DB *src_db,
- int N, FT_HANDLE brts[/*N*/], DB* dbs[/*N*/],
+ int N, FT_HANDLE fts[/*N*/], DB* dbs[/*N*/],
const char *new_fnames_in_env[/*N*/],
ft_compare_func bt_compare_functions[/*N*/],
const char *temp_file_template,
@@ -651,9 +651,9 @@ int toku_ft_loader_open (/* out */ FTLOADER *blp,
bool reserve_memory,
uint64_t reserve_memory_size,
bool compress_intermediates)
-/* Effect: called by DB_ENV->create_loader to create a brt loader.
+/* Effect: called by DB_ENV->create_loader to create an ft loader.
* Arguments:
- * blp Return the brt loader here.
+ * blp Return the ft loader here.
* g The function for generating a row
* src_db The source database. Needed by g. May be NULL if that's ok with g.
* N The number of dbs to create.
@@ -666,15 +666,15 @@ int toku_ft_loader_open (/* out */ FTLOADER *blp,
int result = 0;
{
int r = toku_ft_loader_internal_init(blp, cachetable, g, src_db,
- N, brts, dbs,
- new_fnames_in_env,
- bt_compare_functions,
- temp_file_template,
- load_lsn,
- txn,
- reserve_memory,
- reserve_memory_size,
- compress_intermediates);
+ N, fts, dbs,
+ new_fnames_in_env,
+ bt_compare_functions,
+ temp_file_template,
+ load_lsn,
+ txn,
+ reserve_memory,
+ reserve_memory_size,
+ compress_intermediates);
if (r!=0) result = r;
}
if (result==0) {
@@ -1370,7 +1370,7 @@ static int process_primary_rows (FTLOADER bl, struct rowset *primary_rowset) {
}
int toku_ft_loader_put (FTLOADER bl, DBT *key, DBT *val)
-/* Effect: Put a key-value pair into the brt loader. Called by DB_LOADER->put().
+/* Effect: Put a key-value pair into the ft loader. Called by DB_LOADER->put().
* Return value: 0 on success, an error number otherwise.
*/
{
@@ -2621,7 +2621,7 @@ static int toku_loader_write_ft_from_q (FTLOADER bl,
char *XMALLOC_N(desc_size, buf);
wbuf_init(&wbuf, buf, desc_size);
toku_serialize_descriptor_contents_to_wbuf(&wbuf, descriptor);
- uint32_t checksum = x1764_finish(&wbuf.checksum);
+ uint32_t checksum = toku_x1764_finish(&wbuf.checksum);
wbuf_int(&wbuf, checksum);
invariant(wbuf.ndone==desc_size);
r = toku_os_write(out.fd, wbuf.buf, wbuf.ndone);
@@ -2672,17 +2672,17 @@ static int toku_loader_write_ft_from_q (FTLOADER bl,
return result;
}
-int toku_loader_write_brt_from_q_in_C (FTLOADER bl,
- const DESCRIPTOR descriptor,
- int fd, // write to here
- int progress_allocation,
- QUEUE q,
- uint64_t total_disksize_estimate,
- int which_db,
- uint32_t target_nodesize,
- uint32_t target_basementnodesize,
- enum toku_compression_method target_compression_method,
- uint32_t target_fanout)
+int toku_loader_write_ft_from_q_in_C (FTLOADER bl,
+ const DESCRIPTOR descriptor,
+ int fd, // write to here
+ int progress_allocation,
+ QUEUE q,
+ uint64_t total_disksize_estimate,
+ int which_db,
+ uint32_t target_nodesize,
+ uint32_t target_basementnodesize,
+ enum toku_compression_method target_compression_method,
+ uint32_t target_fanout)
// This is probably only for testing.
{
target_nodesize = target_nodesize == 0 ? default_loader_nodesize : target_nodesize;
@@ -2917,17 +2917,17 @@ static void add_pair_to_leafnode (struct leaf_buf *lbuf, unsigned char *key, int
// #3588 TODO just make a clean ule and append it to the omt
// #3588 TODO can do the rebalancing here and avoid a lot of work later
FTNODE leafnode = lbuf->node;
- uint32_t idx = BLB_DATA(leafnode, 0)->omt_size();
+ uint32_t idx = BLB_DATA(leafnode, 0)->num_klpairs();
DBT thekey = { .data = key, .size = (uint32_t) keylen };
DBT theval = { .data = val, .size = (uint32_t) vallen };
- FT_MSG_S cmd = { .type = FT_INSERT,
+ FT_MSG_S msg = { .type = FT_INSERT,
.msn = ZERO_MSN,
.xids = lbuf->xids,
.u = { .id = { &thekey, &theval } } };
uint64_t workdone=0;
// there's no mvcc garbage in a bulk-loaded FT, so there's no need to pass useful gc info
txn_gc_info gc_info(nullptr, TXNID_NONE, TXNID_NONE, true);
- toku_ft_bn_apply_cmd_once(BLB(leafnode,0), &cmd, idx, NULL, &gc_info, &workdone, stats_to_update);
+ toku_ft_bn_apply_msg_once(BLB(leafnode,0), &msg, idx, NULL, &gc_info, &workdone, stats_to_update);
}
static int write_literal(struct dbout *out, void*data, size_t len) {
@@ -2992,7 +2992,7 @@ static int write_translation_table (struct dbout *out, long long *off_of_transla
putbuf_int64(&ttable, out->translation[i].off);
putbuf_int64(&ttable, out->translation[i].size);
}
- unsigned int checksum = x1764_memory(ttable.buf, ttable.off);
+ unsigned int checksum = toku_x1764_memory(ttable.buf, ttable.off);
putbuf_int32(&ttable, checksum);
// pad it to 512 zeros
long long encoded_length = ttable.off;