@@ -1811,6 +1811,10 @@ bool AntiCacheEvictionManager::mergeUnevictedTuples(PersistentTable *table) {
18111811// Evicted Access Tracking Methods
18121812// -----------------------------------------
18131813
1814+ #ifdef ANTICACHE_COUNTER
1815+ const uint32_t AntiCacheEvictionManager::m_hash_seed[3 ] = {41 , 239785 , 878124560 };
1816+ #endif
1817+
18141818void AntiCacheEvictionManager::recordEvictedAccess (catalog::Table* catalogTable, TableTuple *tuple) {
18151819 // FIXME: HACK HACK HACK
18161820 if (m_evicted_block_ids.size () > 100000 ) {
@@ -1838,6 +1842,35 @@ void AntiCacheEvictionManager::recordEvictedAccess(catalog::Table* catalogTable,
18381842 if (!m_update_access && (block_id & 0x10000000 )) {
18391843 uint32_t _block_id = (uint32_t )(block_id & 0x0FFFFFFF );
18401844 int16_t ACID = (int16_t )((block_id & 0xE0000000 ) >> 29 );
1845+
1846+
1847+
1848+ uint64_t key = ((uint64_t )_block_id << 32 ) + tuple_id;
1849+ uint64_t hash[2 ];
1850+
1851+ unsigned char min_sketch = 255 ;
1852+ for (int i = 0 ; i < SKETCH_HEIGHT; ++i) {
1853+ MurmurHash3_x64_128 (&key, 8 , m_hash_seed[i], hash);
1854+ // hash = MurmurHash64A(&key, 8, m_hash_seed[i]);
1855+ int j = hash[0 ] & SKETCH_MASK;
1856+ if (m_sketch[i][j] < 254 ) {
1857+ m_sketch[i][j]++;
1858+ }
1859+ if (m_sketch[i][j] < min_sketch)
1860+ min_sketch = m_sketch[i][j];
1861+ }
1862+
1863+ if (min_sketch > 10 ) {
1864+ m_evicted_tables_sync.push_back (catalogTable);
1865+ m_evicted_block_ids_sync.push_back (block_id);
1866+ m_evicted_offsets_sync.push_back (tuple_id);
1867+ m_update_access = true ;
1868+ return ;
1869+ // printf("greater than: %u %d %d\n", min_sketch, _block_id, tuple_id);
1870+ }
1871+
1872+
1873+
18411874 AntiCacheDB* antiCacheDB = m_db_lookup[ACID];
18421875 AntiCacheBlock* value = antiCacheDB->readBlock (_block_id, 0 );
18431876 // char* unevicted_tuples = new char[value->getSize()];
0 commit comments