Class MVStoreTool
java.lang.Object
org.h2.mvstore.MVStoreTool
Utility methods used in combination with the MVStore.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classA data type that can read any data that is persisted, and converts it to a byte array. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCompress the store by creating a new file and copying the live pages there.static voidCopy all live pages from the source store to the target store.static voidCopy all live pages from the source store to the target store.static voidcompactCleanUp(String fileName) Clean up if needed, in a case a compact operation was interrupted due to killing the process or a power failure.static voidRead the contents of the file and write them to system out.static voidRead the contents of the file and display them in a human-readable format.private static StringformatTimestamp(long t, long start) private static CompressorgetCompressor(boolean fast) (package private) static MVMap.Builder<Object, Object> private static intgetPercent(long value, long max) static voidRead the summary information of the file and write them to system out.static StringRead the summary information of the file and write them to system out.static voidRuns this tool.static voidRepair a store by rolling back to the newest good version.static longRoll back to a given revision into a file called *.temp.
-
Constructor Details
-
MVStoreTool
public MVStoreTool()
-
-
Method Details
-
main
Runs this tool. Options are case sensitive. Supported options are:Command line options [-dump <fileName>] Dump the contends of the file [-info <fileName>] Get summary information about a file [-compact <fileName>] Compact a store [-compress <fileName>] Compact a store with compression enabled - Parameters:
args- the command line arguments
-
dump
Read the contents of the file and write them to system out.- Parameters:
fileName- the name of the filedetails- whether to print details
-
info
Read the summary information of the file and write them to system out.- Parameters:
fileName- the name of the file
-
dump
-
getCompressor
-
info
-
formatTimestamp
-
getPercent
private static int getPercent(long value, long max) -
compact
Compress the store by creating a new file and copying the live pages there. Temporarily, a file with the suffix ".tempFile" is created. This file is then renamed, replacing the original file, if possible. If not, the new file is renamed to ".newFile", then the old file is removed, and the new file is renamed. This might be interrupted, so it's better to compactCleanUp before opening a store, in case this method was used.- Parameters:
fileName- the file namecompress- whether to compress the data
-
compactCleanUp
Clean up if needed, in a case a compact operation was interrupted due to killing the process or a power failure. This will delete temporary files (if any), and in case atomic file replacements were not used, rename the new file.- Parameters:
fileName- the file name
-
compact
-
compact
-
repair
Repair a store by rolling back to the newest good version.- Parameters:
fileName- the file name
-
rollback
Roll back to a given revision into a file called *.temp.- Parameters:
fileName- the file nametargetVersion- the version to roll back to (Long.MAX_VALUE for the latest version)writer- the log writer- Returns:
- the version rolled back to (-1 if no version)
-
getGenericMapBuilder
-