From 0e331018ad18846522ba833842867e40ef14c69a Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Fri, 24 Jul 2009 16:37:22 -0700 Subject: Allow switching chunk styles diff --git a/fusearchive.py b/fusearchive.py index faf465a..2ed69ed 100755 --- a/fusearchive.py +++ b/fusearchive.py @@ -32,6 +32,7 @@ magic_blocksize = 1024 * 128 #magic_blocksize = 1024 magic_depth = 5 gzip_compress_level = 6 +chunkstyle = 'fs' # Memory for dirty blocks, per file (1M) dirty_size = 1024 * 1024 * 1; @@ -43,10 +44,20 @@ def dmsg(level,message): print str(level) + ": " + str(message) def save_chunk( chunk ): - return _save_chunk_zip( chunk ) + if chunkstyle == 'fs': + return _save_chunk_fs( chunk ) + elif chunkstyle == 'zip': + return _save_chunk_zip( chunk ) + else: + raise ValueError( 'Unknown chunk style' ) def load_chunk( key ): - return _load_chunk_zip( key ) + if chunkstyle == 'fs': + return _load_chunk_fs( key ) + elif chunkstyle == 'zip': + return _load_chunk_zip( key ) + else: + raise ValueError( 'Unknown chunk style' ) # This will write out a data block, it will return a key that can get this # data back later -- cgit v0.10.2