Class: StrokeDB::FileChunkStorage

Inherits:
ChunkStorage show all
Defined in:
lib/stores/skiplist_store/file_chunk_storage.rb

Instance Attribute Summary collapse

Attributes inherited from ChunkStorage

#authoritative_source

Instance Method Summary collapse

Methods inherited from ChunkStorage

#find

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 = {}) ⇒ FileChunkStorage

Returns a new instance of FileChunkStorage.



5
6
7
8
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 5

def initialize(opts={})
  opts = opts.stringify_keys 
  @path = opts['path']
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 3

def path
  @path
end

Instance Method Details

#clear!Object



14
15
16
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 14

def clear!
  FileUtils.rm_rf @path
end

#delete!(chunk_uuid) ⇒ Object



10
11
12
# File 'lib/stores/skiplist_store/file_chunk_storage.rb', line 10

def delete!(chunk_uuid)
  FileUtils.rm_rf(chunk_path(chunk_uuid))
end