Jobs
Jobs

Reputation: 1317

Cassandra -What is really happens once Key-cache get filled

Consider that I have configured 1 Mb of key-cache (Consider it can hold 13000 of keys ).

Then I wrote some records in a column family(say 20000).

Then read it at first (All keys sequentially in the same order used to write ), and keys are started to stored in key-cache.

When the read reached @ 13000 the key cache is filled completely.

What will happen to the key-cache when the next keys are read? (Which key is removed for the newly read key ?).

Key-Cache following FIFO or LIFO or Random out ?.

Upvotes: 1

Views: 315

Answers (1)

Mikhail Stepura
Mikhail Stepura

Reputation: 3374

Key cache uses ConcurrentLinkedHashMap underneath and hence its eviction policy is LRU (least recently used).

https://code.google.com/p/concurrentlinkedhashmap/#Features

https://code.google.com/p/concurrentlinkedhashmap/wiki/Design#Beyond_LRU

Upvotes: 2

Related Questions