Package org.h2.mvstore
Class SingleFileStore
The default storage mechanism of the MVStore. This implementation persists
data to a file. The file store is responsible to persist data and for free
space management.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.h2.mvstore.FileStore
FileStore.PageSerializationManager -
Field Summary
Fields inherited from class org.h2.mvstore.RandomAccessStore
freeSpaceFields inherited from class org.h2.mvstore.FileStore
lastChunk, META_ID_KEY, PIPE_LENGTH, readBytes, readCount, recoveryMode, saveChunkLock, storeHeader, writeBytes, writeCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbackup(ZipOutputStream out) voidclose()Close this store.static StringFix the file name, replacing backslash with slash.protected longintgetMovePriority(int block) Calculates relative "priority" for chunk to be moved.voidTry to open the file.Read data from the store.voidsync()Flush all changes.toString()voidtruncate(long size) Truncate the file.protected voidwriteFully(SFChunk chunk, long pos, ByteBuffer src) Write to the file.Methods inherited from class org.h2.mvstore.RandomAccessStore
adjustStoreToLastChunk, allocateChunkSpace, clear, compactMoveChunks, compactStore, createChunk, createChunk, createChunk, doHousekeeping, free, freeChunkSpace, getFillRate, getRewriteCandidates, initializeStoreHeader, isSpaceReused, markUsed, readStoreHeader, setReuseSpace, shouldSaveNow, shrinkStoreIfPossible, validateFileLength, writeChunk, writeCleanShutdownMarkMethods inherited from class org.h2.mvstore.FileStore
accountForRemovedPage, bind, 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, getRootPos, getStoreHeader, getTocCacheHitRatio, getWriteBuffer, getWriteCount, hasChangesSince, hasPersistentData, init, initializeCommonHeaderAttributes, isIdle, isKnownVersion, isReadOnly, isRegularMap, lastChunkVersion, populateInfo, processCommonHeaderAttributes, readChunkFooter, readChunkHeaderAndFooter, readChunkHeaderOptionally, readChunkHeaderOptionally, readFully, registerDeadChunk, releaseWriteBuffer, rewriteChunks, rollbackTo, saveChunkMetadataChanges, setAutoCommitDelay, setCacheSize, setLastChunk, setRetentionTime, setSize, size, start, stop, store, writeCleanShutdown
-
Constructor Details
-
SingleFileStore
-
-
Method Details
-
toString
-
readFully
Description copied from class:FileStoreRead data from the store. -
writeFully
Description copied from class:FileStoreWrite to the file.- Specified by:
writeFullyin classFileStore<SFChunk>- Parameters:
chunk- to writepos- the write positionsrc- the source buffer
-
open
Try to open the file. -
open
-
close
public void close()Close this store. -
sync
public void sync()Flush all changes. -
truncate
public void truncate(long size) Truncate the file.- Specified by:
truncatein classRandomAccessStore- Parameters:
size- the new file size
-
getMovePriority
public int getMovePriority(int block) Calculates relative "priority" for chunk to be moved.- Overrides:
getMovePriorityin classRandomAccessStore- Parameters:
block- where chunk starts- Returns:
- priority, bigger number indicate that chunk need to be moved sooner
-
getAfterLastBlock_
protected long getAfterLastBlock_()- Overrides:
getAfterLastBlock_in classRandomAccessStore
-
backup
- Specified by:
backupin classFileStore<SFChunk>- Throws:
IOException
-
correctFileName
Fix the file name, replacing backslash with slash.- Parameters:
f- the file name- Returns:
- the corrected file name
-