2024-05-09 12:18:46 +02:00
|
|
|
class DODB::SpecDataBase(V) < DODB::DataBase(V)
|
|
|
|
property storage_dir : String
|
|
|
|
def initialize(storage_ext = "", remove_previous_data = true)
|
2024-05-09 18:41:20 +02:00
|
|
|
@storage_dir = "specdb-storage-uncached#{storage_ext}"
|
2024-05-09 12:18:46 +02:00
|
|
|
|
|
|
|
if remove_previous_data
|
|
|
|
::FileUtils.rm_rf storage_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
super storage_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def rm_storage_dir
|
|
|
|
::FileUtils.rm_rf @storage_dir
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class DODB::CachedSpecDataBase(V) < DODB::CachedDataBase(V)
|
|
|
|
property storage_dir : String
|
|
|
|
def initialize(storage_ext = "", remove_previous_data = true)
|
2024-05-09 18:41:20 +02:00
|
|
|
@storage_dir = "specdb-storage-cached#{storage_ext}"
|
2024-05-09 12:18:46 +02:00
|
|
|
|
|
|
|
if remove_previous_data
|
|
|
|
::FileUtils.rm_rf storage_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
super storage_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def rm_storage_dir
|
|
|
|
::FileUtils.rm_rf @storage_dir
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class DODB::RAMOnlySpecDataBase(V) < DODB::RAMOnlyDataBase(V)
|
|
|
|
property storage_dir : String
|
|
|
|
def initialize(storage_ext = "", remove_previous_data = true)
|
2024-05-09 18:41:20 +02:00
|
|
|
@storage_dir = "specdb-storage-ram#{storage_ext}"
|
2024-05-09 12:18:46 +02:00
|
|
|
|
|
|
|
if remove_previous_data
|
|
|
|
::FileUtils.rm_rf storage_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
super storage_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def rm_storage_dir
|
|
|
|
::FileUtils.rm_rf @storage_dir
|
|
|
|
end
|
|
|
|
end
|