[tahoe-lafs-trac-stream] [tahoe-lafs] #393: mutable: implement MDMF
tahoe-lafs
trac at tahoe-lafs.org
Fri Aug 12 11:24:24 PDT 2011
#393: mutable: implement MDMF
-------------------------+-------------------------------------------------
Reporter: warner | Owner: zooko
Type: | Status: new
enhancement | Milestone: 1.9.0
Priority: major | Version: 1.0.0
Component: code- | Keywords: newcaps performance random-access
mutable | privacy gsoc mdmf mutable backward-
Resolution: | compatibility forward-compatibility review-
Launchpad Bug: | needed
-------------------------+-------------------------------------------------
Comment (by davidsarah):
Notes on [5124/ticket393-MDMF-2]:
* This:
{{{
self._need_privkey = fetch_privkey or verify
if self._node.get_privkey() and not verify:
self._need_privkey = False
}}}
could be simplified to
{{{
self._need_privkey = verify or (fetch_privkey
and not self._node.get_privkey())
}}}
* This:
{{{
self._verify = False
if verify:
self._verify = True
}}}
could be
{{{
self._verify = verify
}}}
* {{{self._paused_deferred = None}}} is a typo, it should be
{{{_pause_deferred}}}.
* {{{self._paused}}} seems to be {{{True}}} whenever
{{{self._pause_deferred is not None}}}, except that there is one place in
the {{{download}}} method that sets {{{self._paused}}} to {{{False}}}
without setting {{{self._pause_deferred}}} to {{{None}}}.
I don't think that the {{{self._paused = None}}} there is actually
necessary; everything will work if the download is started while paused.
That would allow the code to be simplified by removing {{{self._paused}}}.
* Is this calculation correct?
{{{
# our start segment is the first segment containing the
# offset we were given.
start = mathutil.div_ceil(self._offset,
self._segment_size)
# this gets us the first segment after self._offset. Then
# our start segment is the one before it.
start -= 1
}}}
I would have thought that the segment containing {{{offset}}} was the
floor of {{{offset}}} / {{{segment_size}}}.
* {{{Unusued}}} -> {{{Unused}}} at retrieve.py line 305
* set {{{self._block_hash_trees}}} to {{{None}}} in {{{decode()}}}, and
make its initialization in {{{_setup_encoding_parameters}}} conditional on
{{{if self._block_hash_trees is not None:}}}.
My preferred whitespace conventions:
* one blank line before a block comment if the preceding line is code at
the same indent level
(this makes it harder to mistake the code as part of the comment, and
makes the comment
easier to read IMHO). examples are lines 235 and 285 of retrieve.py
* two blank lines between top-level classes, or groups of methods
* otherwise only one blank line between methods
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/393#comment:124>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list