Interface MongoDriver<R extends io.vena.bosk.StateTreeNode>
- All Superinterfaces:
io.vena.bosk.BoskDriver<R>
- All Known Implementing Classes:
MainDriver
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceMongoDriver.MongoDriverFactory<RR extends io.vena.bosk.StateTreeNode> -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Frees up resources used by this driver and leaves it unusable.static <RR extends io.vena.bosk.StateTreeNode>
MongoDriver.MongoDriverFactory<RR>factory(com.mongodb.MongoClientSettings clientSettings, MongoDriverSettings driverSettings, BsonPlugin bsonPlugin) voidDeserializes and re-serializes the entire bosk contents, thus updating the database to match the current serialized format.Methods inherited from interface io.vena.bosk.BoskDriver
flush, initialRoot, submitConditionalDeletion, submitConditionalReplacement, submitDeletion, submitInitialization, submitReplacement, submitReplacement
-
Method Details
-
refurbish
Deserializes and re-serializes the entire bosk contents, thus updating the database to match the current serialized format.Used to "upgrade" the database contents for schema evolution.
This method does not simply write the current in-memory bosk contents back into the database, because that would lead to race conditions with other update operations. Instead, in a causally-consistent transaction, it reads the current database state, deserializes it, re-serializes it, and writes it back. This produces predictable results even if done concurrently with other database updates.
This requires the database state to be in good condition at the outset; it can't generally be used to repair corrupted databases unless the corruption is so mild that it doesn't interfere with proper functioning beforehand. It can be expected to evolve the database from that of a supported prior format, but for unsupported formats or other corruption, YMMV.
- Throws:
IOException
-
close
void close()Frees up resources used by this driver and leaves it unusable.This is done on a best-effort basis. It's more useful for tests than for production code, where there's usually no reason to close a driver.
-
factory
static <RR extends io.vena.bosk.StateTreeNode> MongoDriver.MongoDriverFactory<RR> factory(com.mongodb.MongoClientSettings clientSettings, MongoDriverSettings driverSettings, BsonPlugin bsonPlugin)
-