org.infinispan.container
Class FIFOSimpleDataContainer
java.lang.Object
org.infinispan.container.SimpleDataContainer
org.infinispan.container.FIFOSimpleDataContainer
- All Implemented Interfaces:
- Iterable<InternalCacheEntry>, DataContainer
- Direct Known Subclasses:
- LRUSimpleDataContainer
@ThreadSafe
public class FIFOSimpleDataContainer
- extends SimpleDataContainer
Based on the same techniques outlined in the SimpleDataContainer
, this implementation always forces the
collection of creation timestamps for entries. This means that ImmortalCacheEntry
and TransientCacheEntry
are never used, since only MortalCacheEntry
and TransientMortalCacheEntry
instances capture timestamps.
All gets, puts, etc are constant time operations.
Iteration incurs a O(N log(N)) cost since the timestamps are sorted first, and there is an added memory overhead in
temporary space to hold sorted references. When sorting, this implementation does not use the millisecond granularity
when ordering timestamps; instead it defaults to a 1-second granularity since the FIFO ordering does not need to be
strict and the TimSort implementation used for sorting performs significantly better with minimal reordering offered
by a coarser granularity.
- Since:
- 4.0
- Author:
- Manik Surtani
Methods inherited from class org.infinispan.container.SimpleDataContainer |
clear, containsKey, entrySet, get, keySet, peek, purgeExpired, put, remove, size, successfulPut, values |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FIFOSimpleDataContainer
public FIFOSimpleDataContainer(int concurrencyLevel)
FIFOSimpleDataContainer
public FIFOSimpleDataContainer(int concurrencyLevel,
int timestampGranularity)
iterator
public Iterator<InternalCacheEntry> iterator()
- Specified by:
iterator
in interface Iterable<InternalCacheEntry>
- Overrides:
iterator
in class SimpleDataContainer
Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.