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.ConfigureKVDatabase
transaction options.schemaModel
(SchemaModel schemaModel) Configure the schema to use.schemaRemoval
(TransactionConfig.SchemaRemoval schemaRemoval) Configure when to automatically detect and remove unused schemas from the database.
-
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
-
schemaRemoval
Configure when to automatically detect and remove unused schemas from the database.When schema removal is enabled, unused schemas (i.e., those for which zero objects exist) are automatically detected and removed at the beginning certain transactions. This operation adds a small amount of overhead.
The default value is
TransactionConfig.SchemaRemoval.CONFIG_CHANGE
.- Parameters:
schemaRemoval
- if and when to automatically detect and remove unused schemas- Returns:
- this instance
- Throws:
IllegalArgumentException
- ifschemaRemoval
is null
-
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.
-