Package io.permazen.core
Class TransactionConfig.Builder
java.lang.Object
io.permazen.core.TransactionConfig.Builder
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- TransactionConfig
Builder for
TransactionConfig
s.-
Method Summary
Modifier and TypeMethodDescriptionallowNewSchema
(boolean allowNewSchema) Configure whether, if the configured schema is not already registered in the database when new transactions are created, it is allowed to register it.build()
Create a newTransactionConfig
from this instance.clone()
Clone this instance.garbageCollectSchemas
(boolean garbageCollectSchemas) Configure whether automatic schema garbage collection should be enabled.ConfigureKVDatabase
transaction options.schemaModel
(SchemaModel schemaModel) Configure the schema to use.
-
Method Details
-
schemaModel
Configure the schema to use.By default this is null, which means that an empty schema will be used.
- Parameters:
schemaModel
- schema to use when creating transactions- Returns:
- this instance
-
allowNewSchema
Configure whether, if the configured schema is not already registered in the database when new transactions are created, it is allowed to register it.The default value is true.
- Parameters:
allowNewSchema
- whether registering a new schema is allowed- Returns:
- this instance
-
garbageCollectSchemas
Configure whether automatic schema garbage collection should be enabled.When automatic schema garbage collection is enabled, unused schemas are garbage collected at the start of each transaction. This adds a small amount of overhead to transaction startup, but only when a new schema set is encountered.
The default value is false.
- Parameters:
garbageCollectSchemas
- whether to enable automatic schema garbage collection- Returns:
- this instance
-
kvOptions
ConfigureKVDatabase
transaction options.The default value is null.
- Parameters:
kvoptions
- options to use when creating new transactions in the underlyingKVDatabase
, or null for none- Returns:
- this instance
- See Also:
-
build
Create a newTransactionConfig
from this instance.- Returns:
- new transaction config
- Throws:
InvalidSchemaException
- if the configured schema is invalid (i.e., does not pass validation checks)
-
clone
Clone this instance.
-