Package one.microstream.collections.lazy
Interface LazySegmentUnloader
- All Known Implementing Classes:
LazySegmentUnloader.Default,LazySegmentUnloader.Never,LazySegmentUnloader.Timed
public interface LazySegmentUnloader
Defines methods to control automated unloading
of LazySegments.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classLazySegmentUnloader.DefaultDefault implementation of LazyUnloader
This implementation will try to keep a configurable number of last loaded segments in memory.static classLazySegmentUnloader.NeverLazyUnloader implementation that does no unloading.static classLazySegmentUnloader.TimedImplementation of LazyUnloader
This implementation will try to unload segments that are older then the configured lifetime. -
Method Summary
Modifier 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<?> currentLazySegment)Tries to unload segments.
-
Method Details
-
unload
Tries to unload segments. Most implementation should not unload the currently used segment.- Parameters:
currentLazySegment- LazySegment that is currently in use.
-
unload
void unload(boolean unloadAll)Tries 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.- Parameters:
unloadAll- if true try to unload everything, try to fall below limit if possible.
-
remove
Unregister the provided segment from the Unloader.- Parameters:
segment- Segment to be unregistered.
-
copy
LazySegmentUnloader copy()Create a new copy of this LazySegmentUnloader.- Returns:
- a new copy of this LazySegmentUnloader
-