Class GridInventoryCacheChronicle

java.lang.Object
thredds.featurecollection.cache.GridInventoryCacheChronicle
All Implemented Interfaces:
ucar.nc2.internal.dataset.ft.fmrc.InventoryCacheProvider

public class GridInventoryCacheChronicle extends Object implements ucar.nc2.internal.dataset.ft.fmrc.InventoryCacheProvider
Implementation of a persisted grid inventory cache using ChronicleMap.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    ucar.nc2.ft.fmrc.GridDatasetInv
    get(thredds.inventory.MFile mfile)
     
    static void
    init(Path cacheDir)
    Initialize the inventory cache
    static void
    init(Path cacheDir, int maxEntries, int maxBloatFactor)
    Initialize the inventory cache
    static void
    init(Path cacheDir, int maxEntries, int maxBloatFactor, String averageValueSizeName)
    Initialize the inventory cache
    void
    put(thredds.inventory.MFile mfile, ucar.nc2.ft.fmrc.GridDatasetInv inventory)
     
    static void
    showCache(Formatter formatter)
    Display cache info
    static void
    Shutdown hook to close the cache.

    Methods inherited from class java.lang.Object

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

    • GridInventoryCacheChronicle

      public GridInventoryCacheChronicle()
  • Method Details

    • init

      public static void init(Path cacheDir) throws IOException
      Initialize the inventory cache
      Parameters:
      cacheDir - Path to the cache directory. This location will be created if it does not exist.
      Throws:
      IOException
    • init

      public static void init(Path cacheDir, int maxEntries, int maxBloatFactor) throws IOException
      Initialize the inventory cache
      Parameters:
      cacheDir - Path to the cache directory. This location will be created if it does not exist.
      maxEntries - number of entries in the cache, at most
      maxBloatFactor - max number of times the cache size can increase
      Throws:
      IOException
    • init

      public static void init(Path cacheDir, int maxEntries, int maxBloatFactor, String averageValueSizeName) throws IOException
      Initialize the inventory cache
      Parameters:
      cacheDir - Path to the cache directory. This location will be created if it does not exist.
      maxEntries - number of entries in the cache, at most
      maxBloatFactor - max number of times the cache size can increase
      averageValueSizeName - a name of one of the GridInventoryCacheChronicle.AverageValueSize constants or null if the default should be used
      Throws:
      IOException
    • get

      @Nullable public ucar.nc2.ft.fmrc.GridDatasetInv get(thredds.inventory.MFile mfile) throws IOException
      Specified by:
      get in interface ucar.nc2.internal.dataset.ft.fmrc.InventoryCacheProvider
      Throws:
      IOException
    • put

      public void put(thredds.inventory.MFile mfile, ucar.nc2.ft.fmrc.GridDatasetInv inventory) throws IOException
      Specified by:
      put in interface ucar.nc2.internal.dataset.ft.fmrc.InventoryCacheProvider
      Throws:
      IOException
    • shutdown

      public static void shutdown()
      Shutdown hook to close the cache.
    • showCache

      public static void showCache(Formatter formatter)
      Display cache info