• Barry Warsaw's avatar
    Support for autopacking in a separate thread. BerkeleyConfig now has · 9efc9849
    Barry Warsaw authored
    three new configuration variables for controlling how autopacking
    works.  Basically, you set an autopack frequency, a "packtime" -- the
    point in the past you want to pack to -- and a counter for
    automatically doing a classic pack.
    
    Specific changes here include:
    
    _setupDBs(): If autopacking is enabled, create the autopacking thread
    object and get it started.
    
    close(): When shutting down the storage, we need to stop and join the
    autopacking thread, otherwise I think we have a high possibility of
    corrupting our database (requiring recovery).
    
    _dopack(): Add a flag for whether full gc should be done or not.
    That's about the only difference between classic pack and autopack
    (the latter does not do gc).
    
    autopack(): The method that the autopacking thread calls to start an
    autopack.  It takes a pack time with the same semantics as pack(), but
    it also takes a flag specifying whether to do garbage collection of
    unreachable objects or not.
    
    _Autopack: A derived class of threading.Thread to handing the
    background autopacking.
    9efc9849
BDBFullStorage.py 80.9 KB