org.apache.storm.utils

## Class TimeCacheMap<K,V>

- java.lang.Object
- - org.apache.storm.utils.TimeCacheMap<K,V>

- Deprecated.

      @Deprecated
      public class TimeCacheMap<K,V>
      extends Object

  Expires keys that have not been updated in the configured number of seconds. The algorithm used will take between expirationSecs and expirationSecs * (1 + 1 / (numBuckets-1)) to actually expire the message.

  get, put, remove, containsKey, and size take O(numBuckets) time to run.

  The advantage of this design is that the expiration thread only locks the object for O(1) time, meaning the object is essentially always available for gets/puts.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `TimeCacheMap.ExpiredCallback<K,V>` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeCacheMap(int expirationSecs)` Deprecated.
    `TimeCacheMap(int expirationSecs, int numBuckets)` Deprecated.
    `TimeCacheMap(int expirationSecs, int numBuckets, TimeCacheMap.ExpiredCallback<K,V> callback)` Deprecated.
    `TimeCacheMap(int expirationSecs, TimeCacheMap.ExpiredCallback<K,V> callback)` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup()` Deprecated.
    `boolean` | `containsKey(K key)` Deprecated.
    `V` | `get(K key)` Deprecated.
    `void` | `put(K key, V value)` Deprecated.
    `Object` | `remove(K key)` Deprecated.
    `int` | `size()` Deprecated.

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

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

- - ### Constructor Detail

    - #### TimeCacheMap

          public TimeCacheMap(int expirationSecs,
                              int numBuckets,
                              TimeCacheMap.ExpiredCallback<K,V> callback)

      Deprecated.

    - #### TimeCacheMap

          public TimeCacheMap(int expirationSecs,
                              TimeCacheMap.ExpiredCallback<K,V> callback)

      Deprecated.

    - #### TimeCacheMap

          public TimeCacheMap(int expirationSecs)

      Deprecated.

    - #### TimeCacheMap

          public TimeCacheMap(int expirationSecs,
                              int numBuckets)

      Deprecated.

  - ### Method Detail

    - #### containsKey

          public boolean containsKey(K key)

      Deprecated.

    - #### get

          public V get(K key)

      Deprecated.

    - #### put

          public void put(K key,
                          V value)

      Deprecated.

    - #### remove

          public Object remove(K key)

      Deprecated.

    - #### size

          public int size()

      Deprecated.

    - #### cleanup

          public void cleanup()

      Deprecated.

Copyright © 2021 The Apache Software Foundation. All rights reserved.