Constructor and Description |
---|
Builder()
Creates new instance of MVStore.Builder.
|
Modifier and Type | Method and Description |
---|---|
MVStore.Builder |
autoCommitBufferSize(int kb)
Set the size of the write buffer, in KB disk space (for file-based
stores).
|
MVStore.Builder |
autoCommitDisabled()
Disable auto-commit, by setting the auto-commit delay and auto-commit
buffer size to 0.
|
MVStore.Builder |
autoCompactFillRate(int percent)
Set the auto-compact target fill rate.
|
MVStore.Builder |
backgroundExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler)
Set the listener to be used for exceptions that occur when writing in
the background thread.
|
MVStore.Builder |
cacheConcurrency(int concurrency)
Set the read cache concurrency.
|
MVStore.Builder |
cacheSize(int mb)
Set the read cache size in MB.
|
MVStore.Builder |
compress()
Compress data before writing using the LZF algorithm.
|
MVStore.Builder |
compressHigh()
Compress data before writing using the Deflate algorithm.
|
MVStore.Builder |
encryptionKey(char[] password)
Encrypt / decrypt the file using the given password.
|
MVStore.Builder |
fileName(String fileName)
Use the following file name.
|
MVStore.Builder |
fileStore(FileStore store)
Use the provided file store instead of the default one.
|
static MVStore.Builder |
fromString(String s)
Read the configuration from a string.
|
MVStore |
open()
Open the store.
|
MVStore.Builder |
pageSplitSize(int pageSplitSize)
Set the amount of memory a page should contain at most, in bytes,
before it is split.
|
MVStore.Builder |
readOnly()
Open the file in read-only mode.
|
String |
toString() |
public MVStore.Builder autoCommitDisabled()
public MVStore.Builder autoCommitBufferSize(int kb)
The default is 1024 KB.
When the value is set to 0 or lower, data is not automatically stored.
kb
- the write buffer size, in kilobytespublic MVStore.Builder autoCompactFillRate(int percent)
The default value is 40 (40%). The value 0 disables auto-compacting.
percent
- the target fill ratepublic MVStore.Builder fileName(String fileName)
fileName
- the file namepublic MVStore.Builder encryptionKey(char[] password)
password
- the passwordpublic MVStore.Builder readOnly()
If this option is not used, the file is locked exclusively.
Please note a store may only be opened once in every JVM (no matter whether it is opened in read-only or read-write mode), because each file may be locked only once in a process.
public MVStore.Builder cacheSize(int mb)
mb
- the cache size in megabytespublic MVStore.Builder cacheConcurrency(int concurrency)
concurrency
- the cache concurrencypublic MVStore.Builder compress()
This setting only affects writes; it is not necessary to enable compression when reading, even if compression was enabled when writing.
public MVStore.Builder compressHigh()
This setting only affects writes; it is not necessary to enable compression when reading, even if compression was enabled when writing.
public MVStore.Builder pageSplitSize(int pageSplitSize)
pageSplitSize
- the page sizepublic MVStore.Builder backgroundExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler)
exceptionHandler
- the handlerpublic MVStore.Builder fileStore(FileStore store)
File stores passed in this way need to be open. They are not closed when closing the store.
Please note that any kind of store (including an off-heap store) is considered a "persistence", while an "in-memory store" means objects are not persisted and fully kept in the JVM heap.
store
- the file storepublic MVStore open()
public static MVStore.Builder fromString(String s)
s
- the string representationCopyright © 2020 JBoss by Red Hat. All rights reserved.