Commit cdb39d8f authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4869 remove dead code from fifo.c refs[t:4869]

git-svn-id: file:///svn/toku/tokudb@43488 c7de825b-a66e-492c-adef-691d508d4ae1
parent cca7d883
......@@ -99,27 +99,6 @@ int toku_fifo_enq(FIFO fifo, const void *key, unsigned int keylen, const void *d
return 0;
}
int toku_fifo_enq_cmdstruct (FIFO fifo, const BRT_MSG cmd, bool is_fresh, long *dest) {
return toku_fifo_enq(fifo, cmd->u.id.key->data, cmd->u.id.key->size, cmd->u.id.val->data, cmd->u.id.val->size, cmd->type, cmd->msn, cmd->xids, is_fresh, dest);
}
#if 0
// fill in the BRT_MSG, using the two DBTs for the DBT part.
int toku_fifo_peek_cmdstruct (FIFO fifo, BRT_MSG cmd, DBT*key, DBT*data) {
u_int32_t type;
bytevec keyb,datab;
unsigned int keylen,datalen;
int r = toku_fifo_peek(fifo, &keyb, &keylen, &datab, &datalen, &type, &cmd->xids);
if (r!=0) return r;
cmd->type=(enum brt_msg_type)type;
toku_fill_dbt(key, keyb, keylen);
toku_fill_dbt(data, datab, datalen);
cmd->u.id.key=key;
cmd->u.id.val=data;
return 0;
}
#endif
int toku_fifo_iterate_internal_start(FIFO UU(fifo)) { return 0; }
int toku_fifo_iterate_internal_has_more(FIFO fifo, int off) { return off < fifo->memory_used; }
int toku_fifo_iterate_internal_next(FIFO fifo, int off) {
......@@ -136,19 +115,6 @@ void toku_fifo_iterate (FIFO fifo, void(*f)(bytevec key,ITEMLEN keylen,bytevec d
f(key,keylen,data,datalen,type,msn,xids,is_fresh, arg));
}
void toku_fifo_size_is_stabilized(FIFO fifo) {
if (fifo->memory_used < fifo->memory_size/2) {
char *old_memory = fifo->memory;
int new_memory_size = fifo->memory_used*2;
char *new_memory = toku_xmalloc(new_memory_size);
memcpy(new_memory, old_memory, fifo->memory_used);
fifo->memory = new_memory;
fifo->memory_size = new_memory_size;
toku_free(old_memory);
}
}
unsigned int toku_fifo_buffer_size_in_use (FIFO fifo) {
return fifo->memory_used;
}
......@@ -163,10 +129,6 @@ unsigned long toku_fifo_memory_footprint(FIFO fifo) {
return rval;
}
unsigned long toku_fifo_memory_size(FIFO fifo) {
return sizeof(*fifo)+fifo->memory_size;
}
DBT *fill_dbt_for_fifo_entry(DBT *dbt, const struct fifo_entry *entry) {
return toku_fill_dbt(dbt, xids_get_end_of_array((XIDS) &entry->xids_s), entry->keylen);
}
......
......@@ -54,24 +54,15 @@ int toku_fifo_create(FIFO *);
void toku_fifo_free(FIFO *);
void toku_fifo_size_is_stabilized(FIFO);
// Effect: Tell the FIFO that we may have just inserted or removed a bunch of stuff, and now may be a good time to resize memory.
int toku_fifo_n_entries(FIFO);
int toku_fifo_enq_cmdstruct (FIFO fifo, const BRT_MSG cmd, bool is_fresh, long *dest);
int toku_fifo_enq (FIFO, const void *key, ITEMLEN keylen, const void *data, ITEMLEN datalen, enum brt_msg_type type, MSN msn, XIDS xids, bool is_fresh, long *dest);
// int toku_fifo_peek_cmdstruct (FIFO, BRT_MSG, DBT*, DBT*); // fill in the BRT_MSG, using the two DBTs for the DBT part.
// THIS ONLY REMAINS FOR TESTING, DO NOT USE IT IN CODE
unsigned int toku_fifo_buffer_size_in_use (FIFO fifo);
unsigned long toku_fifo_memory_size_in_use(FIFO fifo); // return how much memory in the fifo holds useful data
unsigned long toku_fifo_memory_footprint(FIFO fifo); // return how much memory the fifo occupies
unsigned long toku_fifo_memory_size(FIFO); // return how much memory fifo has allocated
//These two are problematic, since I don't want to malloc() the bytevecs, but dequeueing the fifo frees the memory.
//int toku_fifo_peek_deq (FIFO, bytevec *key, ITEMLEN *keylen, bytevec *data, ITEMLEN *datalen, u_int32_t *type, TXNID *xid);
//int toku_fifo_peek_deq_cmdstruct (FIFO, BRT_MSG, DBT*, DBT*); // fill in the BRT_MSG, using the two DBTs for the DBT part.
......
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