Interface DfsBlockCacheConfig.IndexEventConsumer

Enclosing class:
DfsBlockCacheConfig

public static interface DfsBlockCacheConfig.IndexEventConsumer
Consumer of DfsBlockCache loading and eviction events for indexes.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    acceptEvictedEvent(int packExtPos, long bytes, int totalCacheHitCount, Duration lastEvictionDuration)
    Accept an event of an index evicted from cache.
    void
    acceptRequestedEvent(int packExtPos, boolean cacheHit, long loadMicros, long bytes, Duration lastEvictionDuration)
    Accept an event of an index requested.
    default boolean
     
  • Method Details

    • acceptRequestedEvent

      void acceptRequestedEvent(int packExtPos, boolean cacheHit, long loadMicros, long bytes, Duration lastEvictionDuration)
      Accept an event of an index requested. It could be loaded from either cache or storage.
      Parameters:
      packExtPos - position in PackExt enum
      cacheHit - true if an index was already in cache. Otherwise, the index was loaded from storage into the cache in the current request,
      loadMicros - time to load an index from cache or storage in microseconds
      bytes - number of bytes loaded
      lastEvictionDuration - time since last eviction, 0 if was not evicted yet
    • acceptEvictedEvent

      default void acceptEvictedEvent(int packExtPos, long bytes, int totalCacheHitCount, Duration lastEvictionDuration)
      Accept an event of an index evicted from cache.
      Parameters:
      packExtPos - position in PackExt enum
      bytes - number of bytes evicted
      totalCacheHitCount - number of times an index was accessed while in cache
      lastEvictionDuration - time since last eviction, 0 if was not evicted yet
    • shouldReportEvictedEvent

      default boolean shouldReportEvictedEvent()
      Returns:
      true if reporting evicted events is enabled.