Interface CacheLimitPolicy

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void acquire​(long toAddSize)
      Acquire cache.
      boolean directWriteInCache()
      Whether to support directly write in cache.
      boolean isOverflow​(long toAddSize, boolean hasFile)
      Whether the cache usage is exceeded the upperbound.
      boolean isSafeToAdd​(long toAddSize)
      Whether the cache usage is safe to add.
      void registerCustomizedMetrics​(String prefix, org.apache.flink.metrics.MetricGroup metricGroup)
      Register customized metrics.
      void release​(long toReleaseSize)
      Release cache.
      long usedBytes()
      Get current used bytes.
    • Method Detail

      • directWriteInCache

        boolean directWriteInCache()
        Whether to support directly write in cache.
      • isSafeToAdd

        boolean isSafeToAdd​(long toAddSize)
        Whether the cache usage is safe to add.
        Parameters:
        toAddSize -
        Returns:
        false if the toAddSize is larger than max available capacity, true otherwise.
      • isOverflow

        boolean isOverflow​(long toAddSize,
                           boolean hasFile)
        Whether the cache usage is exceeded the upperbound.
        Parameters:
        toAddSize - the size about to add.
        hasFile - whether the file is already in cache.
        Returns:
        true if the cache usage is overflow, false otherwise.
      • acquire

        void acquire​(long toAddSize)
        Acquire cache.
        Parameters:
        toAddSize -
      • release

        void release​(long toReleaseSize)
        Release cache.
        Parameters:
        toReleaseSize -
      • usedBytes

        long usedBytes()
        Get current used bytes.
        Returns:
        cache bytes.
      • registerCustomizedMetrics

        void registerCustomizedMetrics​(String prefix,
                                       org.apache.flink.metrics.MetricGroup metricGroup)
        Register customized metrics.
        Parameters:
        prefix -
        metricGroup -