@@ -549,11 +549,7 @@ bool AntiCacheEvictionManager::evictBlockToDisk(PersistentTable *table, const lo
549549 VOLT_DEBUG (" %s Table Schema:\n %s" ,
550550 evictedTable->name ().c_str (), evictedTable->schema ()->debug ().c_str ());
551551
552- // get the AntiCacheDB instance from the executorContext
553- // For now use the single AntiCacheDB from PersistentTable but in the future, this
554- // method to get the AntiCacheDB will have to choose which AntiCacheDB from to
555- // evict to
556- AntiCacheDB* antiCacheDB = table->getAntiCacheDB (chooseDB (block_size, m_migrate));
552+ AntiCacheDB* antiCacheDB;
557553 int tuple_length = -1 ;
558554 bool needs_flush = false ;
559555
@@ -571,6 +567,12 @@ bool AntiCacheEvictionManager::evictBlockToDisk(PersistentTable *table, const lo
571567 for (int i = 0 ; i < num_blocks; i++)
572568 {
573569
570+ // get the AntiCacheDB instance from the executorContext
571+ // For now use the single AntiCacheDB from PersistentTable but in the future, this
572+ // method to get the AntiCacheDB will have to choose which AntiCacheDB from to
573+ // evict to
574+ antiCacheDB = table->getAntiCacheDB (chooseDB (block_size, m_migrate));
575+
574576 // get the LS16B and send that to the antiCacheDB
575577 uint16_t _block_id = antiCacheDB->nextBlockId ();
576578
@@ -661,7 +663,7 @@ bool AntiCacheEvictionManager::evictBlockToDisk(PersistentTable *table, const lo
661663 table->name ().c_str (), num_tuples_evicted);
662664
663665 // Only write out a bock if there are tuples in it
664- if (num_tuples_evicted >= 0 ) {
666+ if (num_tuples_evicted > 0 ) {
665667 std::vector<int > numTuples;
666668 numTuples.push_back (num_tuples_evicted);
667669 block.writeHeader (numTuples);
@@ -686,6 +688,7 @@ bool AntiCacheEvictionManager::evictBlockToDisk(PersistentTable *table, const lo
686688 // TODO: make this look like
687689 // block.flush();
688690 // antiCacheDB->writeBlock(block);
691+ VOLT_DEBUG (" about to write block %x to acid %d" , _block_id, antiCacheDB->getACID ());
689692 antiCacheDB->writeBlock (table->name (),
690693 _block_id,
691694 num_tuples_evicted,
@@ -696,7 +699,7 @@ bool AntiCacheEvictionManager::evictBlockToDisk(PersistentTable *table, const lo
696699
697700 bool reused = table->removeUnevictedBlockID (block_id);
698701 if (reused) {
699- VOLT_INFO (" Reusing block_id 0x%x, should be safe" , block_id);
702+ VOLT_DEBUG (" Reusing block_id 0x%x, should be safe" , block_id);
700703 } else {
701704 VOLT_DEBUG (" First time block_id 0x%x has been used" , block_id);
702705 }
@@ -781,7 +784,7 @@ bool AntiCacheEvictionManager::evictBlockToDiskInBatch(PersistentTable *table, P
781784 // evictedTable->name().c_str(), evictedTable->schema()->debug().c_str());
782785
783786 // get the AntiCacheDB instance from the executorContext
784- AntiCacheDB* antiCacheDB = table-> getAntiCacheDB ( chooseDB (block_size, m_migrate)) ;
787+ AntiCacheDB* antiCacheDB;
785788 int tuple_length = -1 ;
786789 bool needs_flush = false ;
787790
@@ -822,6 +825,7 @@ bool AntiCacheEvictionManager::evictBlockToDiskInBatch(PersistentTable *table, P
822825 // VOLT_INFO("Printing child's LRU chain");
823826 // this->printLRUChain(childTable, 4, true);
824827 // get a unique block id from the executorContext
828+ antiCacheDB = table->getAntiCacheDB (chooseDB (block_size, m_migrate));
825829 uint16_t _block_id = antiCacheDB->nextBlockId ();
826830 // find out whether this tier blocks and set a flag (bit 19)
827831 // then shift 3b for the ACID (8 levels)
@@ -1343,6 +1347,7 @@ int32_t AntiCacheEvictionManager::migrateBlock(int32_t block_id, AntiCacheDB* ds
13431347 int32_t new_block_id = 0 ;
13441348
13451349 if (dstDB->getFreeBlocks () == 0 ) {
1350+ VOLT_WARN (" Our destination is full!" );
13461351 throw FullBackingStoreException ((uint32_t )block_id, (uint32_t )dstDB->getACID ());
13471352 }
13481353
@@ -1423,7 +1428,7 @@ int32_t AntiCacheEvictionManager::migrateLRUBlock(AntiCacheDB* srcDB, AntiCacheD
14231428 return (int32_t ) _new_block_id;
14241429 }
14251430
1426-
1431+ VOLT_DEBUG ( " migrating LRU block " );
14271432 AntiCacheBlock* block = srcDB->getLRUBlock ();
14281433 int16_t _block_id = block->getBlockId ();
14291434 int32_t block_id = (int32_t )_block_id;
@@ -1467,7 +1472,7 @@ int32_t AntiCacheEvictionManager::migrateLRUBlock(AntiCacheDB* srcDB, AntiCacheD
14671472 VOLT_TRACE (" Updating tuple blockid from %8x to %8x" , block_id, new_block_id);
14681473 }
14691474 }
1470- VOLT_DEBUG (" updated %u migrated tuples [#%8x -> #%8x]" , updated, block_id, new_block_id);
1475+ VOLT_INFO (" updated %u migrated tuples [#%8x -> #%8x]" , updated, block_id, new_block_id);
14711476 } else {
14721477 VOLT_WARN (" No evicted table! If this is an EE test, shouldn't be a problem" );
14731478 }
0 commit comments