public final class AppendOnlyMultiFileStore extends FileStore<org.h2.mvstore.MFChunk>
FileStore.PageSerializationManagerlastChunk, META_ID_KEY, PIPE_LENGTH, readBytes, readCount, recoveryMode, saveChunkLock, storeHeader, writeBytes, writeCount| Constructor and Description |
|---|
AppendOnlyMultiFileStore(java.util.Map<java.lang.String,java.lang.Object> config) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjustStoreToLastChunk()
Make persistent changes after lastChunk was reset
|
protected void |
allocateChunkSpace(org.h2.mvstore.MFChunk chunk,
WriteBuffer buff)
Allocate logical space and assign position of the buffer within the store.
|
void |
backup(java.util.zip.ZipOutputStream out) |
void |
close()
Close this store.
|
protected void |
compactStore(int thresholdFillRate,
long maxCompactTime,
int maxWriteSize,
MVStore mvStore)
Compact store file, that is, compact blocks that have a low
fill rate, and move chunks next to each other.
|
protected org.h2.mvstore.MFChunk |
createChunk(int newChunkId) |
protected org.h2.mvstore.MFChunk |
createChunk(java.util.Map<java.lang.String,java.lang.String> map) |
org.h2.mvstore.MFChunk |
createChunk(java.lang.String s)
Build a Chunk from the given string.
|
protected void |
doHousekeeping(MVStore mvStore) |
protected void |
freeChunkSpace(java.lang.Iterable<org.h2.mvstore.MFChunk> chunks)
Mark the space occupied by specified chunks as free.
|
int |
getFillRate() |
protected void |
initializeStoreHeader(long time) |
void |
markUsed(long pos,
int length)
Mark the space as in use.
|
AppendOnlyMultiFileStore |
open(java.lang.String fileName,
boolean readOnly) |
void |
open(java.lang.String fileName,
boolean readOnly,
char[] encryptionKey) |
java.nio.ByteBuffer |
readFully(org.h2.mvstore.MFChunk chunk,
long pos,
int len)
Read data from the store.
|
protected void |
readStoreHeader(boolean recoveryMode) |
boolean |
shouldSaveNow(int unsavedMemory,
int autoCommitMemory)
Decision about autocommit is delegated to store
|
protected void |
shrinkStoreIfPossible(int minPercent)
Shrink store if possible, and if at least a given percentage can be
saved.
|
protected boolean |
validateFileLength(java.lang.String msg) |
protected void |
writeChunk(org.h2.mvstore.MFChunk chunk,
WriteBuffer buff)
Write buffer associated with chunk into store at chunk's allocated position
|
protected void |
writeCleanShutdownMark()
Performs final preparation before store is closed normally
|
protected void |
writeFully(org.h2.mvstore.MFChunk chunk,
long pos,
java.nio.ByteBuffer src)
Write to the file.
|
accountForRemovedPage, bind, clear, compact, compactStore, deregisterMapRoot, discoverChunk, dropUnusedChunks, executeFilestoreOperation, findLastChunkWithCompleteValidChunkSet, getAutoCommitDelay, getAutoCompactFillRate, getCacheHitRatio, getCacheSize, getCacheSizeUsed, getChunks, getChunksFillRate, getChunksFromLayoutMap, getCreationTime, getDefaultRetentionTime, getFileName, getLayoutMap, getMaxPageSize, getMetaMapId, getMvStore, getReadBytes, getReadCount, getRetentionTime, getRewriteCandidates, getRootPos, getStoreHeader, getTocCacheHitRatio, getWriteBuffer, getWriteCount, hasChangesSince, hasPersistentData, init, initializeCommonHeaderAttributes, isIdle, isKnownVersion, isReadOnly, isRegularMap, isSpaceReused, lastChunkVersion, populateInfo, processCommonHeaderAttributes, readChunkFooter, readChunkHeaderAndFooter, readChunkHeaderOptionally, readChunkHeaderOptionally, readFully, registerDeadChunk, releaseWriteBuffer, rewriteChunks, rollbackTo, saveChunkMetadataChanges, setAutoCommitDelay, setCacheSize, setLastChunk, setRetentionTime, setReuseSpace, setSize, size, start, stop, store, sync, writeCleanShutdownpublic AppendOnlyMultiFileStore(java.util.Map<java.lang.String,java.lang.Object> config)
protected final org.h2.mvstore.MFChunk createChunk(int newChunkId)
createChunk in class FileStore<org.h2.mvstore.MFChunk>public org.h2.mvstore.MFChunk createChunk(java.lang.String s)
FileStorecreateChunk in class FileStore<org.h2.mvstore.MFChunk>s - the stringprotected org.h2.mvstore.MFChunk createChunk(java.util.Map<java.lang.String,java.lang.String> map)
createChunk in class FileStore<org.h2.mvstore.MFChunk>public boolean shouldSaveNow(int unsavedMemory,
int autoCommitMemory)
FileStoreshouldSaveNow in class FileStore<org.h2.mvstore.MFChunk>unsavedMemory - amount of unsaved memory, so farautoCommitMemory - configured limit on amount of unsaved memorypublic void open(java.lang.String fileName,
boolean readOnly,
char[] encryptionKey)
public AppendOnlyMultiFileStore open(java.lang.String fileName, boolean readOnly)
public void close()
protected void writeFully(org.h2.mvstore.MFChunk chunk,
long pos,
java.nio.ByteBuffer src)
FileStorewriteFully in class FileStore<org.h2.mvstore.MFChunk>chunk - to writepos - the write positionsrc - the source bufferpublic java.nio.ByteBuffer readFully(org.h2.mvstore.MFChunk chunk,
long pos,
int len)
FileStoreprotected void initializeStoreHeader(long time)
initializeStoreHeader in class FileStore<org.h2.mvstore.MFChunk>protected void readStoreHeader(boolean recoveryMode)
readStoreHeader in class FileStore<org.h2.mvstore.MFChunk>protected void allocateChunkSpace(org.h2.mvstore.MFChunk chunk,
WriteBuffer buff)
FileStoreallocateChunkSpace in class FileStore<org.h2.mvstore.MFChunk>chunk - to allocate space forbuff - to allocate space forprotected void writeChunk(org.h2.mvstore.MFChunk chunk,
WriteBuffer buff)
FileStorewriteChunk in class FileStore<org.h2.mvstore.MFChunk>chunk - chunk to writebuff - to writeprotected void writeCleanShutdownMark()
FileStorewriteCleanShutdownMark in class FileStore<org.h2.mvstore.MFChunk>protected void adjustStoreToLastChunk()
FileStoreadjustStoreToLastChunk in class FileStore<org.h2.mvstore.MFChunk>protected void compactStore(int thresholdFillRate,
long maxCompactTime,
int maxWriteSize,
MVStore mvStore)
FileStorecompactStore in class FileStore<org.h2.mvstore.MFChunk>thresholdFillRate - do not compact if store fill rate above this value (0-100)maxCompactTime - the maximum time in milliseconds to compactmaxWriteSize - the maximum amount of data to be written as part of this callmvStore - that owns this FileStoreprotected void doHousekeeping(MVStore mvStore) throws java.lang.InterruptedException
doHousekeeping in class FileStore<org.h2.mvstore.MFChunk>java.lang.InterruptedExceptionpublic int getFillRate()
getFillRate in class FileStore<org.h2.mvstore.MFChunk>protected void shrinkStoreIfPossible(int minPercent)
FileStoreshrinkStoreIfPossible in class FileStore<org.h2.mvstore.MFChunk>minPercent - the minimum percentage to savepublic void markUsed(long pos,
int length)
FileStoreprotected void freeChunkSpace(java.lang.Iterable<org.h2.mvstore.MFChunk> chunks)
FileStorefreeChunkSpace in class FileStore<org.h2.mvstore.MFChunk>chunks - chunks to be processedprotected boolean validateFileLength(java.lang.String msg)
validateFileLength in class FileStore<org.h2.mvstore.MFChunk>