@Deprecated public class TimeCacheMap<K,V> extends Object
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.
Modifier and Type | Class and Description |
---|---|
static interface |
TimeCacheMap.ExpiredCallback<K,V>
Deprecated.
|
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.
|
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.
|
public TimeCacheMap(int expirationSecs, int numBuckets, TimeCacheMap.ExpiredCallback<K,V> callback)
public TimeCacheMap(int expirationSecs, TimeCacheMap.ExpiredCallback<K,V> callback)
public TimeCacheMap(int expirationSecs)
public TimeCacheMap(int expirationSecs, int numBuckets)
Copyright © 2023 The Apache Software Foundation. All rights reserved.