Permalink
Browse files

Add some comments. Remove some garbage code.

  • Loading branch information...
malin1993ml committed Apr 12, 2016
1 parent 4a82ee9 commit 69950abb67118f52891b22ab0f66900884d1ae29
@@ -1218,16 +1218,10 @@ public void runBenchmark() throws Exception {
throw new Exception("Failed to enable anticache", ex);
}
// Suspend the clients if we want to evict the database size to the threshold after warmup period
if (hstore_conf.site.anticache_warmup_eviction_time > 0) {
LOG.info(String.format("Letting system evict for %.01f seconds", hstore_conf.site.anticache_warmup_eviction_time / 1000.0));
clientPSM.writeToAll(ControlCommand.SUSPEND.name());
/*
try {
Thread.sleep(hstore_conf.site.anticache_warmup_eviction_time);
} catch (InterruptedException e) {
if (debug.val) LOG.debug("Warm-up eviction was interrupted!");
}*/
}
}
@@ -1271,6 +1265,7 @@ public void runBenchmark() throws Exception {
}
// Resume the transaction generation of clients after the warmup eviction of anti-cache
if (hstore_conf.site.anticache_warmup_eviction_enable && hstore_conf.site.anticache_warmup_eviction_time > 0) {
if (nowTime >= startTime + hstore_conf.site.anticache_warmup_eviction_time - 500) {
LOG.info("Finish eviction. Resume benchmark execution.");
@@ -1716,28 +1716,9 @@ bool AntiCacheEvictionManager::mergeUnevictedTuples(PersistentTable *table) {
VOLT_INFO("Merging %d blocks for table %s.", num_blocks, table->name().c_str());
#endif
VOLT_INFO("Merging %d blocks for table %s.", num_blocks, table->name().c_str());
//printf("%d %d\n", read_pivot, merge_pivot);
/*
for (int i = merge_pivot; i < merge_pivot + num_blocks; i++) {
int index;
if (i < ANTICACHE_MERGE_BUFFER_SIZE)
index = i;
else
index = i - ANTICACHE_MERGE_BUFFER_SIZE;
printf("%d ", table->getBlockID(index));
}
printf("\n");
for (int i = merge_pivot; i < merge_pivot + num_blocks; i++) {
int index;
if (i < ANTICACHE_MERGE_BUFFER_SIZE)
index = i;
else
index = i - ANTICACHE_MERGE_BUFFER_SIZE;
printf("%d ", table->getMergeTupleOffset(index));
}
printf("\n");
*/
// Use a pivot to indicate merge point of the shared merge buffer. This is not 100% thread-safe, but
// good enough to avoid false positive.
for (int i = merge_pivot; i < merge_pivot + num_blocks; i++) {
int index;
if (i < ANTICACHE_MERGE_BUFFER_SIZE)
@@ -167,6 +167,8 @@ class AntiCacheEvictionManager {
}
#ifdef ANTICACHE_COUNTER
// Data used by the Count-Min Sketch to track the access frequency
// of evicted tuples.
bool m_update_access;
unsigned char m_sketch[SKETCH_HEIGHT][SKETCH_WIDTH];
static const uint32_t m_hash_seed[3];
@@ -133,6 +133,9 @@ public String toString() {
private final double UNEVICTION_RATIO_CLUSTER_THRESHOLD = .1;
private final double ACCESS_RATE_CLUSTER_THRESHOLD = .1;
// Maximum number of pending transactions that are allowed to use for evicted-access txns.
// If we don't set this, evicted-access txns might occupy all the active transaction slots
// so that the clients cannot issue any new transactions.
private final long throttleThreshold;
/**

0 comments on commit 69950ab

Please sign in to comment.