Package thredds.featurecollection.cache
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 -
Method Summary
Modifier and TypeMethodDescriptionucar.nc2.ft.fmrc.GridDatasetInvget(thredds.inventory.MFile mfile) static voidInitialize the inventory cachestatic voidInitialize the inventory cachestatic voidInitialize the inventory cachevoidput(thredds.inventory.MFile mfile, ucar.nc2.ft.fmrc.GridDatasetInv inventory) static voidDisplay cache infostatic voidshutdown()Shutdown hook to close the cache.
-
Constructor Details
-
GridInventoryCacheChronicle
public GridInventoryCacheChronicle()
-
-
Method Details
-
init
Initialize the inventory cache- Parameters:
cacheDir- Path to the cache directory. This location will be created if it does not exist.- Throws:
IOException
-
init
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 mostmaxBloatFactor- 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 mostmaxBloatFactor- max number of times the cache size can increaseaverageValueSizeName- a name of one of theGridInventoryCacheChronicle.AverageValueSizeconstants 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:
getin interfaceucar.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:
putin interfaceucar.nc2.internal.dataset.ft.fmrc.InventoryCacheProvider- Throws:
IOException
-
shutdown
public static void shutdown()Shutdown hook to close the cache. -
showCache
Display cache info
-