public VanillaIndexCache(@NotNull String basePath, int blockBits, @NotNull DateCache dateCache, int capacity, boolean cleanupOnClose) { this.basePath = basePath; this.baseFile = new File(basePath); this.blockBits = blockBits; this.dateCache = dateCache; this.cache = new VanillaMappedCache<IndexKey>(capacity, true, cleanupOnClose); }
public VanillaDataCache(@NotNull String basePath, int blockBits, @NotNull DateCache dateCache, int capacity, boolean cleanupOnClose) { this.basePath = basePath; this.blockBits = blockBits; this.dateCache = dateCache; this.cache = new VanillaMappedCache<DataKey>(capacity, true, cleanupOnClose); }
VanillaDataCache( @NotNull ChronicleQueueBuilder.VanillaChronicleQueueBuilder builder, @NotNull VanillaDateCache dateCache, int blockBits) { this.fileLifecycleListener = builder.fileLifecycleListener(); this.basePath = builder.path().getAbsolutePath(); this.blockBits = blockBits; this.dateCache = dateCache; this.cache = new VanillaMappedCache<>( builder.dataCacheCapacity(), true, builder.cleanupOnClose() ); }
VanillaIndexCache( @NotNull ChronicleQueueBuilder.VanillaChronicleQueueBuilder builder, @NotNull VanillaDateCache dateCache, int blocksBits, FileLifecycleListener fileLifecycleListener) { this.fileLifecycleListener = fileLifecycleListener; this.baseFile = builder.path(); this.basePath = this.baseFile.getAbsolutePath(); this.blockBits = blocksBits; this.dateCache = dateCache; this.cache = new VanillaMappedCache<>( builder.indexCacheCapacity(), true, builder.cleanupOnClose() ); this.indexFileMap = new LinkedHashMap<IndexKey, File>(32, 1.0f, true) { @Override protected boolean removeEldestEntry(Map.Entry<IndexKey, File> eldest) { return size() >= 32; } }; }