include/ccKVS/inline_util.h
static inline void cache_hit_bookkeeping_SC(struct extended_cache_op *ops, struct extended_cache_op *next_ops,
											struct mica_resp *resp,
											struct mica_resp *next_resp, struct key_home *key_homes,
											struct key_home *next_key_homes,
											uint16_t *op_i, uint16_t *next_op_i, uint16_t local_client_id,
											struct latency_flags *latency_info,
											uint16_t *hottest_keys_pointers)
{
	while (resp[(*op_i)].type != CACHE_MISS && resp[(*op_i)].type != UNSERVED_CACHE_MISS &&
		   (*op_i) < CACHE_BATCH_SIZE) {
		if (ENABLE_ASSERTIONS == 1) {
			if (resp[(*op_i)].type != CACHE_GET_SUCCESS && resp[(*op_i)].type != CACHE_PUT_SUCCESS &&
				ops[(*op_i)].opcode != CACHE_OP_UPD && ops[(*op_i)].opcode != CACHE_OP_BRC) {
				if (local_client_id == 0) {
					printf("CLIENT %d Unexpected operation %d, response: %d at pointer %d \n", local_client_id, ops[(*op_i)].opcode, resp[(*op_i)].type, (*op_i));
					exit(0);
				}
			}
		}
		if (resp[(*op_i)].type == CACHE_GET_SUCCESS || ops[(*op_i)].opcode == CACHE_OP_UPD) {// Empty the Reads and the broadcasts that have been sent
			if ((ENABLE_HOT_KEY_TRACKING == 1) && (resp[(*op_i)].type == CACHE_GET_SUCCESS)) {
				c_stats[local_client_id].cache_hits_per_client += (ops[(*op_i)].val_len + 1);
			}
			else c_stats[local_client_id].cache_hits_per_client++;
			resp[(*op_i)].type = EMPTY;
		}
		else copy_op_to_next_op(ops, next_ops,resp, next_resp, key_homes, next_key_homes, (*op_i), next_op_i, latency_info, NULL);
		(*op_i)++;
	}
}
// Bookkeeping of requests that hit in the cache for SC
Bookkeeping of requests that hit in the cache for SC
Bookkeeping of requests that hit in the cache for SC
static inline void cache_hit_bookkeeping_SC(struct extended_cache_op *ops, struct extended_cache_op *next_ops,
											struct mica_resp *resp,
											struct mica_resp *next_resp, struct key_home *key_homes,
											struct key_home *next_key_homes,
											uint16_t *op_i, uint16_t *next_op_i, uint16_t local_client_id,
											struct latency_flags *latency_info,
											uint16_t *hottest_keys_pointers)
{
	while (resp[(*op_i)].type != CACHE_MISS && resp[(*op_i)].type != UNSERVED_CACHE_MISS &&
		   (*op_i) < CACHE_BATCH_SIZE) {
		if (ENABLE_ASSERTIONS == 1) {
			if (resp[(*op_i)].type != CACHE_GET_SUCCESS && resp[(*op_i)].type != CACHE_PUT_SUCCESS &&
				ops[(*op_i)].opcode != CACHE_OP_UPD && ops[(*op_i)].opcode != CACHE_OP_BRC) {
				if (local_client_id == 0) {
					printf("CLIENT %d Unexpected operation %d, response: %d at pointer %d \n", local_client_id, ops[(*op_i)].opcode, resp[(*op_i)].type, (*op_i));
					exit(0);
				}
			}
		}
		if (resp[(*op_i)].type == CACHE_GET_SUCCESS || ops[(*op_i)].opcode == CACHE_OP_UPD) {
			if ((ENABLE_HOT_KEY_TRACKING == 1) && (resp[(*op_i)].type == CACHE_GET_SUCCESS)) {
				c_stats[local_client_id].cache_hits_per_client += (ops[(*op_i)].val_len + 1);
			}
			else c_stats[local_client_id].cache_hits_per_client++;
			resp[(*op_i)].type = EMPTY;
		}
		else copy_op_to_next_op(ops, next_ops,resp, next_resp, key_homes, next_key_homes, (*op_i), next_op_i, latency_info, NULL);
		(*op_i)++;
	}
}
static inline void cache_hit_bookkeeping_SC ( struct extended_cache_op * ops , struct extended_cache_op * next_ops , struct mica_resp * resp , struct mica_resp * next_resp , struct key_home * key_homes , struct key_home * next_key_homes , uint16_t * op_i , uint16_t * next_op_i , uint16_t local_client_id , struct latency_flags * latency_info , uint16_t * hottest_keys_pointers ) { while ( resp [ ( * op_i ) ] . type != CACHE_MISS && resp [ ( * op_i ) ] . type != UNSERVED_CACHE_MISS && ( * op_i ) < CACHE_BATCH_SIZE ) { if ( ENABLE_ASSERTIONS == 1 ) { if ( resp [ ( * op_i ) ] . type != CACHE_GET_SUCCESS && resp [ ( * op_i ) ] . type != CACHE_PUT_SUCCESS && ops [ ( * op_i ) ] . opcode != CACHE_OP_UPD && ops [ ( * op_i ) ] . opcode != CACHE_OP_BRC ) { if ( local_client_id == 0 ) { printf ( " \n " , local_client_id , ops [ ( * op_i ) ] . opcode , resp [ ( * op_i ) ] . type , ( * op_i ) ) ; exit ( 0 ) ; } } } if ( resp [ ( * op_i ) ] . type == CACHE_GET_SUCCESS || ops [ ( * op_i ) ] . opcode == CACHE_OP_UPD ) { if ( ( ENABLE_HOT_KEY_TRACKING == 1 ) && ( resp [ ( * op_i ) ] . type == CACHE_GET_SUCCESS ) ) { c_stats [ local_client_id ] . cache_hits_per_client += ( ops [ ( * op_i ) ] . val_len + 1 ) ; } else c_stats [ local_client_id ] . cache_hits_per_client ++ ; resp [ ( * op_i ) ] . type = EMPTY ; } else copy_op_to_next_op ( ops , next_ops , resp , next_resp , key_homes , next_key_homes , ( * op_i ) , next_op_i , latency_info , NULL ) ; ( * op_i ) ++ ; } }
Bookkeeping of requests that hit in the cache for SC
Bookkeeping of requests that hit in the cache for SC
// Empty the Reads and the broadcasts that have been sent