Package org.openrefine.model.changes
Class LazyGridCache
- java.lang.Object
-
- org.openrefine.model.changes.LazyGridCache
-
-
Constructor Summary
Constructors Constructor Description LazyGridCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridcacheGrid(long id, Grid grid)Caches a grid on disk.GridgetCachedGrid(long id)Retrieves a disk-cached grid.Set<Long>listCachedGridIds()Lists the set of history entry ids for which the resulting grid is cached.voiduncacheGrid(long id)Discards the on-disk cache of a grid
-
-
-
Method Detail
-
listCachedGridIds
public Set<Long> listCachedGridIds()
Description copied from interface:GridCacheLists the set of history entry ids for which the resulting grid is cached.- Specified by:
listCachedGridIdsin interfaceGridCache
-
getCachedGrid
public Grid getCachedGrid(long id) throws IOException
Description copied from interface:GridCacheRetrieves a disk-cached grid.- Specified by:
getCachedGridin interfaceGridCache- Parameters:
id- the id of the history entry which produced it- Returns:
- the cached grid
- Throws:
IOException- if the grid could not be loaded from disk
-
uncacheGrid
public void uncacheGrid(long id) throws IOExceptionDescription copied from interface:GridCacheDiscards the on-disk cache of a grid- Specified by:
uncacheGridin interfaceGridCache- Parameters:
id- the id of the history entry which produced it.- Throws:
IOException- if removing the grid from the cache did not succeed
-
cacheGrid
public Grid cacheGrid(long id, Grid grid) throws IOException
Description copied from interface:GridCacheCaches a grid on disk.- Specified by:
cacheGridin interfaceGridCache- Parameters:
id- the id of the history entry which produced itgrid- the grid to cache- Returns:
- the same grid read from disk instead.
- Throws:
IOException- if caching the grid failed
-
-