| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private long | creationTime
The time the store was created, in milliseconds since 1970.
|
| private FileChannel | fileChannel
The current file. |
| private final FileChannel[] | fileChannels
All files currently used by this store. |
| private int | fileCount
Current number of files in use |
| private FileLock | fileLock
The file lock. |
| private final int | maxFileCount
Limit for the number of files used by this store |
| private FileChannel | originalFileChannel
The encrypted file (if encryption is used). |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | adjustStoreToLastChunk()
Implements abstract org. Make persistent changes after lastChunk was reset |
| protected void | allocateChunkSpace(MFChunk
to allocate space for chunk, WriteBuffer to allocate space for buff)Implements abstract org. Allocate logical space and assign position of the buffer within the store. |
| public void | |
| public void | |
| protected 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)Implements abstract org. Compact store file, that is, compact blocks that have a low fill rate, and move chunks next to each other. |
| protected final MFChunk | |
| public MFChunk | createChunk(String
the string s)Implements abstract org. Build a Chunk from the given string. |
| protected MFChunk | |
| protected void | |
| protected void | freeChunkSpace(Iterable<MFChunk>
chunks to be processed chunks)Implements abstract org. Mark the space occupied by specified chunks as free. |
| public int | |
| protected void | |
| public void | markUsed(long
the position in bytes pos, int the number of bytes length)Implements abstract org. Mark the space as in use. |
| public void | open(String fileName, boolean readOnly, char[] encryptionKey)
Implements abstract org.
|
| public AppendOnlyMultiFileStore | |
| private void | |
| public ByteBuffer | readFully(MFChunk
that owns data to be read chunk, long the read "position" pos, int the number of bytes to read len)Implements abstract org. Read data from the store. |
| protected void | |
| public boolean | shouldSaveNow(int
amount of unsaved memory, so far unsavedMemory, int configured limit on amount of unsaved memory autoCommitMemory)Implements abstract org. Decision about autocommit is delegated to store |
| protected void | shrinkStoreIfPossible(int
the minimum percentage to save minPercent)Implements abstract org. Shrink store if possible, and if at least a given percentage can be saved. |
| protected boolean | |
| protected void | writeChunk(MFChunk
chunk to write chunk, WriteBuffer to write buff)Implements abstract org. Write buffer associated with chunk into store at chunk's allocated position |
| protected void | writeCleanShutdownMark()
Implements abstract org. Performs final preparation before store is closed normally |
| protected void | writeFully(MFChunk
to write chunk, long the write position pos, ByteBuffer the source buffer src)Implements abstract org. Write to the file. |
| config | back to summary |
|---|---|
| private final Map<String, Object> config | |
| creationTime | back to summary |
|---|---|
| private long creationTime Hides org. The time the store was created, in milliseconds since 1970. | |
| fileChannel | back to summary |
|---|---|
| private FileChannel fileChannel The current file. This is writable channel in append mode | |
| fileChannels | back to summary |
|---|---|
| private final FileChannel[] fileChannels All files currently used by this store. This includes current one at first position. Previous files are opened in read-only mode. Logical length of this array is defined by fileCount.
| |
| fileCount | back to summary |
|---|---|
| private int fileCount Current number of files in use | |
| fileLock | back to summary |
|---|---|
| private FileLock fileLock The file lock. | |
| maxFileCount | back to summary |
|---|---|
| private final int maxFileCount Limit for the number of files used by this store
| |
| originalFileChannel | back to summary |
|---|---|
| private FileChannel originalFileChannel The encrypted file (if encryption is used). | |
| volumeId | back to summary |
|---|---|
| private int volumeId | |
| AppendOnlyMultiFileStore | back to summary |
|---|---|
| public AppendOnlyMultiFileStore(Map<String, Object> config) | |
| adjustStoreToLastChunk | back to summary |
|---|---|
| protected void adjustStoreToLastChunk() Implements abstract org. Doc from org. Make persistent changes after lastChunk was reset
| |
| allocateChunkSpace | back to summary |
|---|---|
| protected void allocateChunkSpace(MFChunk chunk, WriteBuffer buff) Implements abstract org. Doc from org. Allocate logical space and assign position of the buffer within the store.
| |
| backup | back to summary |
|---|---|
| public void backup(ZipOutputStream out) throws IOException Implements abstract org.
| |
| close | back to summary |
|---|---|
| public void close() Overrides org. Close this store.
| |
| compactStore | back to summary |
|---|---|
| protected void compactStore(int thresholdFillRate, long maxCompactTime, int maxWriteSize, MVStore mvStore) Implements abstract org. Doc from org. Compact store file, that is, compact blocks that have a low fill rate, and move chunks next to each other. This will typically shrink the file. Changes are flushed to the file, and old chunks are overwritten. | |
| createChunk | back to summary |
|---|---|
| protected final MFChunk createChunk(int newChunkId) Implements abstract org.
| |
| createChunk | back to summary |
|---|---|
| public MFChunk createChunk(String s) Implements abstract org. Doc from org. Build a Chunk from the given string. | |
| createChunk | back to summary |
|---|---|
| protected MFChunk createChunk(Map<String, String> map) Implements abstract org.
| |
| doHousekeeping | back to summary |
|---|---|
| protected void doHousekeeping(MVStore mvStore) throws InterruptedException Implements abstract org.
| |
| freeChunkSpace | back to summary |
|---|---|
| protected void freeChunkSpace(Iterable<MFChunk> chunks) Implements abstract org. Doc from org. Mark the space occupied by specified chunks as free. | |
| getFillRate | back to summary |
|---|---|
| public int getFillRate() Implements abstract org.
| |
| initializeStoreHeader | back to summary |
|---|---|
| protected void initializeStoreHeader(long time) Implements abstract org.
| |
| markUsed | back to summary |
|---|---|
| public void markUsed(long pos, int length) Implements abstract org. Doc from org. Mark the space as in use.
| |
| open | back to summary |
|---|---|
| public void open(String fileName, boolean readOnly, char[] encryptionKey) Implements abstract org.
| |
| open | back to summary |
|---|---|
| public AppendOnlyMultiFileStore open(String fileName, boolean readOnly) Implements abstract org.
| |
| open | back to summary |
|---|---|
| private void open(String fileName, boolean readOnly, Function<FileChannel, FileChannel> encryptionTransformer) | |
| readFully | back to summary |
|---|---|
| public ByteBuffer readFully(MFChunk chunk, long pos, int len) Implements abstract org. Doc from org. Read data from the store.
| |
| readStoreHeader | back to summary |
|---|---|
| protected void readStoreHeader(boolean recoveryMode) Implements abstract org.
| |
| shouldSaveNow | back to summary |
|---|---|
| public boolean shouldSaveNow(int unsavedMemory, int autoCommitMemory) Implements abstract org. Doc from org. Decision about autocommit is delegated to store
| |
| shrinkStoreIfPossible | back to summary |
|---|---|
| protected void shrinkStoreIfPossible(int minPercent) Implements abstract org. Doc from org. Shrink store if possible, and if at least a given percentage can be saved.
| |
| validateFileLength | back to summary |
|---|---|
| protected boolean validateFileLength(String msg) Implements abstract org.
| |
| writeChunk | back to summary |
|---|---|
| protected void writeChunk(MFChunk chunk, WriteBuffer buff) Implements abstract org. Doc from org. Write buffer associated with chunk into store at chunk's allocated position
| |
| writeCleanShutdownMark | back to summary |
|---|---|
| protected void writeCleanShutdownMark() Implements abstract org. Doc from org. Performs final preparation before store is closed normally
| |
| writeFully | back to summary |
|---|---|
| protected void writeFully(MFChunk chunk, long pos, ByteBuffer src) Implements abstract org. Doc from org. Write to the file.
| |