// NewRangeDescriptorCache returns a new RangeDescriptorCache which // uses the given rangeDescriptorDB as the underlying source of range // descriptors. func NewRangeDescriptorCache(db rangeDescriptorDB) *RangeDescriptorCache { return &RangeDescriptorCache{ db: db, rangeCache: util.NewOrderedCache(util.CacheConfig{ Policy: util.CacheLRU, ShouldEvict: rangeCacheShouldEvict, }), } }
// NewRangeMetadataCache returns a new RangeMetadataCache which uses the given // RangeMetadataDB as the underlying source of range metadata. func NewRangeMetadataCache(db RangeMetadataDB) *RangeMetadataCache { return &RangeMetadataCache{ db: db, rangeCache: util.NewOrderedCache(util.CacheConfig{ Policy: util.CacheLRU, ShouldEvict: rangeCacheShouldEvict, }), } }