Use dmedia/machine doc for local machine state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Dmedia |
Fix Released
|
High
|
Jason Gerard DeRose |
Bug Description
Currently we save certain local machine state in the _local/dmedia doc in CouchDB:
1) The drives (FileStore) that are currently physically attached to the computer
2) The Dmedia peers currently visible on the local network
But it's extremely useful to also have this metadata in the dmedia/machine doc. For example, this allows Dmedia to see what drives are currently connected to a peer (remember, the _local/foo docs don't get replicated).
Earlier this month I quickly hacked some changes in so that the stores and peers get saved in both _local/dmedia and the machine doc, as this was needed for a Dmedia demo. It proved useful, so now it's time to make this change properly.
I've refactored the Core class such that the identity parts are no longer optional (you now must pass the machine and user docs to Core.__init__()), and so that the local stores and peers are now *only* saved in the machine doc, no longer get saved in _local/dmedia.
This will also allow us to make the downloader smarter in that we can decide what peer to download from based on the stores in that peer's machine doc, rather than having to make a HEAD request to first see if the peer has the file. So Dmedia will converge more quickly, will be closer to the IO limits.
Related branches
- James Raymond: Approve
-
Diff: 1309 lines (+398/-404)11 files modifieddmedia-gtk (+1/-1)
dmedia-service (+10/-8)
dmedia/core.py (+40/-65)
dmedia/importer.py (+7/-5)
dmedia/local.py (+10/-10)
dmedia/metastore.py (+13/-4)
dmedia/service/tests/test_avahi.py (+5/-3)
dmedia/tests/test_core.py (+171/-234)
dmedia/tests/test_importer.py (+66/-61)
dmedia/tests/test_local.py (+56/-5)
dmedia/tests/test_metastore.py (+19/-8)
Changed in dmedia: | |
status: | In Progress → Fix Committed |
Changed in dmedia: | |
status: | Fix Committed → Fix Released |