org.apache.cassandra.cache

## Class ConcurrentLinkedHashCache<K extends IMeasurableMemory,V extends IMeasurableMemory>

- java.lang.Object
- - org.apache.cassandra.cache.ConcurrentLinkedHashCache<K,V>

All Implemented Interfaces:
  ICache<K,V>

    public class ConcurrentLinkedHashCache<K extends IMeasurableMemory,V extends IMeasurableMemory>
    extends java.lang.Object
    implements ICache<K,V>

Wrapper so CLHM can implement ICache interface. (this is what you get for making library classes final.)

### Field Summary

Fields
`static int` `DEFAULT_CONCURENCY_LEVEL`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`long` `capacity()`
`void` `clear()`
`boolean` `containsKey(K key)`
`static <K extends IMeasurableMemory,V extends IMeasurableMemory> ConcurrentLinkedHashCache<K,V>` `create(long weightedCapacity)`
`static <K extends IMeasurableMemory,V extends IMeasurableMemory> ConcurrentLinkedHashCache<K,V>` `create(long weightedCapacity, com.googlecode.concurrentlinkedhashmap.EntryWeigher<K,V> entryWeiger)` Initialize a cache with initial capacity with weightedCapacity
`V` `get(K key)`
`java.util.Iterator<K>` `hotKeyIterator(int n)`
`boolean` `isEmpty()`
`java.util.Iterator<K>` `keyIterator()`
`void` `put(K key, V value)`
`boolean` `putIfAbsent(K key, V value)`
`void` `remove(K key)`
`boolean` `replace(K key, V old, V value)`
`void` `setCapacity(long capacity)`
`int` `size()`
`long` `weightedSize()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_CONCURENCY_LEVEL

    public static final int DEFAULT_CONCURENCY_LEVEL

See Also:
  Constant Field Values

### Method Detail

#### create

    public static <K extends IMeasurableMemory,V extends IMeasurableMemory> ConcurrentLinkedHashCache<K,V> create(long weightedCapacity,
                                                                                                                  com.googlecode.concurrentlinkedhashmap.EntryWeigher<K,V> entryWeiger)

Initialize a cache with initial capacity with weightedCapacity

#### create

    public static <K extends IMeasurableMemory,V extends IMeasurableMemory> ConcurrentLinkedHashCache<K,V> create(long weightedCapacity)

#### capacity

    public long capacity()

Specified by:
  `capacity` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### setCapacity

    public void setCapacity(long capacity)

Specified by:
  `setCapacity` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### isEmpty

    public boolean isEmpty()

#### size

    public int size()

Specified by:
  `size` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### weightedSize

    public long weightedSize()

Specified by:
  `weightedSize` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### clear

    public void clear()

Specified by:
  `clear` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### get

    public V get(K key)

Specified by:
  `get` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### put

    public void put(K key,
                    V value)

Specified by:
  `put` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### putIfAbsent

    public boolean putIfAbsent(K key,
                               V value)

Specified by:
  `putIfAbsent` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### replace

    public boolean replace(K key,
                           V old,
                           V value)

Specified by:
  `replace` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### remove

    public void remove(K key)

Specified by:
  `remove` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### keyIterator

    public java.util.Iterator<K> keyIterator()

Specified by:
  `keyIterator` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### hotKeyIterator

    public java.util.Iterator<K> hotKeyIterator(int n)

Specified by:
  `hotKeyIterator` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`

#### containsKey

    public boolean containsKey(K key)

Specified by:
  `containsKey` in interface `ICache<K extends IMeasurableMemory,V extends IMeasurableMemory>`