Changeset 4defc641 in trunk
- Timestamp:
- 2021-10-22T19:56:45Z (3 years ago)
- Branches:
- master
- Children:
- e0ed04c
- Parents:
- 1264c3be
- git-author:
- Jean-Paul Calderone <exarkun@…> (2021-10-20 18:36:05)
- git-committer:
- Jean-Paul Calderone <exarkun@…> (2021-10-22 19:56:45)
- Location:
- src/allmydata/storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/allmydata/storage/immutable.py ¶
r1264c3be r4defc641 22 22 RIBucketWriter, RIBucketReader, ConflictingWriteError, 23 23 DataTooLargeError, 24 NoSpace, 24 25 ) 25 26 from allmydata.util import base32, fileutil, log … … 250 251 raise IndexError("unable to renew non-existent lease") 251 252 252 def add_or_renew_lease(self, lease_info): 253 def add_or_renew_lease(self, available_space, lease_info): 254 """ 255 Renew an existing lease if possible, otherwise allocate a new one. 256 257 :param int available_space: The maximum number of bytes of storage to 258 commit in this operation. If more than this number of bytes is 259 required, raise ``NoSpace`` instead. 260 261 :param LeaseInfo lease_info: The details of the lease to renew or add. 262 263 :raise NoSpace: If more than ``available_space`` bytes is required to 264 complete the operation. In this case, no lease is added. 265 266 :return: ``None`` 267 """ 253 268 try: 254 269 self.renew_lease(lease_info.renew_secret, 255 270 lease_info.expiration_time) 256 271 except IndexError: 272 if lease_info.immutable_size() > available_space: 273 raise NoSpace() 257 274 self.add_lease(lease_info) 258 259 275 260 276 def cancel_lease(self, cancel_secret): -
TabularUnified src/allmydata/storage/server.py ¶
r1264c3be r4defc641 619 619 """ 620 620 for share in shares: 621 share.add_or_renew_lease( lease_info)621 share.add_or_renew_lease(self.get_available_space(), lease_info) 622 622 623 623 def slot_testv_and_readv_and_writev( # type: ignore # warner/foolscap#78
Note: See TracChangeset
for help on using the changeset viewer.