Commit 83b56c3c authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#2877 refs[t:2877] remove kruft from the cachetable

git-svn-id: file:///svn/toku/tokudb@23180 c7de825b-a66e-492c-adef-691d508d4ae1
parent f1430e88
...@@ -33,13 +33,6 @@ static void cachetable_writer(WORKITEM); ...@@ -33,13 +33,6 @@ static void cachetable_writer(WORKITEM);
static void cachetable_reader(WORKITEM); static void cachetable_reader(WORKITEM);
#endif #endif
// use cachetable locks 0->no 1->yes
#define DO_CACHETABLE_LOCK 1
// simulate long latency write operations with usleep. time in milliseconds.
#define DO_CALLBACK_USLEEP 0
#define DO_CALLBACK_BUSYWAIT 0
#define TRACE_CACHETABLE 0 #define TRACE_CACHETABLE 0
#if TRACE_CACHETABLE #if TRACE_CACHETABLE
#define WHEN_TRACE_CT(x) x #define WHEN_TRACE_CT(x) x
...@@ -183,18 +176,14 @@ static inline void cachefiles_unlock(CACHETABLE ct) { ...@@ -183,18 +176,14 @@ static inline void cachefiles_unlock(CACHETABLE ct) {
// Lock the cachetable // Lock the cachetable
static inline void cachetable_lock(CACHETABLE ct __attribute__((unused))) { static inline void cachetable_lock(CACHETABLE ct __attribute__((unused))) {
#if DO_CACHETABLE_LOCK
int r = toku_pthread_mutex_lock(ct->mutex); assert(r == 0); int r = toku_pthread_mutex_lock(ct->mutex); assert(r == 0);
cachetable_lock_taken++; cachetable_lock_taken++;
#endif
} }
// Unlock the cachetable // Unlock the cachetable
static inline void cachetable_unlock(CACHETABLE ct __attribute__((unused))) { static inline void cachetable_unlock(CACHETABLE ct __attribute__((unused))) {
#if DO_CACHETABLE_LOCK
cachetable_lock_released++; cachetable_lock_released++;
int r = toku_pthread_mutex_unlock(ct->mutex); assert(r == 0); int r = toku_pthread_mutex_unlock(ct->mutex); assert(r == 0);
#endif
} }
// Wait for cache table space to become available // Wait for cache table space to become available
...@@ -1170,21 +1159,6 @@ static void cachetable_write_pair(CACHETABLE ct, PAIR p) { ...@@ -1170,21 +1159,6 @@ static void cachetable_write_pair(CACHETABLE ct, PAIR p) {
// write callback // write callback
if (toku_cachefile_is_dev_null_unlocked(cachefile)) dowrite = FALSE; if (toku_cachefile_is_dev_null_unlocked(cachefile)) dowrite = FALSE;
flush_callback(cachefile, cachefile->fd, key, value, extraargs, size, dowrite, TRUE, for_checkpoint); flush_callback(cachefile, cachefile->fd, key, value, extraargs, size, dowrite, TRUE, for_checkpoint);
#if DO_CALLBACK_USLEEP
usleep(DO_CALLBACK_USLEEP);
#endif
#if DO_CALLBACK_BUSYWAIT
struct timeval tstart;
gettimeofday(&tstart, 0);
long long ltstart = tstart.tv_sec * 1000000 + tstart.tv_usec;
while (1) {
struct timeval t;
gettimeofday(&t, 0);
long long lt = t.tv_sec * 1000000 + t.tv_usec;
if (lt - ltstart > DO_CALLBACK_BUSYWAIT)
break;
}
#endif
cachetable_lock(ct); cachetable_lock(ct);
rwlock_read_unlock(&cachefile->fdlock); rwlock_read_unlock(&cachefile->fdlock);
......
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