Commit 0cc59b69 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:4094] Closes #4094 Delete obsolete symbol OMT_ITEM_OVERHEAD (which was defined as zero).

git-svn-id: file:///svn/toku/tokudb@36450 c7de825b-a66e-492c-adef-691d508d4ae1
parent 65ba8b28
...@@ -36,7 +36,6 @@ C_BEGIN ...@@ -36,7 +36,6 @@ C_BEGIN
#endif #endif
enum { TREE_FANOUT = BRT_FANOUT }; enum { TREE_FANOUT = BRT_FANOUT };
enum { KEY_VALUE_OVERHEAD = 8 }; /* Must store the two lengths. */ enum { KEY_VALUE_OVERHEAD = 8 }; /* Must store the two lengths. */
enum { OMT_ITEM_OVERHEAD = 0 }; /* No overhead for the OMT item. The PMA needed to know the idx, but the OMT doesn't. */
enum { BRT_CMD_OVERHEAD = (2 + sizeof(MSN)) // the type plus freshness plus MSN enum { BRT_CMD_OVERHEAD = (2 + sizeof(MSN)) // the type plus freshness plus MSN
}; };
......
...@@ -472,7 +472,7 @@ sum_item (OMTVALUE lev, u_int32_t UU(idx), void *vsi) { ...@@ -472,7 +472,7 @@ sum_item (OMTVALUE lev, u_int32_t UU(idx), void *vsi) {
LEAFENTRY le=lev; LEAFENTRY le=lev;
struct sum_info *si = vsi; struct sum_info *si = vsi;
si->count++; si->count++;
si->dsum += OMT_ITEM_OVERHEAD + leafentry_disksize(le); si->dsum += leafentry_disksize(le);
si->msum += leafentry_memsize(le); si->msum += leafentry_memsize(le);
return 0; return 0;
} }
...@@ -1287,7 +1287,7 @@ deserialize_brtnode_partition( ...@@ -1287,7 +1287,7 @@ deserialize_brtnode_partition(
memcpy(array[i], le, disksize); memcpy(array[i], le, disksize);
} }
u_int32_t end_of_data = rb.ndone; u_int32_t end_of_data = rb.ndone;
BLB_NBYTESINBUF(node, index) += end_of_data-start_of_data + num_entries*OMT_ITEM_OVERHEAD; BLB_NBYTESINBUF(node, index) += end_of_data-start_of_data;
// destroy old buffer that was created by toku_setup_basementnode, so we can create a new one // destroy old buffer that was created by toku_setup_basementnode, so we can create a new one
toku_omt_destroy(&BLB_BUFFER(node, index)); toku_omt_destroy(&BLB_BUFFER(node, index));
int r = toku_omt_create_steal_sorted_array(&BLB_BUFFER(node, index), &array, num_entries, num_entries); int r = toku_omt_create_steal_sorted_array(&BLB_BUFFER(node, index), &array, num_entries, num_entries);
......
...@@ -150,7 +150,7 @@ int toku_testsetup_insert_to_leaf (BRT brt, BLOCKNUM blocknum, char *key, int ke ...@@ -150,7 +150,7 @@ int toku_testsetup_insert_to_leaf (BRT brt, BLOCKNUM blocknum, char *key, int ke
if (r==0) { if (r==0) {
LEAFENTRY storeddata=storeddatav; LEAFENTRY storeddata=storeddatav;
// It's already there. So now we have to remove it and put the new one back in. // It's already there. So now we have to remove it and put the new one back in.
BLB_NBYTESINBUF(node, 0) -= OMT_ITEM_OVERHEAD + leafentry_disksize(storeddata); BLB_NBYTESINBUF(node, 0) -= leafentry_disksize(storeddata);
toku_free(storeddata); toku_free(storeddata);
// Now put the new kv in. // Now put the new kv in.
toku_omt_set_at(BLB_BUFFER(node, 0), leafentry, idx); toku_omt_set_at(BLB_BUFFER(node, 0), leafentry, idx);
...@@ -161,7 +161,7 @@ int toku_testsetup_insert_to_leaf (BRT brt, BLOCKNUM blocknum, char *key, int ke ...@@ -161,7 +161,7 @@ int toku_testsetup_insert_to_leaf (BRT brt, BLOCKNUM blocknum, char *key, int ke
// hack to get tests passing. These tests should not be directly inserting into buffers // hack to get tests passing. These tests should not be directly inserting into buffers
BLB(node, 0)->max_msn_applied = msn; BLB(node, 0)->max_msn_applied = msn;
BLB_NBYTESINBUF(node, 0) += OMT_ITEM_OVERHEAD + disksize; BLB_NBYTESINBUF(node, 0) += disksize;
node->dirty=1; node->dirty=1;
......
...@@ -1505,7 +1505,7 @@ move_leafentries( ...@@ -1505,7 +1505,7 @@ move_leafentries(
se_diff->ndata++; se_diff->ndata++;
se_diff->dsize += le_keylen(curr_le) + le_latest_vallen(curr_le); se_diff->dsize += le_keylen(curr_le) + le_latest_vallen(curr_le);
*num_bytes_moved += OMT_ITEM_OVERHEAD + leafentry_disksize(curr_le); *num_bytes_moved += leafentry_disksize(curr_le);
new_le[i-lbi] = curr_le; new_le[i-lbi] = curr_le;
} }
...@@ -1991,7 +1991,7 @@ brt_leaf_delete_leafentry ( ...@@ -1991,7 +1991,7 @@ brt_leaf_delete_leafentry (
assert(r==0); assert(r==0);
} }
bn->n_bytes_in_buffer -= OMT_ITEM_OVERHEAD + leafentry_disksize(le); bn->n_bytes_in_buffer -= leafentry_disksize(le);
{ {
u_int32_t oldlen = le_latest_vallen(le) + le_keylen(le); u_int32_t oldlen = le_latest_vallen(le) + le_keylen(le);
...@@ -2046,12 +2046,12 @@ brt_leaf_apply_cmd_once ( ...@@ -2046,12 +2046,12 @@ brt_leaf_apply_cmd_once (
assert(se->dsize < (1U<<31)); // make sure we didn't underflow assert(se->dsize < (1U<<31)); // make sure we didn't underflow
} }
bn->n_bytes_in_buffer -= OMT_ITEM_OVERHEAD + leafentry_disksize(le); bn->n_bytes_in_buffer -= leafentry_disksize(le);
//printf("%s:%d Added %u-%u got %lu\n", __FILE__, __LINE__, le_keylen(new_le), le_latest_vallen(le), node->u.l.leaf_stats.dsize); //printf("%s:%d Added %u-%u got %lu\n", __FILE__, __LINE__, le_keylen(new_le), le_latest_vallen(le), node->u.l.leaf_stats.dsize);
// the ndata and nkeys remains unchanged // the ndata and nkeys remains unchanged
bn->n_bytes_in_buffer += OMT_ITEM_OVERHEAD + newdisksize; bn->n_bytes_in_buffer += newdisksize;
{ int r = toku_omt_set_at(bn->buffer, new_le, idx); assert(r==0); } { int r = toku_omt_set_at(bn->buffer, new_le, idx); assert(r==0); }
toku_free(le); toku_free(le);
...@@ -2068,7 +2068,7 @@ brt_leaf_apply_cmd_once ( ...@@ -2068,7 +2068,7 @@ brt_leaf_apply_cmd_once (
int r = toku_omt_insert_at(bn->buffer, new_le, idx); int r = toku_omt_insert_at(bn->buffer, new_le, idx);
assert(r==0); assert(r==0);
bn->n_bytes_in_buffer += OMT_ITEM_OVERHEAD + newdisksize; bn->n_bytes_in_buffer += newdisksize;
se->dsize += le_latest_vallen(new_le) + le_keylen(new_le); se->dsize += le_latest_vallen(new_le) + le_keylen(new_le);
assert(se->dsize < (1U<<31)); // make sure we didn't underflow assert(se->dsize < (1U<<31)); // make sure we didn't underflow
......
...@@ -357,7 +357,7 @@ test_serialize_leaf_with_large_pivots(enum brtnode_verify_type bft) { ...@@ -357,7 +357,7 @@ test_serialize_leaf_with_large_pivots(enum brtnode_verify_type bft) {
} }
for (int i = 0; i < nrows; ++i) { for (int i = 0; i < nrows; ++i) {
r = toku_omt_insert(BLB_BUFFER(&sn, i), les[i], omt_cmp, les[i], NULL); assert(r==0); r = toku_omt_insert(BLB_BUFFER(&sn, i), les[i], omt_cmp, les[i], NULL); assert(r==0);
BLB_NBYTESINBUF(&sn, i) = OMT_ITEM_OVERHEAD + leafentry_disksize(les[i]); BLB_NBYTESINBUF(&sn, i) = leafentry_disksize(les[i]);
if (i < nrows-1) { if (i < nrows-1) {
u_int32_t keylen; u_int32_t keylen;
char *key = le_key_and_len(les[i], &keylen); char *key = le_key_and_len(les[i], &keylen);
...@@ -480,7 +480,7 @@ test_serialize_leaf_with_many_rows(enum brtnode_verify_type bft) { ...@@ -480,7 +480,7 @@ test_serialize_leaf_with_many_rows(enum brtnode_verify_type bft) {
BLB_NBYTESINBUF(&sn, 0) = 0; BLB_NBYTESINBUF(&sn, 0) = 0;
for (int i = 0; i < nrows; ++i) { for (int i = 0; i < nrows; ++i) {
r = toku_omt_insert(BLB_BUFFER(&sn, 0), les[i], omt_int_cmp, les[i], NULL); assert(r==0); r = toku_omt_insert(BLB_BUFFER(&sn, 0), les[i], omt_int_cmp, les[i], NULL); assert(r==0);
BLB_NBYTESINBUF(&sn, 0) += OMT_ITEM_OVERHEAD + leafentry_disksize(les[i]); BLB_NBYTESINBUF(&sn, 0) += leafentry_disksize(les[i]);
} }
struct brt *XMALLOC(brt); struct brt *XMALLOC(brt);
...@@ -604,7 +604,7 @@ test_serialize_leaf_with_large_rows(enum brtnode_verify_type bft) { ...@@ -604,7 +604,7 @@ test_serialize_leaf_with_large_rows(enum brtnode_verify_type bft) {
BLB_NBYTESINBUF(&sn, 0) = 0; BLB_NBYTESINBUF(&sn, 0) = 0;
for (int i = 0; i < 7; ++i) { for (int i = 0; i < 7; ++i) {
r = toku_omt_insert(BLB_BUFFER(&sn, 0), les[i], omt_cmp, les[i], NULL); assert(r==0); r = toku_omt_insert(BLB_BUFFER(&sn, 0), les[i], omt_cmp, les[i], NULL); assert(r==0);
BLB_NBYTESINBUF(&sn, 0) += OMT_ITEM_OVERHEAD + leafentry_disksize(les[i]); BLB_NBYTESINBUF(&sn, 0) += leafentry_disksize(les[i]);
} }
struct brt *XMALLOC(brt); struct brt *XMALLOC(brt);
......
...@@ -85,7 +85,7 @@ test_split_on_boundary(void) ...@@ -85,7 +85,7 @@ test_split_on_boundary(void)
memset(val, k, sizeof val); memset(val, k, sizeof val);
elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen); elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen);
r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(elts[k]);
} }
if (bn < sn.n_children - 1) { if (bn < sn.n_children - 1) {
sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0); sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0);
...@@ -170,7 +170,7 @@ test_split_with_everything_on_the_left(void) ...@@ -170,7 +170,7 @@ test_split_with_everything_on_the_left(void)
memset(val, k, sizeof val); memset(val, k, sizeof val);
elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen); elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen);
r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(elts[k]);
} }
sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0); sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0);
sn.totalchildkeylens += (sizeof k); sn.totalchildkeylens += (sizeof k);
...@@ -180,7 +180,7 @@ test_split_with_everything_on_the_left(void) ...@@ -180,7 +180,7 @@ test_split_with_everything_on_the_left(void)
memset(big_val, k, nelts * eltsize - 1); memset(big_val, k, nelts * eltsize - 1);
big_element = le_fastmalloc((char *) &k, keylen, big_val, nelts * eltsize - 1); big_element = le_fastmalloc((char *) &k, keylen, big_val, nelts * eltsize - 1);
r = toku_omt_insert(BLB_BUFFER(&sn, bn), big_element, omt_long_cmp, big_element, NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), big_element, omt_long_cmp, big_element, NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(big_element); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(big_element);
} }
} }
...@@ -264,7 +264,7 @@ test_split_on_boundary_of_last_node(void) ...@@ -264,7 +264,7 @@ test_split_on_boundary_of_last_node(void)
memset(val, k, sizeof val); memset(val, k, sizeof val);
elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen); elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen);
r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(elts[k]);
} }
sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0); sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0);
sn.totalchildkeylens += (sizeof k); sn.totalchildkeylens += (sizeof k);
...@@ -274,7 +274,7 @@ test_split_on_boundary_of_last_node(void) ...@@ -274,7 +274,7 @@ test_split_on_boundary_of_last_node(void)
memset(big_val, k, nelts * eltsize - 100); memset(big_val, k, nelts * eltsize - 100);
big_element = le_fastmalloc((char *) &k, keylen, big_val, nelts * eltsize - 100); big_element = le_fastmalloc((char *) &k, keylen, big_val, nelts * eltsize - 100);
r = toku_omt_insert(BLB_BUFFER(&sn, bn), big_element, omt_long_cmp, big_element, NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), big_element, omt_long_cmp, big_element, NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(big_element); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(big_element);
} }
} }
...@@ -361,8 +361,8 @@ test_split_at_begin(void) ...@@ -361,8 +361,8 @@ test_split_at_begin(void)
memset(val, k, sizeof val); memset(val, k, sizeof val);
elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen); elts[k] = le_fastmalloc((char *) &k, keylen, val, vallen);
r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(elts[k]);
totalbytes += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); totalbytes += leafentry_disksize(elts[k]);
} }
if (bn < sn.n_children - 1) { if (bn < sn.n_children - 1) {
sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0); sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0);
...@@ -375,8 +375,8 @@ test_split_at_begin(void) ...@@ -375,8 +375,8 @@ test_split_at_begin(void)
memset(val, k, sizeof val); memset(val, k, sizeof val);
elts[k] = le_fastmalloc((char *) &k, keylen, val, totalbytes + 3); elts[k] = le_fastmalloc((char *) &k, keylen, val, totalbytes + 3);
r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(elts[k]);
totalbytes += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); totalbytes += leafentry_disksize(elts[k]);
} }
unlink(fname); unlink(fname);
...@@ -460,8 +460,8 @@ test_split_at_end(void) ...@@ -460,8 +460,8 @@ test_split_at_end(void)
elts[k] = le_fastmalloc((char *) &k, keylen, val, totalbytes + 3); elts[k] = le_fastmalloc((char *) &k, keylen, val, totalbytes + 3);
} }
r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0); r = toku_omt_insert(BLB_BUFFER(&sn, bn), elts[k], omt_long_cmp, elts[k], NULL); assert(r == 0);
BLB_NBYTESINBUF(&sn, bn) += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); BLB_NBYTESINBUF(&sn, bn) += leafentry_disksize(elts[k]);
totalbytes += OMT_ITEM_OVERHEAD + leafentry_disksize(elts[k]); totalbytes += leafentry_disksize(elts[k]);
} }
if (bn < sn.n_children - 1) { if (bn < sn.n_children - 1) {
sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0); sn.childkeys[bn] = kv_pair_malloc(&k, sizeof k, 0, 0);
......
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