| Modifier and Type | Class and Description |
|---|---|
| private static class | FileStore.
A background writer thread to automatically store changes from time to time. |
| public class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private int | autoCommitDelay
The delay in milliseconds to automatically commit and write changes. |
| private final int | |
| private long | |
| private final AtomicReference | backgroundWriterThread
Reference to a background thread, which is expected to be running, if any. |
| pack-priv static final int | BLOCK_SIZE
The block size (physical sector size) of the disk. |
| private ThreadPoolExecutor | bufferSaveExecutor
Single-threaded executor for saving ByteBuffer as a new Chunk |
| private int | |
| private final CacheLongKeyLIRS | cache
The page cache. |
| pack-priv final ConcurrentHashMap | chunks
The map of chunks. |
| private final CacheLongKeyLIRS | chunksToC
Cache for chunks "Table of Content" used to translate page's sequential number within containing chunk into byte position within chunk's image. |
| private boolean | |
| private long | creationTime
The time the store was created, in milliseconds since 1970. |
| private final Deque | |
| private String | fileName
The file name. |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| protected volatile C | lastChunk
The newest chunk. |
| private int | |
| private long | |
| private MVMap | layout
The layout map. |
| private final int | |
| public static final String | META_ID_KEY
The key for the entry within "layout" map, which contains id of "meta" map. |
| pack-priv MVStore | |
| public static final int | |
| protected final AtomicLong | readBytes
The number of read bytes. |
| protected final AtomicLong | readCount
The number of read operations. |
| private boolean | readOnly
Whether this store is read-only. |
| protected final boolean | |
| private final Queue | |
| private int | retentionTime
For how long (in milliseconds) to retain a persisted chunk after it becomes irrelevant (not in use, because it only contains data from some old versions). |
| protected final ReentrantLock | |
| private ThreadPoolExecutor | serializationExecutor
Single-threaded executor for serialization of the store snapshot into ByteBuffer |
| private int | |
| private final ReentrantLock | serializationLock
Lock guarding submission to serializationExecutor |
| private long | size
The file size (cached). |
| protected final HashMap | |
| private final Queue | |
| protected final AtomicLong | writeBytes
The number of written bytes. |
| protected final AtomicLong | writeCount
The number of write operations. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | accountForRemovedPage(long
the position of the page pos, long at which page was removed version, boolean whether page is considered pinned pinned, int sequential page number within chunk pageNo)Remove a page. |
| protected abstract void | |
| protected abstract void | allocateChunkSpace(C
to allocate space for chunk, WriteBuffer to allocate space for buff)Allocate logical space and assign position of the buffer within the store. |
| public abstract void | |
| public final void | |
| pack-priv void | |
| pack-priv void | |
| private int | |
| private static <C extends Chunk | |
| private long[] | |
| public void | |
| private void | |
| public void | |
| public boolean | Returns: if any chunk was re-writtenthe minimum percentage of live entries targetFillRate, int the minimum number of bytes to write write)Try to increase the fill rate by re-writing partially full chunks. |
| private int | |
| public void | |
| protected abstract void | compactStore(int
do not compact if store fill rate above this value (0-100) thresholdFillRate, long the maximum time in milliseconds to compact maxCompactTime, int the maximum amount of data to be written as part of this call maxWriteSize, MVStore that owns this FileStore mvStore)Compact store file, that is, compact blocks that have a low fill rate, and move chunks next to each other. |
| private C | |
| protected abstract C | |
| public abstract C | |
| protected abstract C | |
| private C[] | |
| private static <C extends Chunk | |
| public final boolean | Returns: true if root was removed, false if it is not thereto deregister mapId)Performs final stage of map removal - delete root location info from the layout map. |
| protected final C | Returns: valid chunk or null if none foundto start search from (found chunk footer should be no
further than block-1) block)Discover a valid chunk, searching file backwards from the given block |
| protected abstract void | |
| public final void | |
| public void | |
| protected final boolean | findLastChunkWithCompleteValidChunkSet(Comparator<C> chunkComparator, Map<Long, C> validChunksByLocation, boolean afterFullScan)
|
| private int | |
| private Iterable | |
| protected abstract void | freeChunkSpace(Iterable<C>
chunks to be processed chunks)Mark the space occupied by specified chunks as free. |
| public final int | Returns: the delay in milliseconds, or 0 if auto-commit is disabled.Get the auto-commit delay. |
| protected final int | |
| public int | |
| private static int | |
| public int | |
| public int | Returns: the amount of memory used for cachingGet the amount of memory used for caching, in MB. |
| private C | |
| private int | |
| private C | |
| protected final ConcurrentMap | |
| public int | Returns: the fill rate, in percent (100 is completely full)Get the current fill rate (percentage of used space in the file). |
| private int | |
| protected Iterable | |
| private Iterable | |
| public long | |
| public int | Returns: the retention timeGet the default retention time for this store in milliseconds. |
| public String | |
| public abstract int | |
| public final Map | |
| private MVMap | |
| private int | |
| public final long | |
| public final int | |
| protected final MVStore | |
| private int | |
| public long | Returns: the number of write operationsGet the number of read bytes since this store was opened. |
| public long | Returns: the number of read operationsGet the number of read operations since this store was opened. |
| public final int | |
| pack-priv int | |
| protected Collection | |
| public final long | Returns: opaque "position" value, that should be used to read the pageto get root position for mapId)Get "position" of the root page for the specified map |
| public Map | |
| private long | |
| private long[] | |
| public int | |
| private MVStoreException | |
| public WriteBuffer | |
| private long | Returns: the number of write operationsGet the number of written bytes since this store was opened. |
| public long | Returns: the number of write operationsGet the number of write operations since this store was opened. |
| public final boolean | Returns: if there are any changesversion to take as a base for changes lastStoredVersion)Check whether there are any unsaved changes since specified version. |
| protected final boolean | |
| protected final void | |
| protected final void | |
| protected abstract void | |
| pack-priv boolean | |
| protected final boolean | |
| public final boolean | Returns: true if all data can be readthe version version)Check whether all data can be read from this version. |
| public boolean | |
| public final boolean | |
| private boolean | |
| private boolean | |
| public boolean | |
| private boolean | Returns: true if Chunk exists in the file and is valid, false otherwiseto verify existence chunk)Read a chunk header and footer, and verify the stored data is consistent. |
| public final long | |
| private int | |
| protected abstract void | |
| public abstract void | |
| public abstract FileStore | |
| public void | |
| protected final void | |
| protected final C | Returns: the chunk, or null if not successfulthe index of the next block after the chunk block)Try to read a chunk footer. |
| private C | |
| protected final C | Returns: the chunk, or null if the header or footer don't match or are not consistentthe block block, int of the chunk expectedId)Read a chunk header and footer, and verify the stored data is consistent. |
| protected final C | |
| protected final C | |
| public abstract ByteBuffer | Returns: the byte buffer with data requestedthat owns data to be read chunk, long the read "position" pos, int the number of bytes to read len)Read data from the store. |
| protected final ByteBuffer | |
| pack-priv <K, V> Page | |
| private <K, V> Page | |
| protected abstract void | |
| protected final void | |
| public void | |
| protected boolean | |
| private int | |
| public final void | |
| public void | saveChunkMetadataChanges(C
to save chunk)Store chunk's serialized metadata as an entry in a layout map. |
| private void | |
| private void | |
| private void | |
| public final void | setAutoCommitDelay(int
the maximum delay millis)Set the maximum delay in milliseconds to auto-commit changes. |
| public void | |
| protected final void | |
| public final void | setRetentionTime(int
how many milliseconds to retain old chunks (0 to overwrite them
as early as possible) ms)How long to retain old, persisted chunks, in milliseconds. |
| public void | |
| protected final void | |
| public abstract boolean | Returns: true if commit should happen nowamount of unsaved memory, so far unsavedMemory, int configured limit on amount of unsaved memory autoCommitMemory)Decision about autocommit is delegated to store |
| protected abstract void | shrinkStoreIfPossible(int
the minimum percentage to save minPercent)Shrink store if possible, and if at least a given percentage can be saved. |
| private void | |
| public long | |
| public MVMap | |
| public final void | |
| private void | |
| protected final void | |
| private void | |
| pack-priv final void | |
| private static int | |
| public void | |
| protected abstract boolean | |
| protected abstract void | writeChunk(C
chunk to write chunk, WriteBuffer to write buffer)Write buffer associated with chunk into store at chunk's allocated position |
| protected void | |
| protected abstract void | |
| protected abstract void | writeFully(C
to write chunk, long the write position pos, ByteBuffer the source buffer src)Write to the file. |
| pack-priv void |