public class MappedStore extends Object
| Modifier and Type | Field and Description |
|---|---|
protected net.openhft.lang.io.AbstractMappedStore.MmapInfoHolder |
mmapInfoHolder |
| Constructor and Description |
|---|
MappedStore(File file,
FileChannel.MapMode mode,
long size) |
MappedStore(File file,
FileChannel.MapMode mode,
long size,
BytesMarshallerFactory bytesMarshallerFactory)
Deprecated.
|
MappedStore(File file,
FileChannel.MapMode mode,
long startInFile,
long size,
ObjectSerializer objectSerializer) |
MappedStore(File file,
FileChannel.MapMode mode,
long size,
ObjectSerializer objectSerializer) |
| Modifier and Type | Method and Description |
|---|---|
long |
address() |
DirectBytes |
bytes()
Create a bytes whose content is the whole bytes store.
|
DirectBytes |
bytes(long offset,
long length)
|
void |
close() |
File |
file() |
void |
free() |
protected void |
map(long startInFile) |
ObjectSerializer |
objectSerializer() |
protected void |
resizeIfNeeded(long startInFile,
long newSize) |
long |
size() |
void |
syncToDisk() |
protected void |
unmapAndSyncToDisk() |
protected static void |
validateSize(long size) |
protected final net.openhft.lang.io.AbstractMappedStore.MmapInfoHolder mmapInfoHolder
public MappedStore(File file, FileChannel.MapMode mode, long size) throws IOException
IOException@Deprecated public MappedStore(File file, FileChannel.MapMode mode, long size, BytesMarshallerFactory bytesMarshallerFactory) throws IOException
IOExceptionpublic MappedStore(File file, FileChannel.MapMode mode, long size, ObjectSerializer objectSerializer) throws IOException
IOExceptionpublic MappedStore(File file, FileChannel.MapMode mode, long startInFile, long size, ObjectSerializer objectSerializer) throws IOException
IOExceptionprotected static void validateSize(long size)
protected final void resizeIfNeeded(long startInFile,
long newSize)
throws IOException
IOExceptionprotected final void map(long startInFile)
throws IOException
IOExceptionprotected final void unmapAndSyncToDisk()
throws IOException
IOExceptionpublic final void syncToDisk()
throws IOException
IOExceptionpublic final ObjectSerializer objectSerializer()
objectSerializer in interface BytesStorepublic final long address()
address in interface BytesStorepublic final long size()
size in interface BytesStorepublic final void free()
free in interface BytesStorepublic final void close()
close in interface Closeableclose in interface AutoCloseable@NotNull public final DirectBytes bytes()
BytesStorebytes(0, size()) call.bytes in interface BytesStoreBytesStore.bytes(long, long)@NotNull public final DirectBytes bytes(long offset, long length)
BytesStoreBytes object with start address of
address+ offset and capacity of length.
If this BytesStore is Bytes itself rather than natural
BytesStore object, this method will offset the new bytes from the
bytes' start, not from bytes' position like
BytesCommon.slice(long, long).
offset should be non-negative, length should be positive,
offset + length should be less or equal to size.
bytes in interface BytesStoreoffset - offset of the new bytes from the bytes store addresslength - capacity and limit of the new bytesBytesBytesStore.bytes()public final File file()
file in interface BytesStoreCopyright © 2019. All rights reserved.