db/simple: mount points
A SimpleDatabase instance can now "mount" other Database instances at certain locations. This is used to use a new SimpleDatabase instance for each storage mount (issued with the "mount" protocol command). Each such instance has its own database file, stored in the directory that is specified with the "cache_directory" option.
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
class SimpleDatabase;
|
||||
class DatabaseListener;
|
||||
class UpdateWalk;
|
||||
class Storage;
|
||||
class CompositeStorage;
|
||||
|
||||
/**
|
||||
* This class manages the update queue and runs the update thread.
|
||||
@@ -41,7 +41,7 @@ class UpdateService final : DeferredMonitor {
|
||||
};
|
||||
|
||||
SimpleDatabase &db;
|
||||
Storage &storage;
|
||||
CompositeStorage &storage;
|
||||
|
||||
DatabaseListener &listener;
|
||||
|
||||
@@ -63,7 +63,7 @@ class UpdateService final : DeferredMonitor {
|
||||
|
||||
public:
|
||||
UpdateService(EventLoop &_loop, SimpleDatabase &_db,
|
||||
Storage &_storage,
|
||||
CompositeStorage &_storage,
|
||||
DatabaseListener &_listener);
|
||||
|
||||
~UpdateService();
|
||||
@@ -92,6 +92,13 @@ public:
|
||||
*/
|
||||
void CancelAllAsync();
|
||||
|
||||
/**
|
||||
* Cancel all updates for the given mount point. If an update
|
||||
* is already running for it, the method will wait for
|
||||
* cancellation to complete.
|
||||
*/
|
||||
void CancelMount(const char *uri);
|
||||
|
||||
private:
|
||||
/* virtual methods from class DeferredMonitor */
|
||||
virtual void RunDeferred() override;
|
||||
|
Reference in New Issue
Block a user