git-annex/doc
Joey Hess 4224fae71f
optimise read and write for Keys database (untested)
Writes are optimised by queueing up multiple writes when possible.
The queue is flushed after the Annex monad action finishes. That makes it
happen on program termination, and also whenever a nested Annex monad action
finishes.

Reads are optimised by checking once (per AnnexState) if the database
exists. If the database doesn't exist yet, all reads return mempty.

Reads also cause queued writes to be flushed, so reads will always be
consistent with writes (as long as they're made inside the same Annex monad).
A future optimisation path would be to determine when that's not necessary,
which is probably most of the time, and avoid flushing unncessarily.

Design notes for this commit:

- separate reads from writes
- reuse a handle which is left open until program
  exit or until the MVar goes out of scope (and autoclosed then)
- writes are queued
  - queue is flushed periodically
  - immediate queue flush before any read
  - auto-flush queue when database handle is garbage collected
  - flush queue on exit from Annex monad
    (Note that this may happen repeatedly for a single database connection;
    or a connection may be reused for multiple Annex monad actions,
    possibly even concurrent ones.)
- if database does not exist (or is empty) the handle
  is not opened by reads; reads instead return empty results
- writes open the handle if it was not open previously
2015-12-23 19:18:52 -04:00
..
Android
android
assistant
automatic_conflict_resolution
backends
bare_repositories
bugs 2015-12-21 19:50:38 +00:00
coding_style response 2015-09-29 11:26:42 -04:00
contact
copies
design poll vote (My phone (or MP3 player)) 2015-12-16 07:09:17 +00:00
devblog comment 2015-12-19 14:27:22 -04:00
direct_mode
download sigh @ encfs... 2015-11-30 15:22:00 -04:00
ekg
encryption
footer
forum Added a comment 2015-12-21 17:47:13 +00:00
future_proofing
git-annex-copy
git-annex-direct
how_it_works
install link to neurodebian standalone deb 2015-12-22 12:34:28 -04:00
internals
license
links
metadata
news add news item for git-annex 5.20151218 2015-12-18 14:48:04 -04:00
not
polls
preferred_content
required_content
scalability
special_remotes comment 2015-12-10 11:22:28 -04:00
stickers Added a comment 2015-11-20 08:37:39 +00:00
sync
templates
testimonials
tips response 2015-12-08 11:13:55 -04:00
todo optimise read and write for Keys database (untested) 2015-12-23 19:18:52 -04:00
trust
tuning
upgrades
use_case
users I'm feeling.. typoish 2015-11-10 17:00:06 -04:00
videos
walkthrough Added a comment 2015-12-10 18:58:46 +00:00
Android.mdwn
assistant.mdwn
automatic_conflict_resolution.mdwn
backends.mdwn
bare_repositories.mdwn
bugs.mdwn
builds.mdwn add i386-ancient build 2015-09-23 13:36:45 -04:00
chunking.mdwn
coding_style.mdwn m 2015-12-05 19:52:38 +00:00
comments.mdwn
contact.mdwn
contribute.mdwn
copies.mdwn
design.mdwn
devblog.mdwn
direct_mode.mdwn don't let git-annex direct be run in a v6 repo 2015-12-04 16:33:09 -04:00
distributed_version_control.mdwn
download.mdwn
ekg.mdwn
encryption.mdwn
favicon.ico
forum.mdwn
future_proofing.mdwn
git-annex-add.mdwn doc update 2015-12-15 14:17:34 -04:00
git-annex-addunused.mdwn
git-annex-addurl.mdwn addurl: Added --with-files option. 2015-12-22 12:20:39 -04:00
git-annex-assistant.mdwn meant to be in prev commit 2015-11-02 11:22:02 -04:00
git-annex-checkpresentkey.mdwn
git-annex-contentlocation.mdwn
git-annex-copy.mdwn
git-annex-dead.mdwn
git-annex-describe.mdwn
git-annex-diffdriver.mdwn
git-annex-direct.mdwn don't let git-annex direct be run in a v6 repo 2015-12-04 16:33:09 -04:00
git-annex-drop.mdwn drop -Jn 2015-11-04 17:13:20 -04:00
git-annex-dropkey.mdwn
git-annex-dropunused.mdwn
git-annex-edit.mdwn
git-annex-enableremote.mdwn enableremote: List uuids and descriptions of remotes that can be enabled, and accept either the uuid or the description in leu if the name. 2015-10-26 14:55:40 -04:00
git-annex-examinekey.mdwn
git-annex-expire.mdwn
git-annex-find.mdwn
git-annex-findref.mdwn
git-annex-fix.mdwn
git-annex-forget.mdwn
git-annex-fromkey.mdwn
git-annex-fsck.mdwn parallel fsck (yes, these changes are all it takes now!) 2015-11-04 16:28:14 -04:00
git-annex-fuzztest.mdwn
git-annex-get.mdwn
git-annex-group.mdwn
git-annex-groupwanted.mdwn
git-annex-import.mdwn work around git check-ignore --batch bad exit status bug, and bring back import -J 2015-11-06 15:39:51 -04:00
git-annex-importfeed.mdwn
git-annex-indirect.mdwn don't let git-annex direct be run in a v6 repo 2015-12-04 16:33:09 -04:00
git-annex-info.mdwn
git-annex-init.mdwn Use git-annex init --version=6 to get v6 for now 2015-12-15 17:17:13 -04:00
git-annex-initremote.mdwn
git-annex-list.mdwn
git-annex-lock.mdwn v6 git-annex unlock 2015-12-10 16:12:48 -04:00
git-annex-log.mdwn
git-annex-lookupkey.mdwn
git-annex-map.mdwn
git-annex-matching-options.mdwn
git-annex-merge.mdwn
git-annex-metadata.mdwn
git-annex-migrate.mdwn
git-annex-mirror.mdwn
git-annex-move.mdwn
git-annex-numcopies.mdwn
git-annex-pre-commit.mdwn avoid pre-commit hook messing up new-style unlocked files in v6 repo 2015-12-09 15:18:54 -04:00
git-annex-preferred-content.mdwn
git-annex-proxy.mdwn
git-annex-readpresentkey.mdwn
git-annex-registerurl.mdwn
git-annex-reinit.mdwn
git-annex-reinject.mdwn Do verification of checksums of annex objects downloaded from remotes. 2015-10-01 15:56:39 -04:00
git-annex-rekey.mdwn
git-annex-remotedaemon.mdwn
git-annex-repair.mdwn
git-annex-required.mdwn
git-annex-resolvemerge.mdwn
git-annex-rmurl.mdwn
git-annex-schedule.mdwn
git-annex-semitrust.mdwn
git-annex-setkey.mdwn Do verification of checksums of annex objects downloaded from remotes. 2015-10-01 15:56:39 -04:00
git-annex-setpresentkey.mdwn
git-annex-shell.mdwn git-annex-shell: Added lockcontent command, to prevent dropping of key's content. 2015-10-08 14:47:46 -04:00
git-annex-smudge.mdwn fix docs 2015-12-16 16:00:41 -04:00
git-annex-status.mdwn status: Show added but not yet committed files. 2015-09-22 17:32:28 -04:00
git-annex-sync.mdwn
git-annex-test.mdwn
git-annex-testremote.mdwn
git-annex-transferkey.mdwn
git-annex-transferkeys.mdwn
git-annex-trust.mdwn
git-annex-unannex.mdwn
git-annex-undo.mdwn
git-annex-ungroup.mdwn
git-annex-uninit.mdwn
git-annex-unlock.mdwn v6 git-annex unlock 2015-12-10 16:12:48 -04:00
git-annex-untrust.mdwn
git-annex-unused.mdwn
git-annex-upgrade.mdwn
git-annex-vadd.mdwn
git-annex-vcycle.mdwn
git-annex-version.mdwn
git-annex-vfilter.mdwn
git-annex-vicfg.mdwn
git-annex-view.mdwn
git-annex-vpop.mdwn
git-annex-wanted.mdwn
git-annex-watch.mdwn
git-annex-webapp.mdwn
git-annex-whereis.mdwn
git-annex-xmppgit.mdwn
git-annex.mdwn merge clean into smudge command 2015-12-04 15:32:47 -04:00
git-union-merge.mdwn
how_it_works.mdwn
index.mdwn
install.mdwn remove obsolte note about sid package being out of date 2015-12-22 12:31:58 -04:00
internals.mdwn
license.mdwn
location_tracking.mdwn
logo-old-bw.svg
logo-old.png
logo-old.svg
logo-old_small.png
logo.mdwn copy license info for logo onto logo page 2015-11-20 16:25:08 -04:00
logo.svg
logo_16x16.png
logo_32x32.png
logo_small.png
meta.mdwn
metadata.mdwn
news.mdwn
not.mdwn git-lfs lacks partial checkout support 2015-11-23 12:44:54 -04:00
polls.mdwn 2015 user survey 2015-10-19 15:15:04 -04:00
preferred_content.mdwn
privacy.mdwn
publicrepos.mdwn
related_software.mdwn
repomap.png
required_content.mdwn
scalability.mdwn
shortcuts.mdwn
sidebar.mdwn
sitemap.mdwn
special_remotes.mdwn add Blackblaze B2 extranal special remote to the list 2015-12-11 11:06:02 -04:00
stickers.mdwn improve 2015-11-19 18:56:24 -04:00
submodules.mdwn
summary.mdwn
sync.mdwn
testimonials.mdwn
thanks.mdwn update 2015-10-20 00:43:18 -04:00
tips.mdwn
todo.mdwn
transferring_data.mdwn
trust.mdwn
tuning.mdwn
upgrades.mdwn fix docs 2015-12-16 16:00:41 -04:00
users.mdwn
videos.mdwn
Void.mdwn
walkthrough.mdwn