public class MappedFile extends Object implements net.openhft.chronicle.core.ReferenceCounted
Modifier | Constructor and Description |
---|---|
protected |
MappedFile(@NotNull File file,
@NotNull RandomAccessFile raf,
long chunkSize,
long overlapSize,
long capacity,
boolean readOnly) |
Modifier and Type | Method and Description |
---|---|
@NotNull Bytes |
acquireBytesForRead(long position)
Convenience method so you don't need to release the BytesStore
|
void |
acquireBytesForRead(long position,
@NotNull VanillaBytes bytes) |
@NotNull Bytes |
acquireBytesForWrite(long position) |
void |
acquireBytesForWrite(long position,
@NotNull VanillaBytes bytes) |
@NotNull MappedBytesStore |
acquireByteStore(long position) |
<T extends MappedBytesStore> |
acquireByteStore(long position,
@NotNull MappedBytesStoreFactory<T> mappedBytesStoreFactory) |
long |
actualSize() |
long |
capacity() |
static void |
checkMappedFiles() |
long |
chunkSize() |
@NotNull File |
file() |
NewChunkListener |
getNewChunkListener() |
boolean |
isClosed() |
static @NotNull MappedFile |
mappedFile(@NotNull File file,
long chunkSize) |
static @NotNull MappedFile |
mappedFile(@NotNull File file,
long chunkSize,
long overlapSize) |
static @NotNull MappedFile |
mappedFile(@NotNull File file,
long chunkSize,
long overlapSize,
boolean readOnly) |
static @NotNull MappedFile |
mappedFile(@NotNull File file,
long capacity,
long chunkSize,
long overlapSize,
boolean readOnly) |
static @NotNull MappedFile |
mappedFile(@NotNull String filename,
long chunkSize) |
static @NotNull MappedFile |
mappedFile(@NotNull String filename,
long chunkSize,
long overlapSize) |
static @NotNull MappedFile |
of(@NotNull File file,
long chunkSize,
long overlapSize,
boolean readOnly) |
long |
overlapSize() |
@NotNull RandomAccessFile |
raf() |
static @NotNull MappedFile |
readOnly(@NotNull File file) |
long |
refCount() |
@NotNull String |
referenceCounts() |
void |
release() |
void |
reserve() |
void |
setNewChunkListener(NewChunkListener listener) |
boolean |
tryReserve() |
static void |
warmup() |
@NotNull MappedFile |
withSizes(long chunkSize,
long overlapSize) |
protected MappedFile(@NotNull @NotNull File file, @NotNull @NotNull RandomAccessFile raf, long chunkSize, long overlapSize, long capacity, boolean readOnly)
public static void checkMappedFiles()
@NotNull public static @NotNull MappedFile of(@NotNull @NotNull File file, long chunkSize, long overlapSize, boolean readOnly) throws FileNotFoundException
FileNotFoundException
@NotNull public static @NotNull MappedFile mappedFile(@NotNull @NotNull File file, long chunkSize) throws FileNotFoundException
FileNotFoundException
@NotNull public static @NotNull MappedFile mappedFile(@NotNull @NotNull String filename, long chunkSize) throws FileNotFoundException
FileNotFoundException
@NotNull public static @NotNull MappedFile mappedFile(@NotNull @NotNull String filename, long chunkSize, long overlapSize) throws FileNotFoundException
FileNotFoundException
@NotNull public static @NotNull MappedFile mappedFile(@NotNull @NotNull File file, long chunkSize, long overlapSize) throws FileNotFoundException
FileNotFoundException
@NotNull public static @NotNull MappedFile mappedFile(@NotNull @NotNull File file, long chunkSize, long overlapSize, boolean readOnly) throws FileNotFoundException
FileNotFoundException
@NotNull public static @NotNull MappedFile readOnly(@NotNull @NotNull File file) throws FileNotFoundException
FileNotFoundException
@NotNull public static @NotNull MappedFile mappedFile(@NotNull @NotNull File file, long capacity, long chunkSize, long overlapSize, boolean readOnly) throws IOException
IOException
public static void warmup()
@NotNull public @NotNull MappedFile withSizes(long chunkSize, long overlapSize)
@NotNull public @NotNull File file()
@NotNull public @NotNull MappedBytesStore acquireByteStore(long position) throws IOException, IllegalArgumentException, IllegalStateException
@NotNull public <T extends MappedBytesStore> T acquireByteStore(long position, @NotNull @NotNull MappedBytesStoreFactory<T> mappedBytesStoreFactory) throws IOException, IllegalArgumentException, IllegalStateException
@NotNull public @NotNull Bytes acquireBytesForRead(long position) throws IOException, IllegalStateException, IllegalArgumentException
public void acquireBytesForRead(long position, @NotNull @NotNull VanillaBytes bytes) throws IOException, IllegalStateException, IllegalArgumentException
@NotNull public @NotNull Bytes acquireBytesForWrite(long position) throws IOException, IllegalStateException, IllegalArgumentException
public void acquireBytesForWrite(long position, @NotNull @NotNull VanillaBytes bytes) throws IOException, IllegalStateException, IllegalArgumentException
public void reserve() throws IllegalStateException
reserve
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
public void release() throws IllegalStateException
release
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
public long refCount()
refCount
in interface net.openhft.chronicle.core.ReferenceCounted
public boolean tryReserve()
tryReserve
in interface net.openhft.chronicle.core.ReferenceCounted
@NotNull public @NotNull String referenceCounts()
public long capacity()
public long chunkSize()
public long overlapSize()
public NewChunkListener getNewChunkListener()
public void setNewChunkListener(NewChunkListener listener)
public long actualSize() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
public boolean isClosed()
@NotNull public @NotNull RandomAccessFile raf()
Copyright © 2020. All rights reserved.