public interface CacheReaderWriter
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMainTable()
Validates that the cache can be read from and written to, and if so returns the name of the main table (which the cache references)
|
java.util.List<CacheBlock> |
readCache(long id)
Reads all the cache blocks for the given id from the database
|
java.util.List<CacheBlock> |
readCache(long id,
int maxBlocks)
Reads up to the maximum number of cache blocks for the given id from the database
|
boolean |
validateCacheStructure()
Validates that the cache can be read from and written to
|
void |
writeCache(long id,
CacheBlock block)
Writes a cache block for the given id
|
@NotNull java.util.List<CacheBlock> readCache(long id)
id
- The id of the main table row in the database@NotNull java.util.List<CacheBlock> readCache(long id, int maxBlocks)
id
- The id of the main table row in the databasemaxBlocks
- The maximum number of blocks to load, or negative to indicate infinitevoid writeCache(long id, @NotNull CacheBlock block)
id
- The id of the main table row in the databaseblock
- The block of data to writeboolean validateCacheStructure()
@Nullable java.lang.String getMainTable()