SimpleLru¶
-
class SimpleLru¶
Bases:
LinkedListNode,NamableAn implementation of a very simple LRU algorithm. Also see
AdaptiveLru.Inheritance diagram
digraph inheritance9868e31b26 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "Namable" [URL="acron.core.Namable.html#acron.core.Namable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "Namable" [arrowsize=0.75,style=""]; "SimpleLru" [URL="acron.core.SimpleLru.html#acron.core.SimpleLru",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "Namable" -> "SimpleLru" [arrowsize=0.75,style=""]; }- SimpleLru.__init__()¶
- SimpleLru.begin_epoch()¶
Marks the end of the previous epoch and the beginning of the next one. This will evict any objects that are pending eviction, and also update any internal bookkeeping.
- SimpleLru.consider_evict()¶
Evicts a sequence of objects if the queue is full.
- SimpleLru.count_active_size()¶
Returns the total size of the pages that were enqueued since the last call to
begin_epoch().
- SimpleLru.evict_to()¶
Evicts a sequence of objects until the queue fits within the indicated target size, regardless of its normal max size.
- SimpleLru.get_max_size()¶
Returns the max size of all objects that are allowed to be active on the LRU.
- SimpleLru.get_total_size()¶
Returns the total size of all objects currently active on the LRU.
- SimpleLru.output()¶
- SimpleLru.set_max_size()¶
Changes the max size of all objects that are allowed to be active on the LRU.
If the size is (size_t)-1, there is no limit.
- SimpleLru.validate()¶
Checks that the LRU is internally self-consistent. Returns true if successful, false if there is some problem.
- SimpleLru.write()¶