Store Options
The options of one open store, which may differ at every open. Every option has a safe default, so StoreOptions() opens a store that works on any heap; the values below bound what a store does, never how much of the JVM's heap it needs, which the engine derives from the heap it runs on. The options fixed when a store is created are CreationOptions.
| Option | Default | Range |
|---|---|---|
| encoderBudgetBytes | 8 MiB, or 2 × fragmentBytes if that is more | ≥ 2 × fragmentBytes, ≤ 1 GiB |
| maxDepth | 1024 | 1 … 1 000 000 |
| maxDocumentBytes | unlimited | ≥ 1 |
| maxStringBytes | unlimited | ≥ 0 |
| ioParallelism | 16 | 1 … 1024 |
| durability | Durability.SyncEachBatch | |
| compression | true | |
| mmapReads | false |
Options are values: two instances with the same settings are equal, and copy derives a variant, such as StoreOptions().copy(compression = false).
encoderBudgetBytes: pending bytes an insert keeps before it writes fragments early;
nullfor the default. It only steers how new inserts are split. Opening a store fails with IllegalArgumentException when it is below twice the store's CreationOptions.fragmentBytes.maxDepth, maxDocumentBytes, maxStringBytes: limits of SPEC.md §1.3; a document over one of them is rejected with RejectReason.LIMIT_EXCEEDED.
ioParallelism: threads for the suspending operations of JsonStore.
durability: when acknowledged writes are synced to disk.
compression: compress fragment payloads. Each payload records how it was stored, so a store written with compression reads back with it off and the other way round; the option only chooses what new writes do.
mmapReads: read sealed segment files through memory mappings instead of positional reads. Saves a copy per block read and leaves the pages to the OS. Off by default: on Windows a mapped file can't be deleted, so a compaction that retires a mapped segment waits for its readers, and a store that maps far more than the machine's memory pages harder than it reads. Try it on read-heavy stores whose segments fit in memory.
Properties
Functions
These options with the given ones changed; the result is validated like a new instance.