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 class  LazySegmentUnloader.Default
    Default implementation of LazyUnloader
    This implementation will try to keep a configurable number of last loaded segments in memory.
    static class  LazySegmentUnloader.Never
    LazyUnloader implementation that does no unloading.
    static class  LazySegmentUnloader.Timed
    Implementation of LazyUnloader
    This implementation will try to unload segments that are older then the configured lifetime.
  • Method Summary

    Modifier and Type Method Description
    LazySegmentUnloader copy()
    Create a new copy of this LazySegmentUnloader.
    void remove​(LazySegment<?> segment)
    Unregister the provided segment from the Unloader.
    void unload​(boolean unloadAll)
    Tries to unload as much as possible elements from the collection.
    void unload​(LazySegment<?> currentLazySegment)
    Tries to unload segments.
  • Method Details

    • unload

      void unload​(LazySegment<?> currentLazySegment)
      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

      void remove​(LazySegment<?> segment)
      Unregister the provided segment from the Unloader.
      Parameters:
      segment - Segment to be unregistered.
    • copy

      Create a new copy of this LazySegmentUnloader.
      Returns:
      a new copy of this LazySegmentUnloader