Class LatestBlockCache

java.lang.Object
io.datarouter.filesystem.snapshot.cache.LatestBlockCache
All Implemented Interfaces:
BlockLoader

public class LatestBlockCache
extends Object
implements BlockLoader
Simple implementation holds the most recent block of each type accessed. For sequential access we may read the same block many times in a row, in which case this cache allows skipping path generation, block loading, and checksumming. This is extremely optimized so the SnapshotReader doesn't need to think about caching. Numeric block indexes are stored to avoid path-building String concatenation.