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