summaryrefslogtreecommitdiff
path: root/Types/Key.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-08-02 15:51:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-08-02 15:51:58 -0400
commit81b339034e8871f211ede2cf3bdb7319ad16caed (patch)
tree8fe89688fc4c224958bb822c9dcbd2cf434c8a4b /Types/Key.hs
parent0ddf8152ce1353bbbcd7c87c3f67063b4aed892b (diff)
S3: support chunking
The assistant defaults to 1MiB chunk size for new S3 special remotes. Which will work around a couple of bugs: http://git-annex.branchable.com/bugs/S3_memory_leaks/ http://git-annex.branchable.com/bugs/S3_upload_not_using_multipart/
Diffstat (limited to 'Types/Key.hs')
-rw-r--r--Types/Key.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Types/Key.hs b/Types/Key.hs
index 154e813ff..5bb41e15f 100644
--- a/Types/Key.hs
+++ b/Types/Key.hs
@@ -15,6 +15,7 @@ module Types.Key (
file2key,
nonChunkKey,
chunkKeyOffset,
+ isChunkKey,
prop_idempotent_key_encode,
prop_idempotent_key_decode
@@ -62,6 +63,9 @@ chunkKeyOffset k = (*)
<$> keyChunkSize k
<*> (pred <$> keyChunkNum k)
+isChunkKey :: Key -> Bool
+isChunkKey k = isJust (keyChunkSize k) && isJust (keyChunkNum k)
+
fieldSep :: Char
fieldSep = '-'