public abstract class MappedFile
extends net.openhft.chronicle.core.io.AbstractCloseableReferenceCounted
Modifier and Type | Field and Description |
---|---|
protected String |
canonicalPath |
protected NewChunkListener |
newChunkListener |
Modifier | Constructor and Description |
---|---|
protected |
MappedFile(@NotNull File file,
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) |
abstract @NotNull MappedBytesStore |
acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
BytesStore oldByteStore,
@NotNull MappedBytesStoreFactory mappedBytesStoreFactory) |
abstract long |
actualSize() |
protected boolean |
canReleaseInBackground() |
abstract long |
capacity() |
abstract long |
chunkCount() |
abstract void |
chunkCount(long[] chunkCount) |
abstract long |
chunkSize() |
abstract MappedBytes |
createBytesFor() |
@NotNull File |
file() |
protected void |
finalize() |
NewChunkListener |
getNewChunkListener() |
abstract 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) |
static @NotNull MappedFile |
ofSingle(@NotNull File file,
long capacity,
boolean readOnly) |
abstract long |
overlapSize() |
abstract @NotNull RandomAccessFile |
raf() |
boolean |
readOnly() |
static @NotNull MappedFile |
readOnly(@NotNull File file) |
abstract @NotNull String |
referenceCounts() |
void |
setNewChunkListener(NewChunkListener listener) |
protected boolean |
threadSafetyCheck(boolean isUsed) |
abstract FileLock |
tryLock(long position,
long size,
boolean shared)
Calls tryLock on the underlying file channel
|
static void |
warmup() |
backgroundPerformRelease, close, isClosed, release, releaseLast, reserve, reserveTransfer, setClosed, setClosing, throwExceptionIfClosed, throwExceptionIfClosedInSetter, tryReserve
assertReferencesReleased, clearUsedByThread, createdHere, disableReferenceTracing, enableReferenceTracing, performRelease, refCount, referenceId, reservedBy, throwExceptionIfNotReleased, throwExceptionIfReleased, toString, unmonitor, warnAndReleaseIfNotReleased
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected final String canonicalPath
protected NewChunkListener newChunkListener
protected MappedFile(@NotNull @NotNull File file, 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 ofSingle(@NotNull @NotNull File file, long capacity, 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()
public boolean readOnly()
@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 abstract @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 canReleaseInBackground()
canReleaseInBackground
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
@NotNull public abstract @NotNull String referenceCounts()
public abstract long capacity()
public abstract long chunkSize()
public abstract long overlapSize()
public NewChunkListener getNewChunkListener()
public void setNewChunkListener(NewChunkListener listener)
public abstract long actualSize()
@NotNull public abstract @NotNull RandomAccessFile raf()
protected void finalize() throws Throwable
protected boolean threadSafetyCheck(boolean isUsed)
threadSafetyCheck
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
public abstract FileLock lock(long position, long size, boolean shared) throws IOException
IOException
public abstract FileLock tryLock(long position, long size, boolean shared) throws IOException
IOException
public abstract long chunkCount()
public abstract void chunkCount(long[] chunkCount)
public abstract MappedBytes createBytesFor()
Copyright © 2021. All rights reserved.