servermap.py: add size_of_version(), to retrieve the size of a mutable file version

This commit is contained in:
Brian Warner 2008-05-19 14:16:02 -07:00
parent 7c8267085e
commit 154dca10a0
1 changed files with 7 additions and 0 deletions

View File

@ -258,6 +258,13 @@ class ServerMap:
return recoverable[-1] return recoverable[-1]
return None return None
def size_of_version(self, verinfo):
"""Given a versionid (perhaps returned by best_recoverable_version),
return the size of the file in bytes."""
(seqnum, root_hash, IV, segsize, datalength, k, N, prefix,
offsets_tuple) = verinfo
return datalength
def unrecoverable_newer_versions(self): def unrecoverable_newer_versions(self):
# Return a dict of versionid -> health, for versions that are # Return a dict of versionid -> health, for versions that are
# unrecoverable and have later seqnums than any recoverable versions. # unrecoverable and have later seqnums than any recoverable versions.