hgext/remotefilelog/basepack.py
changeset 51703 ca7bde5dbafb
parent 51700 7f0cb9ee0534
child 51863 f4733654f144
equal deleted inserted replaced
51702:b0a4de6c14f8 51703:ca7bde5dbafb
    43 # size of the bisect in actual index.
    43 # size of the bisect in actual index.
    44 # 2^16 / 8 was chosen because it trades off (1 step fanout scan + 5 step
    44 # 2^16 / 8 was chosen because it trades off (1 step fanout scan + 5 step
    45 # bisect) with (8 step fanout scan + 1 step bisect)
    45 # bisect) with (8 step fanout scan + 1 step bisect)
    46 # 5 step bisect = log(2^16 / 8 / 255)  # fanout
    46 # 5 step bisect = log(2^16 / 8 / 255)  # fanout
    47 # 10 step fanout scan = 2^16 / (2^16 / 8)  # fanout space divided by entries
    47 # 10 step fanout scan = 2^16 / (2^16 / 8)  # fanout space divided by entries
    48 SMALLFANOUTCUTOFF = 2 ** 16 // 8
    48 SMALLFANOUTCUTOFF = 2**16 // 8
    49 
    49 
    50 # The amount of time to wait between checking for new packs. This prevents an
    50 # The amount of time to wait between checking for new packs. This prevents an
    51 # exception when data is moved to a new pack after the process has already
    51 # exception when data is moved to a new pack after the process has already
    52 # loaded the pack list.
    52 # loaded the pack list.
    53 REFRESHRATE = 0.1
    53 REFRESHRATE = 0.1
   273 
   273 
   274 
   274 
   275 class basepack(versionmixin):
   275 class basepack(versionmixin):
   276     # The maximum amount we should read via mmap before remmaping so the old
   276     # The maximum amount we should read via mmap before remmaping so the old
   277     # pages can be released (100MB)
   277     # pages can be released (100MB)
   278     MAXPAGEDIN = 100 * 1024 ** 2
   278     MAXPAGEDIN = 100 * 1024**2
   279 
   279 
   280     SUPPORTED_VERSIONS = [2]
   280     SUPPORTED_VERSIONS = [2]
   281 
   281 
   282     def __init__(self, path):
   282     def __init__(self, path):
   283         self.path = path
   283         self.path = path