public static VanillaMappedBlocks readWrite(final File path, long size) throws IOException { return readWrite(path, size, FileLifecycleListener.FileLifecycleListeners.IGNORE); }
public static VanillaMappedBlocks readOnly(final File path, long size, FileLifecycleListener listener) throws IOException { return new VanillaMappedBlocks(path, VanillaMappedMode.RO, size, listener); } }
private void setDataBuffer(long dataLookup) throws IOException { if (dataBuffer != null) { dataBuffer.release(); } dataBuffer = IndexedChronicle.this.dataFileCache.acquire(dataLookup); dataStartAddr = dataBuffer.address(); }
public synchronized VanillaMappedBytes acquire(long index) throws IOException { if (this.mb0 != null && this.mb0.index() == index) { this.mb0.reserve(); return this.mb0; } if (this.mb1 != null && this.mb1.index() == index) { this.mb1.reserve(); return this.mb1; } return acquire0(index); }
public static VanillaMappedBlocks readOnly(final File path, long size) throws IOException { return readOnly(path, size, FileLifecycleListener.FileLifecycleListeners.IGNORE); }
private void setIndexBuffer(long index, boolean prefetch) throws IOException { if (indexBuffer != null) { indexBuffer.release(); } indexBuffer = IndexedChronicle.this.indexFileCache.acquire(index); indexPositionAddr = indexStartAddr = indexBuffer.address(); indexStartOffset = index * indexBlockSize; }
public synchronized VanillaMappedBytes acquire(long index) throws IOException { if (this.mb0 != null && this.mb0.index() == index) { this.mb0.reserve(); return this.mb0; } if (this.mb1 != null && this.mb1.index() == index) { this.mb1.reserve(); return this.mb1; } return acquire0(index); }
public static VanillaMappedBlocks readOnly(final File path, long size) throws IOException { return readOnly(path, size, FileLifecycleListener.FileLifecycleListeners.IGNORE); }
public static VanillaMappedBlocks readWrite(final File path, long size) throws IOException { return readWrite(path, size, FileLifecycleListener.FileLifecycleListeners.IGNORE); }
public static VanillaMappedBlocks readWrite(final File path, long size, FileLifecycleListener listener) throws IOException { return new VanillaMappedBlocks(path, VanillaMappedMode.RW, size, listener); }
private void setDataBuffer(long dataLookup) throws IOException { if (dataBuffer != null) { dataBuffer.release(); } dataBuffer = IndexedChronicle.this.dataFileCache.acquire(dataLookup); dataStartAddr = dataBuffer.address(); }
/** * Creates a new instance of IndexedChronicle as specified by the provided {@link * net.openhft.chronicle.ChronicleConfig} and having the specified <tt>basePath</tt> (the base name of the two * backing files). * * @param basePath the base name of the files backing this IndexChronicle * @param config the ChronicleConfig based on which the current IndexChronicle should be constructed * @throws FileNotFoundException if the <tt>basePath</tt> string does not denote an existing, writable regular file * and a new regular file of that name cannot be created, or if some other error * occurs while opening or creating the file */ public IndexedChronicle(@NotNull String basePath, @NotNull ChronicleConfig config) throws IOException { this.basePath = basePath; this.config = config.clone(); File parentFile = new File(basePath).getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } this.indexFileCache = VanillaMappedBlocks.readWrite(new File(basePath + ".index"), config.indexBlockSize()); this.dataFileCache = VanillaMappedBlocks.readWrite(new File(basePath + ".data"), config.dataBlockSize()); findTheLastIndex(); }
public static VanillaMappedBlocks readWrite(final File path, long size, FileLifecycleListener listener) throws IOException { return new VanillaMappedBlocks(path, VanillaMappedMode.RW, size, listener); }
private void setIndexBuffer(long index, boolean prefetch) throws IOException { if (indexBuffer != null) { indexBuffer.release(); } indexBuffer = IndexedChronicle.this.indexFileCache.acquire(index); indexPositionAddr = indexStartAddr = indexBuffer.address(); indexStartOffset = index * indexBlockSize; }
/** * Creates a new instance of IndexedChronicle as specified by the provided {@link * net.openhft.chronicle.ChronicleQueueBuilder} and having the specified <tt>basePath</tt> (the * base name of the two backing files). * * @param builder the builder u * @throws FileNotFoundException if the <tt>basePath</tt> string does not denote an existing, * writable regular file and a new regular file of that name * cannot be created, or if some other error occurs while opening * or creating the file */ IndexedChronicle(@NotNull ChronicleQueueBuilder.IndexedChronicleQueueBuilder builder) throws IOException { this.builder = builder.clone(); this.basePath = builder.path().getAbsolutePath(); File parentFile = builder.path().getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } this.indexFileCache = VanillaMappedBlocks.readWrite(new File(basePath + ".index"), builder.indexBlockSize(), builder.fileLifecycleListener()); this.dataFileCache = VanillaMappedBlocks.readWrite(new File(basePath + ".data"), builder.dataBlockSize(), builder.fileLifecycleListener()); findTheLastIndex(); }
public static VanillaMappedBlocks readOnly(final File path, long size, FileLifecycleListener listener) throws IOException { return new VanillaMappedBlocks(path, VanillaMappedMode.RO, size, listener); }