Extend Core API to better model life of an HDD in Dmedia

Bug #1019714 reported by Jason Gerard DeRose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dmedia
Fix Released
High
Jason Gerard DeRose

Bug Description

Currently our Core API only has 2 rather crude methods for dealing with the HDD lifecycle:

Core.add_filestore(parentdir) - creates file-store if it doesn't already exist, adds into the pool of currently connected file-stores

Core.remove_filestore(parentdir) - remove the file-store from pool of currently "connected" file-stores.

Plus we have a hacky mess for how deal with the "default file-store", which will be either /home or /home/username. We need finer-grained API that better models the life of an HDD in Dmedia, and I'm proposing something like this:

Core.create_filestore(parentdir, label) - error if file-store already exists. This is where we want to walk the user through labelling their HDD so the physical/written label matches what Dmedia has in CouchDB.

Core.connect_filestore(parentdir, store_id) - error if file-store doesn't exist or doesn't have the expected store_id. Adds to pool of currently connected file-stores, in other words the HDD that Dmedia will look for files on. We should call FileStore.purge_tmp() here, and then immediately run a quick-scan on the drive (in either a background thread or background process).

Core.disconnect_filestore(parentdir) - remove file-store from connected pool. This will usually be called in response to an event from UDisks.

Core.downgrade_filestore(store_id) - tell Dmedia that it should not count on any copies in this file-store. It will update all files to have {"copies": 0}, which will trigger Dmedia to create additional copies if needed. The file-store may or not be connected. If connected, this store can be used as a source for creating additional copies.

Core.purge_filestore(store_id) - tell Dmedia not to count on any copies in this filestore, and not to track them at all. It will update all files completely removing store_id from doc.stored. The file-store may or not be connected.

Related branches

summary: - Extend dmedia.core.Core API to better model life of an HDD in Dmedia
+ Extend Core API to better model life of an HDD in Dmedia
Changed in dmedia:
status: In Progress → Fix Committed
Changed in dmedia:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.