mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 18:44:47 +00:00
Merge remote-tracking branch 'origin/ifcviewer' into datamodel-v1.0
This commit is contained in:
+14
-9
@@ -467,6 +467,7 @@ ifcopenshell::impl::rocks_db_file_storage::rocks_db_file_storage(const std::stri
|
||||
// @todo by_identity is probably not correct here, this mapping is Name -> Identity, so Fn should have access to full pair?
|
||||
// , byidentity_(&byid_, [this](size_t v) { return assert_existance(v, by_identity); }, [](ifcopenshell::IfcBaseClass* v) { return v->identity(); })
|
||||
{
|
||||
read_only_ = readonly;
|
||||
#ifdef IFOPSH_WITH_ROCKSDB
|
||||
wopts.disableWAL = true;
|
||||
#endif
|
||||
@@ -475,18 +476,22 @@ ifcopenshell::impl::rocks_db_file_storage::rocks_db_file_storage(const std::stri
|
||||
ifcopenshell::impl::rocks_db_file_storage::~rocks_db_file_storage()
|
||||
{
|
||||
#ifdef IFOPSH_WITH_ROCKSDB
|
||||
rocksdb::FlushOptions flush_options;
|
||||
flush_options.allow_write_stall = true;
|
||||
flush_options.wait = true; // Wait until flush completes.
|
||||
rocksdb::Status s = db->Flush(flush_options);
|
||||
if (db != nullptr) {
|
||||
if (!read_only_) {
|
||||
rocksdb::FlushOptions flush_options;
|
||||
flush_options.allow_write_stall = true;
|
||||
flush_options.wait = true; // Wait until flush completes.
|
||||
rocksdb::Status s = db->Flush(flush_options);
|
||||
|
||||
// compact entire db
|
||||
db->CompactRange(rocksdb::CompactRangeOptions{}, nullptr, nullptr);
|
||||
// compact entire db
|
||||
db->CompactRange(rocksdb::CompactRangeOptions{}, nullptr, nullptr);
|
||||
|
||||
assert(s.ok());
|
||||
assert(s.ok());
|
||||
}
|
||||
|
||||
db->Close();
|
||||
delete db;
|
||||
db->Close();
|
||||
delete db;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class file;
|
||||
|
||||
class IFC_PARSE_API spf_header {
|
||||
private:
|
||||
file* file_;
|
||||
ifcopenshell::file* file_;
|
||||
|
||||
std::array<std::shared_ptr<instance_data>, 3> header_entities_;
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace rocksdb {
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
#include <iostream>
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
@@ -389,6 +390,8 @@ namespace ifcopenshell {
|
||||
typedef rocksdb_map_adapter<inverse_attr_record, std::vector<uint32_t>> entities_by_ref_t;
|
||||
entities_by_ref_t byref_excl_;
|
||||
|
||||
bool read_only_ = false;
|
||||
|
||||
// @todo naming
|
||||
rocks_db_file_storage(const std::string& path, ifcopenshell::file* owner_file, bool read_only = false);
|
||||
~rocks_db_file_storage();
|
||||
|
||||
Reference in New Issue
Block a user