Class NoStrictCacheSizeAllocator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void allocate​(long size)
      This operation will cost available cache size.
      long getAvailableCacheSize()
      Get available cache size.
      void release​(long size)
      This method used to release used cache size and add available cache size.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NoStrictCacheSizeAllocator

        public NoStrictCacheSizeAllocator​(long maxCacheSize)
    • Method Detail

      • allocate

        public void allocate​(long size)
        This operation will cost available cache size. if the request size exceed the available size, it's should be allowed, because maybe one entry size exceed the size and the query must be finished, the available size will become invalid.
        Specified by:
        allocate in interface CacheSizeAllocator
        Parameters:
        size - allocate size
      • release

        public void release​(long size)
        This method used to release used cache size and add available cache size. in normal case, the available size shouldn't exceed max cache size.
        Specified by:
        release in interface CacheSizeAllocator
        Parameters:
        size - release size