Interface NodeCache

All Known Implementing Classes:
CHMCache, NoCache

public interface NodeCache
NodeCache is an interface for a cache that stores decoded values from the data section of the database.

Scope each cache to one Reader. Return the loader's result unchanged for the requested key, propagate loader exceptions, and never return null. Implementations used for concurrent lookups must be thread-safe.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A loader is used to load a value for a key that is not in the cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(CacheKey<?> key, NodeCache.Loader loader)
    This method returns the value for the key.
  • Method Details

    • get

      DecodedValue get(CacheKey<?> key, NodeCache.Loader loader) throws IOException
      This method returns the value for the key. If the key is not in the cache then the loader is called to load the value.
      Parameters:
      key - the key to look up
      loader - the loader to use if the key is not in the cache
      Returns:
      the value for the key
      Throws:
      IOException - if there is an error loading the value