Package io.bdeploy.bhive.objects
Class MarkerDatabase
java.lang.Object
io.bdeploy.bhive.objects.LockableDatabase
io.bdeploy.bhive.objects.ObjectDatabase
io.bdeploy.bhive.objects.MarkerDatabase
A marker database acts as temporary synchronization and locking over threads and even JVMs.
An example are BHiveTransactions. They use a MarkerDatabase to "mark" each object written. As long as there is
not manifest inserted in the BHive, these objects would be dangling, and subject to removal by prune. The
PruneOperation takes into account any marked object by any transaction and does not touch them.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.bdeploy.bhive.objects.LockableDatabase
LockableDatabase.LockedOperation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMarks the givenObjectId.Retrieves an InputStream from which the actual content of an object with the givenObjectIdcan be read.protected ObjectIdinternalAddObject(ObjectWriter writer) voidremoveObject(ObjectId id) Removes the givenObjectIds backing file from the database.Methods inherited from class io.bdeploy.bhive.objects.ObjectDatabase
addObject, addObject, addObject, checkObject, getAllObjects, getObjectFile, getObjectSize, hasObjectMethods inherited from class io.bdeploy.bhive.objects.LockableDatabase
locked
-
Constructor Details
-
MarkerDatabase
-
-
Method Details
-
addMarker
-
getStream
Description copied from class:ObjectDatabaseRetrieves an InputStream from which the actual content of an object with the givenObjectIdcan be read.- Overrides:
getStreamin classObjectDatabase- Parameters:
id- theObjectIdof the object to lookup.- Returns:
- an
InputStreamto the object. - Throws:
IOException- in case of an error.
-
internalAddObject
- Overrides:
internalAddObjectin classObjectDatabase- Throws:
IOException
-
removeObject
Description copied from class:ObjectDatabaseRemoves the givenObjectIds backing file from the database.WARNING: use with care, this can cause corruption!
- Overrides:
removeObjectin classObjectDatabase
-