Class: StrokeDB::MemoryChunkStorage
- Inherits:
-
ChunkStorage
- Object
- ChunkStorage
- StrokeDB::MemoryChunkStorage
- Defined in:
- lib/stores/skiplist_store/memory_chunk_storage.rb
Instance Attribute Summary collapse
-
#chunks_cache ⇒ Object
Returns the value of attribute chunks_cache.
Attributes inherited from ChunkStorage
Instance Method Summary collapse
- #clear! ⇒ Object
- #delete!(chunk_uuid) ⇒ Object
-
#initialize(opts = {}) ⇒ MemoryChunkStorage
constructor
A new instance of MemoryChunkStorage.
Methods inherited from ChunkStorage
Methods included from ChainableStorage
#add_chained_storage!, #has_chained_storage?, #remove_chained_storage!, #save_with_chained_storages!, #save_without_chained_storages!, #sync_chained_storage!, #sync_chained_storages!
Constructor Details
#initialize(opts = {}) ⇒ MemoryChunkStorage
Returns a new instance of MemoryChunkStorage.
5 6 7 |
# File 'lib/stores/skiplist_store/memory_chunk_storage.rb', line 5 def initialize(opts={}) @chunks_cache = {} end |
Instance Attribute Details
#chunks_cache ⇒ Object
Returns the value of attribute chunks_cache.
3 4 5 |
# File 'lib/stores/skiplist_store/memory_chunk_storage.rb', line 3 def chunks_cache @chunks_cache end |
Instance Method Details
#clear! ⇒ Object
13 14 15 |
# File 'lib/stores/skiplist_store/memory_chunk_storage.rb', line 13 def clear! @chunks_cache.clear end |
#delete!(chunk_uuid) ⇒ Object
9 10 11 |
# File 'lib/stores/skiplist_store/memory_chunk_storage.rb', line 9 def delete!(chunk_uuid) write(chunk_path(chunk_uuid), nil) end |