ICache (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.cache

## Interface ICache<K,V>

- All Known Implementing Classes:
    ConcurrentLinkedHashCache, SerializingCache

      public interface ICache<K,V>

  This is similar to the Map interface, but requires maintaining a given capacity and does not require put or remove to return values, which lets SerializingCache be more efficient by avoiding deserialize except on get.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `capacity()`
    `void` | `clear()`
    `boolean` | `containsKey(K key)`
    `V` | `get(K key)`
    `java.util.Iterator<K>` | `hotKeyIterator(int n)`
    `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()`

- - ### Method Detail

    - #### capacity

          long capacity()

    - #### setCapacity

          void setCapacity(long capacity)

    - #### put

          void put(K key,
                   V value)

    - #### putIfAbsent

          boolean putIfAbsent(K key,
                              V value)

    - #### replace

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

    - #### get

          V get(K key)

    - #### remove

          void remove(K key)

    - #### size

          int size()

    - #### weightedSize

          long weightedSize()

    - #### clear

          void clear()

    - #### keyIterator

          java.util.Iterator<K> keyIterator()

    - #### hotKeyIterator

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

    - #### containsKey

          boolean containsKey(K key)

Copyright © 2018 The Apache Software Foundation