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 Grid
cacheGrid(long id, Grid grid)
Caches a grid on disk.Grid
getCachedGrid(long id)
Retrieves a disk-cached grid.Set<Long>
listCachedGridIds()
Lists the set of history entry ids for which the resulting grid is cached.void
uncacheGrid(long id)
Discards the on-disk cache of a grid
-
-
-
Method Detail
-
listCachedGridIds
public Set<Long> listCachedGridIds()
Description copied from interface:GridCache
Lists the set of history entry ids for which the resulting grid is cached.- Specified by:
listCachedGridIds
in interfaceGridCache
-
getCachedGrid
public Grid getCachedGrid(long id) throws IOException
Description copied from interface:GridCache
Retrieves a disk-cached grid.- Specified by:
getCachedGrid
in 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 IOException
Description copied from interface:GridCache
Discards the on-disk cache of a grid- Specified by:
uncacheGrid
in 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:GridCache
Caches a grid on disk.- Specified by:
cacheGrid
in 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
-
-