src/ccKVS/cache.c
void cache_init(int cache_id, int num_threads) {
	int i;
	assert(sizeof(cache_meta) == 8); //make sure that the cache meta are 8B and thus can fit in mica unused key

	cache.num_threads = num_threads;
	cache_reset_total_ops_issued();
	/// allocate and init metadata for the cache & threads
	extended_cache_meta_reset(&cache.aggregated_meta);
	cache.meta = malloc(num_threads * sizeof(struct cache_meta_stats));
	for(i = 0; i < num_threads; i++)
		cache_meta_reset(&cache.meta[i]);
	mica_init(&cache.hash_table, cache_id, CACHE_SOCKET, CACHE_NUM_BKTS, HERD_LOG_CAP);
	cache_populate_fixed_len(&cache.hash_table, CACHE_NUM_KEYS, HERD_VALUE_SIZE);
}
/*
 * Initialize the cache using a MICA instances and adding the timestamps
 * and locks to the keys of mica structure
 */
Initialize the cache using a MICA instances and adding the timestamps
and locks to the keys of mica structure
Initialize the cache using a MICA instances and adding the timestamps and locks to the keys of mica structure
void cache_init(int cache_id, int num_threads) {
	int i;
	assert(sizeof(cache_meta) == 8); 
	cache.num_threads = num_threads;
	cache_reset_total_ops_issued();
	extended_cache_meta_reset(&cache.aggregated_meta);
	cache.meta = malloc(num_threads * sizeof(struct cache_meta_stats));
	for(i = 0; i < num_threads; i++)
		cache_meta_reset(&cache.meta[i]);
	mica_init(&cache.hash_table, cache_id, CACHE_SOCKET, CACHE_NUM_BKTS, HERD_LOG_CAP);
	cache_populate_fixed_len(&cache.hash_table, CACHE_NUM_KEYS, HERD_VALUE_SIZE);
}
void cache_init ( int cache_id , int num_threads ) { int i ; assert ( sizeof ( cache_meta ) == 8 ) ; cache . num_threads = num_threads ; cache_reset_total_ops_issued ( ) ; extended_cache_meta_reset ( & cache . aggregated_meta ) ; cache . meta = malloc ( num_threads * sizeof ( struct cache_meta_stats ) ) ; for ( i = 0 ; i < num_threads ; i ++ ) cache_meta_reset ( & cache . meta [ i ] ) ; mica_init ( & cache . hash_table , cache_id , CACHE_SOCKET , CACHE_NUM_BKTS , HERD_LOG_CAP ) ; cache_populate_fixed_len ( & cache . hash_table , CACHE_NUM_KEYS , HERD_VALUE_SIZE ) ; }
Initialize the cache using a MICA instances and adding the timestamps
 and locks to the keys of mica structure
Initialize the cache using a MICA instances and adding the timestamps and locks to the keys of mica structure
//make sure that the cache meta are 8B and thus can fit in mica unused key /// allocate and init metadata for the cache & threads