Package one.microstream.collections.lazy
Class LazySegmentUnloader.Default
java.lang.Object
one.microstream.collections.lazy.LazySegmentUnloader.Default
- All Implemented Interfaces:
- LazySegmentUnloader
- Enclosing interface:
- LazySegmentUnloader
public static final class LazySegmentUnloader.Default extends Object implements LazySegmentUnloader
Default implementation of LazyUnloader
 
This implementation will try to keep a configurable number of last loaded segments in memory. The number of loaded elements may vary because not stored or modified segments can't be unloaded.
This implementation will try to keep a configurable number of last loaded segments in memory. The number of loaded elements may vary because not stored or modified segments can't be unloaded.
- 
Nested Class SummaryNested classes/interfaces inherited from interface one.microstream.collections.lazy.LazySegmentUnloaderLazySegmentUnloader.Default, LazySegmentUnloader.Never, LazySegmentUnloader.Timed
- 
Constructor Summary
- 
Method SummaryModifier and Type Method Description LazySegmentUnloadercopy()Create a new copy of this LazySegmentUnloader.voidremove(LazySegment<?> segment)Unregister the provided segment from the Unloader.voidunload(boolean unloadAll)Tries to unload as much as possible elements from the collection.voidunload(LazySegment<?> lazySegment)Tries to unload segments.
- 
Constructor Details- 
Defaultpublic Default()Creates a LazyUnloader.Default instance. This instance tries to keep two segments at least in memory.
- 
Defaultpublic Default(int desiredLoadCount)Creates a LazyUnloader.Default instance.- Parameters:
- desiredLoadCount- number of segments that should be kept in memory, must be greater than 0.
 
 
- 
- 
Method Details- 
unloadDescription copied from interface:LazySegmentUnloaderTries to unload segments. Most implementation should not unload the currently used segment.- Specified by:
- unloadin interface- LazySegmentUnloader
- Parameters:
- lazySegment- LazySegment that is currently in use.
 
- 
unloadpublic void unload(boolean unloadAll)Description copied from interface:LazySegmentUnloaderTries to unload as much as possible elements from the collection. The amount of unloaded data depends on the unloader implementation details. E.g if the unloader is configured to keep a minimum of data in memory that minimum will not be unloaded as long as the parameter unloadAll is not specified. If unloadAll is try it will try to to fall below that limit.- Specified by:
- unloadin interface- LazySegmentUnloader
- Parameters:
- unloadAll- if true try to unload everything, try to fall below limit if possible.
 
- 
copyDescription copied from interface:LazySegmentUnloaderCreate a new copy of this LazySegmentUnloader.- Specified by:
- copyin interface- LazySegmentUnloader
- Returns:
- a new copy of this LazySegmentUnloader
 
- 
removeDescription copied from interface:LazySegmentUnloaderUnregister the provided segment from the Unloader.- Specified by:
- removein interface- LazySegmentUnloader
- Parameters:
- segment- Segment to be unregistered.
 
 
-