public class ChunkedMappedFile extends MappedFile
DEFAULT_SYNC_MODE, newChunkListener, RETAIN| Constructor and Description |
|---|
ChunkedMappedFile(@NotNull File file,
@NotNull RandomAccessFile raf,
long chunkSize,
long overlapSize,
int pageSize,
long capacity,
boolean readOnly) |
ChunkedMappedFile(@NotNull File file,
@NotNull RandomAccessFile raf,
long chunkSize,
long overlapSize,
long capacity,
boolean readOnly) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull MappedBytesStore |
acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
BytesStore oldByteStore,
@NotNull MappedBytesStoreFactory mappedBytesStoreFactory)
Acquires a byte store at the specified position with the ability to re-use an existing byte store,
and specify a custom byte store factory.
|
long |
actualSize()
Returns the actual size of the mapped file in bytes, including any space reserved
for metadata, headers, etc.
|
long |
capacity()
Returns the capacity of the mapped file in bytes.
|
long |
chunkCount()
Returns the number of chunks in this mapped file.
|
void |
chunkCount(long[] chunkCount)
Populates the provided array with detailed chunk count information.
|
long |
chunkSize()
Returns the size of each chunk in the mapped file in bytes.
|
MappedBytes |
createBytesFor()
Creates a MappedBytes object for this mapped file.
|
protected void |
finalize()
This finalize() is used to detect when a component is not released deterministically.
|
NewChunkListener |
getNewChunkListener()
Returns the listener that is notified when a new chunk is created.
|
FileLock |
lock(long position,
long size,
boolean shared)
Calls lock on the underlying file channel
|
long |
overlapSize()
Returns the size of the overlap between consecutive chunks in the mapped file in bytes.
|
protected void |
performRelease() |
@NotNull RandomAccessFile |
raf()
Returns the RandomAccessFile associated with the mapped file.
|
@NotNull String |
referenceCounts()
Returns a string representation of the reference counts for the underlying mapped byte stores.
|
void |
setNewChunkListener(NewChunkListener listener)
Sets the listener to be notified when a new chunk is created.
|
void |
syncMode(SyncMode syncMode)
This mode determines whether an MS_ASYNC or MS_SYNC should be performed on a chunk release.
|
protected boolean |
threadSafetyCheck(boolean isUsed)
Performs a thread safety check on the component.
|
FileLock |
tryLock(long position,
long size,
boolean shared)
Calls tryLock on the underlying file channel
|
static void |
warmup()
Not compatible with hugetlbfs
|
acquireBytesForRead, acquireBytesForRead, acquireBytesForWrite, acquireBytesForWrite, acquireByteStore, acquireByteStore, canReleaseInBackground, file, internalizedToken, mappedFile, mappedFile, mappedFile, mappedFile, mappedFile, mappedFile, of, of, ofSingle, readOnly, readOnlybackgroundPerformRelease, close, isClosed, release, releaseLast, reserve, reserveTransfer, setClosed, setClosing, throwExceptionIfClosed, throwExceptionIfClosedInSetter, tryReserveaddReferenceChangeListener, assertReferencesReleased, clearUsedByThread, createdHere, disableReferenceTracing, enableReferenceTracing, refCount, referenceCountedUnmonitored, referenceId, removeReferenceChangeListener, reservedBy, singleThreadedCheckDisabled, singleThreadedCheckReset, throwExceptionIfNotReleased, throwExceptionIfReleased, toString, unmonitor, warnAndReleaseIfNotReleasedclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic ChunkedMappedFile(@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.IORuntimeExceptionpublic ChunkedMappedFile(@NotNull
@NotNull File file,
@NotNull
@NotNull RandomAccessFile raf,
long chunkSize,
long overlapSize,
int pageSize,
long capacity,
boolean readOnly)
throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeExceptionpublic static void warmup()
@NotNull public @NotNull MappedBytesStore acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner, long position, BytesStore oldByteStore, @NotNull @NotNull MappedBytesStoreFactory mappedBytesStoreFactory) throws IOException, IllegalArgumentException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
MappedFileacquireByteStore in class MappedFileowner - The owner of the byte store.position - The position at which the byte store should be acquired.oldByteStore - The old byte store that can be re-used, or null if not available.mappedBytesStoreFactory - The factory to use for creating the MappedBytesStore.IOException - If an I/O error occurs.IllegalArgumentException - If an illegal argument is provided.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe waypublic void syncMode(SyncMode syncMode)
MappedFilePerforms this sync on any open store as well
syncMode in class MappedFilesyncMode - of sync to perform.protected void performRelease()
performRelease in class net.openhft.chronicle.core.io.AbstractReferenceCounted@NotNull public @NotNull String referenceCounts()
MappedFilereferenceCounts in class MappedFilepublic long capacity()
MappedFilecapacity in class MappedFilepublic long chunkSize()
MappedFilechunkSize in class MappedFilepublic long overlapSize()
MappedFileoverlapSize in class MappedFilepublic NewChunkListener getNewChunkListener()
MappedFilegetNewChunkListener in class MappedFilepublic void setNewChunkListener(NewChunkListener listener)
MappedFilesetNewChunkListener in class MappedFilelistener - The listener to be set.public long actualSize()
throws net.openhft.chronicle.core.io.IORuntimeException,
IllegalStateException
MappedFileactualSize in class MappedFilenet.openhft.chronicle.core.io.IORuntimeExceptionIllegalStateException@NotNull public @NotNull RandomAccessFile raf()
MappedFileraf in class MappedFileprotected void finalize()
throws Throwable
finalize in class MappedFileThrowableprotected boolean threadSafetyCheck(boolean isUsed)
MappedFilethreadSafetyCheck in class MappedFileisUsed - Flag to indicate whether the component is used.public FileLock lock(long position, long size, boolean shared) throws IOException
lock in class MappedFileposition - The byte position at which the locked region begins.size - The size of the region to lock, in bytes.shared - If true, the lock will be shared. Otherwise, it will be exclusive.IOException - If an I/O error occurs.public FileLock tryLock(long position, long size, boolean shared) throws IOException
tryLock in class MappedFileposition - The byte position at which the locked region begins.size - The size of the region to lock, in bytes.shared - If true, the lock will be shared. Otherwise, it will be exclusive.null if the lock could not be acquired.IOException - If an I/O error occurs.public long chunkCount()
MappedFilechunkCount in class MappedFilepublic void chunkCount(long[] chunkCount)
MappedFilechunkCount in class MappedFilechunkCount - The array to be populated with detailed chunk count information.public MappedBytes createBytesFor() throws net.openhft.chronicle.core.io.ClosedIllegalStateException
MappedFilecreateBytesFor in class MappedFilenet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.Copyright © 2023. All rights reserved.