Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Change the default block size to 80MiB per the issue #2 discussion.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoRyan committed Nov 13, 2019
1 parent af973b5 commit c160ba7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ is storing a long-term, low-cost disk image, with periodic updates, for backups
and archives on The Cloud™.

The basic idea behind Sia Slice is to chop up a single block device (or other
large, monolithic file) into thousands of 100MiB chunks, LZMA-compress those
large, monolithic file) into thousands of 80MiB chunks, LZMA-compress those
chunks, and then upload them to Sia. That way, the next time you sync, you only
have to upload the chunks that have changed since the last sync. Sync operations
always construct a complete and identical mirror; there is no history, and there
Expand Down
7 changes: 4 additions & 3 deletions siaslice.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import aiohttp


BLOCK_MB = 100
DEFAULT_BLOCK_MB = 80
TRANSFER_STALLED_MIN = 3*60

OpStatus = namedtuple('OpStatus', ['transfers', 'current_index',
Expand Down Expand Up @@ -142,7 +142,8 @@ class SiapathStorage():
_BlockFile = namedtuple('_BlockFile', ['siapath', 'md5_hash', 'size', 'partial',
'complete', 'stalled', 'upload_progress'])

def __init__(self, session, *siapath, default_block_size=BLOCK_MB*1000*1000):
def __init__(self, session, *siapath,
default_block_size=DEFAULT_BLOCK_MB*1000*1000):
self._session = session
self._siapath = siapath
self.block_size = default_block_size
Expand Down Expand Up @@ -239,7 +240,7 @@ def main():
argp_op = argp.add_mutually_exclusive_group(required=True)
argp_op.add_argument('-m', '--mirror', action='store_true',
help=('sync a copy to Sia by dividing the file into '
f'{BLOCK_MB}MiB chunks'))
f'{DEFAULT_BLOCK_MB}MiB chunks'))
argp_op.add_argument('-d', '--download', action='store_true',
help='reconstruct a copy using Sia')
argp_op.add_argument(
Expand Down

0 comments on commit c160ba7

Please sign in to comment.