mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 16:58:10 +00:00
Immutable writing now knows when it's finished.
This commit is contained in:
parent
4ea6bf2381
commit
25e2100219
@ -403,12 +403,10 @@ class BucketWriter(object):
|
||||
self.ss.count("write")
|
||||
|
||||
# Return whether the whole thing has been written. See
|
||||
# https://github.com/mlenzen/collections-extended/issues/169 for why
|
||||
# https://github.com/mlenzen/collections-extended/issues/169 and
|
||||
# https://github.com/mlenzen/collections-extended/issues/172 for why
|
||||
# it's done this way.
|
||||
print([tuple(mr) for mr in self._already_written.ranges()])
|
||||
return [tuple(mr) for mr in self._already_written.ranges()] == [
|
||||
(0, self._max_size, True)
|
||||
]
|
||||
return sum([mr.stop - mr.start for mr in self._already_written.ranges()]) == self._max_size
|
||||
|
||||
def close(self):
|
||||
precondition(not self.closed)
|
||||
|
@ -279,10 +279,9 @@ class Bucket(unittest.TestCase):
|
||||
The ``BucketWriter.write()`` return true if and only if the maximum
|
||||
size has been reached via potentially overlapping writes.
|
||||
"""
|
||||
length = 100
|
||||
incoming, final = self.make_workdir("overlapping_writes_{}".format(uuid4()))
|
||||
bw = BucketWriter(
|
||||
self, incoming, final, length, self.make_lease(), Clock()
|
||||
self, incoming, final, 100, self.make_lease(), Clock()
|
||||
)
|
||||
local_written = [0] * 100
|
||||
for offset in offsets:
|
||||
|
Loading…
x
Reference in New Issue
Block a user