This is a node in the cache and is a wrapper for the object and keeps flags on the status of the entry.
perhaps add LRU counters as CacheEntry is pretty dumb
# File lib/storage/cache.rb, line 59 def initialize(oid=nil,obj=nil,dirty=false,noswap=false) @oid, @obj, @dirty, @noswap = oid, obj, dirty, noswap end
# File lib/storage/cache.rb, line 72 def clean! @dirty = false end
A dead cache entry is an object that has been deleted
# File lib/storage/cache.rb, line 77 def dead? @obj == nil end
# File lib/storage/cache.rb, line 68 def dirty! @dirty = true end
dirty cache entries are those that probably differ from the database
# File lib/storage/cache.rb, line 64 def dirty? @dirty end
# File lib/storage/cache.rb, line 81 def mark_dead @obj = nil @oid = nil @dirty = false @noswap = false end
# File lib/storage/cache.rb, line 96 def noswap! @noswap = true end
Noswappable cache entries are objects that have non persistent attributes. *heavy sigh* We can never remove these from the cache until specifically marked See makenoswap and makeswap
# File lib/storage/cache.rb, line 92 def noswap? @noswap end
# File lib/storage/cache.rb, line 100 def swap! @noswap = false end