public class MappedFile
extends net.openhft.chronicle.core.io.AbstractCloseableReferenceCounted
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(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position)
Convenience method so you don't need to release the BytesStore
|
void |
acquireBytesForRead(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
@NotNull VanillaBytes bytes) |
@NotNull Bytes |
acquireBytesForWrite(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position) |
void |
acquireBytesForWrite(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
@NotNull VanillaBytes bytes) |
@NotNull MappedBytesStore |
acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position) |
@NotNull MappedBytesStore |
acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
BytesStore oldByteStore) |
@NotNull MappedBytesStore |
acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
BytesStore oldByteStore,
@NotNull MappedBytesStoreFactory mappedBytesStoreFactory) |
long |
actualSize() |
long |
capacity() |
long |
chunkSize() |
@NotNull File |
file() |
protected void |
finalize() |
NewChunkListener |
getNewChunkListener() |
FileLock |
lock(long position,
long size,
boolean shared)
Calls lock on the underlying file channel
|
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() |
protected void |
performRelease() |
protected boolean |
performReleaseInBackground() |
@NotNull RandomAccessFile |
raf() |
static @NotNull MappedFile |
readOnly(@NotNull File file) |
@NotNull String |
referenceCounts() |
void |
setNewChunkListener(NewChunkListener listener) |
protected boolean |
threadSafetyCheck(boolean isUsed) |
FileLock |
tryLock(long position,
long size,
boolean shared)
Calls tryLock on the underlying file channel
|
static void |
warmup() |
close, isClosed, release, releaseLast, reserve, reserveTransfer, setClosed, throwExceptionIfClosed, throwExceptionIfClosedInSetter, tryReserve
assertReferencesReleased, clearUsedByThread, createdHere, disableReferenceTracing, enableReferenceTracing, refCount, referenceId, reservedBy, throwExceptionIfNotReleased, throwExceptionIfReleased, toString, unmonitor, warnAndReleaseIfNotReleased
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
createdHere, warnAndCloseIfNotClosed
closeQuietly, closeQuietly, notifyClosing
protected MappedFile(@NotNull @NotNull File file, @NotNull @NotNull RandomAccessFile raf, long chunkSize, long overlapSize, long capacity, boolean readOnly) throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
@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 File file()
@NotNull public @NotNull MappedBytesStore acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner, long position) throws IOException, IllegalArgumentException, IllegalStateException
IllegalStateException
- if closed.IOException
IllegalArgumentException
@NotNull public @NotNull MappedBytesStore acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner, long position, BytesStore oldByteStore) throws IOException, IllegalStateException
IOException
IllegalStateException
@NotNull public @NotNull MappedBytesStore acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner, long position, BytesStore oldByteStore, @NotNull @NotNull MappedBytesStoreFactory mappedBytesStoreFactory) throws IOException, IllegalArgumentException, IllegalStateException
@NotNull public @NotNull Bytes acquireBytesForRead(net.openhft.chronicle.core.io.ReferenceOwner owner, long position) throws IOException, IllegalStateException, BufferUnderflowException
public void acquireBytesForRead(net.openhft.chronicle.core.io.ReferenceOwner owner, long position, @NotNull @NotNull VanillaBytes bytes) throws IOException, IllegalStateException, IllegalArgumentException, BufferUnderflowException, BufferOverflowException
@NotNull public @NotNull Bytes acquireBytesForWrite(net.openhft.chronicle.core.io.ReferenceOwner owner, long position) throws IOException, IllegalStateException, IllegalArgumentException, BufferOverflowException
public void acquireBytesForWrite(net.openhft.chronicle.core.io.ReferenceOwner owner, long position, @NotNull @NotNull VanillaBytes bytes) throws IOException, IllegalStateException, IllegalArgumentException, BufferUnderflowException, BufferOverflowException
protected boolean performReleaseInBackground()
performReleaseInBackground
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
protected void performRelease()
performRelease
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
@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, IllegalStateException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
@NotNull public @NotNull RandomAccessFile raf()
protected void finalize() throws Throwable
protected boolean threadSafetyCheck(boolean isUsed)
threadSafetyCheck
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
public FileLock lock(long position, long size, boolean shared) throws IOException
IOException
public FileLock tryLock(long position, long size, boolean shared) throws IOException
IOException
Copyright © 2021. All rights reserved.