Commit graph

20908 commits

Author SHA1 Message Date
Joey Hess
c3af4897c0 faster storeChunks
No need to process each L.ByteString chunk, instead ask it to split.

Doesn't seem to have really sped things up much, but it also made the code
simpler.

Note that this does (and already did) buffer in memory. It seems that only
the directory special remote could take advantage of streaming chunks to
files w/o buffering, so probably won't add an interface to allow for that.
2014-07-27 01:18:38 -04:00
Joey Hess
f3e47b16a5 better Preparer interface
This will allow things like WebDAV to opean a single persistent connection
and reuse it for all the chunked data.

The crazy types allow for some nice code reuse.
2014-07-27 00:30:04 -04:00
Joey Hess
7db60269eb update does for chunking 2014-07-26 23:39:51 -04:00
Joey Hess
9a8c4bb21f improve exception handling
Push it down from needing to be done in every Storer,
to being checked once inside ChunkedEncryptable.

Also, catch exceptions from PrepareStorer and PrepareRetriever,
just in case..
2014-07-26 23:26:10 -04:00
Joey Hess
7496355031 add some more exception handling primitives 2014-07-26 23:24:27 -04:00
Joey Hess
867fd116a7 better exception display 2014-07-26 23:01:44 -04:00
Joey Hess
0d89b65bfc fix key checking when a directory special remote's directory is missing
The best thing to do in this case is return Left, so that anything that
tries to access it will fail.
2014-07-26 22:52:47 -04:00
Joey Hess
93be3296fc fix another fallback bug 2014-07-26 22:47:52 -04:00
Joey Hess
86e8532c0a allM has slightly better memory use 2014-07-26 22:34:40 -04:00
Joey Hess
67975bf50d fix fallback to other chunk size when first does not have it 2014-07-26 22:25:50 -04:00
Joey Hess
fc10959f68 Merge branch 'master' of ssh://git-annex.branchable.com 2014-07-26 20:52:27 -04:00
Joey Hess
5cd1025816 devblog 2014-07-26 20:51:58 -04:00
Joey Hess
275e284dda doc update for new chunking 2014-07-26 20:21:49 -04:00
Joey Hess
adb6ca62ca fix build 2014-07-26 20:21:36 -04:00
Joey Hess
34c6fdf5e3 fix build 2014-07-26 20:21:10 -04:00
Joey Hess
b2922c1d6d convert directory special remote to using ChunkedEncryptable
And clean up legacy chunking code, which is in its own module now.

So much cleaner!

This commit was sponsored by Henrik Ahlgren
2014-07-26 20:19:24 -04:00
Joey Hess
1400cbb032 Support for remotes that are chunkable and encryptable.
I'd have liked to keep these two concepts entirely separate,
but that are entagled: Storing a key in an encrypted and chunked remote
need to generate chunk keys, encrypt the keys, chunk the data, encrypt the
chunks, and send them to the remote. Similar for retrieval, etc.

So, here's an implemnetation of all of that.

The total win here is that every remote was implementing encrypted storage
and retrival, and now it can move into this single place. I expect this
to result in several hundred lines of code being removed from git-annex
eventually!

This commit was sponsored by Henrik Ahlgren.
2014-07-26 20:14:31 -04:00
Joey Hess
d4d68f57e5 finish up basic chunked remote groundwork
Chunk retrieval and reassembly, removal, and checking if all necessary
chunks are present.

This commit was sponsored by Damien Raude-Morvan.
2014-07-26 20:11:41 -04:00
Joey Hess
904859d676 wording 2014-07-26 13:25:06 -04:00
https://www.google.com/accounts/o8/id?id=AItOawmURXBzaYE1gmVc-X9eLAyDat_6rHPl670
45a5276e23 added output of ls -lb in git directory to show that the file is not added to the annex 2014-07-26 16:50:32 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmURXBzaYE1gmVc-X9eLAyDat_6rHPl670
7bdac3a96b 2014-07-26 16:39:41 +00:00
Joey Hess
cf83697c33 reorg 2014-07-26 12:04:35 -04:00
Joey Hess
e4cb50db33 Merge branch 'master' into newchunks 2014-07-26 12:02:48 -04:00
https://www.google.com/accounts/o8/id?id=AItOawk9nck8WX8-ADF3Fdh5vFo4Qrw1I_bJcR8
712465c80e Added a comment 2014-07-26 14:57:53 +00:00
Joey Hess
655bdfd5bd Merge branch 'master' of ssh://git-annex.branchable.com 2014-07-25 20:57:52 -04:00
Joey Hess
8a46a89adc devblog 2014-07-25 20:56:28 -04:00
Joey Hess
005aded3e0 Fix cost calculation for non-encrypted remotes.
Encyptable types of remotes that were not actually encrypted still had
the encryptedRemoteCostAdj applied to their configured cost, which was a
bug.
2014-07-25 17:29:59 -04:00
Joey Hess
9e8a4a0950 support new style chunking in directory special remote
Only when storing non-encrypted so far, not retrieving or checking if a key
is present or removing.

This commit was sponsored by Renaud Casenave-Péré.
2014-07-25 16:21:01 -04:00
Joey Hess
ab4cce4114 core implementation of new style chunking
Not yet used by any special remotes, but should not be too hard to add it
to most of them.

storeChunks is the hairy bit! It's loosely based on
Remote.Directory.storeLegacyChunked. The object is read in using a lazy
bytestring, which is streamed though, creating chunks as needed, without
ever buffering more than 1 chunk in memory.

Getting the progress meter update to work right was also fun, since
progress meter values are absolute. Finessed by constructing an offset
meter.

This commit was sponsored by Richard Collins.
2014-07-25 16:20:32 -04:00
Joey Hess
8f93982df6 use same hash directories for chunked key as are used for its parent
This avoids a proliferation of hash directories when using new-style
chunking, and should improve performance since chunks are accessed
in sequence and so should have a common locality.

Of course, when a chunked key is encrypted, its hash directories have no
relation to the parent key.

This commit was sponsored by Christian Kellermann.
2014-07-25 16:09:23 -04:00
Joey Hess
1755c5de40 thought about chunk key hashing 2014-07-25 15:12:51 -04:00
https://www.google.com/accounts/o8/id?id=AItOawlVUq_c3-lrQBculOEUu3yjvdavE7JbvEI
b43a6bc7e5 Added a comment 2014-07-25 10:02:53 +00:00
https://www.google.com/accounts/o8/id?id=AItOawnG_weCiH6IleQfVmRPmFJflHQMHdAcDkU
54f3ff878c add a note about direct mode 2014-07-25 07:57:21 +00:00
https://www.google.com/accounts/o8/id?id=AItOawnG_weCiH6IleQfVmRPmFJflHQMHdAcDkU
5820a8d3cd file a bug 2014-07-25 07:42:52 +00:00
Joey Hess
014794f4ed improve a bit 2014-07-24 17:18:14 -04:00
Joey Hess
d52c2b37ad Merge branch 'master' of ssh://git-annex.branchable.com 2014-07-24 16:49:45 -04:00
Joey Hess
3de535cdac devblog 2014-07-24 16:48:07 -04:00
Joey Hess
ceea04e77f move meteredWriteFileChunks out of legacy 2014-07-24 16:42:35 -04:00
Joey Hess
e2c44bf656 implement chunk logs
Slightly tricky as they are not normal UUIDBased logs, but are instead maps
from (uuid, chunksize) to chunkcount.

This commit was sponsored by Frank Thomas.
2014-07-24 16:23:36 -04:00
Joey Hess
bbdb2c04d5 improve chunk data types 2014-07-24 15:08:07 -04:00
Joey Hess
9e2d49d441 prepare for new style chunking
Moved old legacy chunking code, and cleaned up the directory and webdav
remotes use of it, so when no chunking is configured, that code is not
used.

The config for new style chunking will be chunk=1M instead of chunksize=1M.

There should be no behavior changes from this commit.

This commit was sponsored by Andreas Laas.
2014-07-24 14:49:22 -04:00
Joey Hess
d751591ac8 add chunk metadata to Key
Added new fields for chunk number, and chunk size. These will not appear
in normal keys ever, but will be used for chunked data stored on special
remotes.

This commit was sponsored by Jouni K Seppanen.
2014-07-24 13:36:23 -04:00
Joey Hess
4bbc629cb0 document new chunk logfiles 2014-07-24 13:28:54 -04:00
Joey Hess
9e472c9c59 clarify field order reqirement 2014-07-24 12:54:29 -04:00
Joey Hess
937197842e update 2014-07-24 12:41:34 -04:00
Xyem
d0ea0a0479 2014-07-24 12:31:31 +00:00
Joey Hess
ca1d80d708 chunk then encrypt 2014-07-23 22:38:14 -04:00
https://www.google.com/accounts/o8/id?id=AItOawlASRUX9jg2piT1lge4KkBU_ZGty6tvM5c
a42d2a6e4b added gpg instructions 2014-07-24 00:48:33 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmp_51DcIT2sqrOhtg7LgCj2Pyaa5ujxTI
46fec9c1ce 2014-07-23 23:38:55 +00:00
markusk
6df94fb489 Added a comment 2014-07-23 23:18:37 +00:00