diff --git a/arangod/VocBase/collection.cpp b/arangod/VocBase/collection.cpp index c930149b0a..55619458f0 100644 --- a/arangod/VocBase/collection.cpp +++ b/arangod/VocBase/collection.cpp @@ -460,104 +460,8 @@ bool VocbaseCollectionInfo::isVolatile() const { return _isVolatile; } // If true waits for mysnc bool VocbaseCollectionInfo::waitForSync() const { return _waitForSync; } -void VocbaseCollectionInfo::setCollectionId(TRI_voc_cid_t cid) { _cid = cid; } - -void VocbaseCollectionInfo::setPlanId(TRI_voc_cid_t planId) { - _planId = planId; -} - -void VocbaseCollectionInfo::setDeleted(bool deleted) { _deleted = deleted; } - void VocbaseCollectionInfo::clearKeyOptions() { _keyOptions.reset(); } -void VocbaseCollectionInfo::update(VPackSlice const& slice, bool preferDefaults, - TRI_vocbase_t const* vocbase) { - // the following collection properties are intentionally not updated as - // updating - // them would be very complicated: - // - _cid - // - _name - // - _type - // - _isSystem - // - _isVolatile - // ... probably a few others missing here ... - - if (preferDefaults) { - if (vocbase != nullptr) { - auto database = application_features::ApplicationServer::getFeature("Database"); - - _doCompact = arangodb::basics::VelocyPackHelper::getBooleanValue( - slice, "doCompact", true); - _waitForSync = arangodb::basics::VelocyPackHelper::getBooleanValue( - slice, "waitForSync", database->waitForSync()); - if (slice.hasKey("journalSize")) { - _maximalSize = arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "journalSize", static_cast(database->maximalJournalSize())); - } else { - _maximalSize = arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "maximalSize", static_cast(database->maximalJournalSize())); - } - } else { - _doCompact = arangodb::basics::VelocyPackHelper::getBooleanValue( - slice, "doCompact", true); - _waitForSync = arangodb::basics::VelocyPackHelper::getBooleanValue( - slice, "waitForSync", false); - if (slice.hasKey("journalSize")) { - _maximalSize = - arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "journalSize", TRI_JOURNAL_DEFAULT_SIZE); - } else { - _maximalSize = - arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "maximalSize", TRI_JOURNAL_DEFAULT_SIZE); - } - } - _indexBuckets = - arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "indexBuckets", DatabaseFeature::DefaultIndexBuckets); - } else { - _doCompact = arangodb::basics::VelocyPackHelper::getBooleanValue( - slice, "doCompact", _doCompact); - _waitForSync = arangodb::basics::VelocyPackHelper::getBooleanValue( - slice, "waitForSync", _waitForSync); - if (slice.hasKey("journalSize")) { - _maximalSize = - arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "journalSize", _maximalSize); - } else { - _maximalSize = - arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "maximalSize", _maximalSize); - } - _indexBuckets = - arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "indexBuckets", _indexBuckets); - - _initialCount = - arangodb::basics::VelocyPackHelper::getNumericValue( - slice, "count", _initialCount); - } -} - -void VocbaseCollectionInfo::update(VocbaseCollectionInfo const& other) { - _type = other.type(); - _cid = other.id(); - _planId = other.planId(); - _maximalSize = other.maximalSize(); - _initialCount = other.initialCount(); - _indexBuckets = other.indexBuckets(); - - TRI_CopyString(_name, other.name().c_str(), sizeof(_name) - 1); - - _keyOptions = other.keyOptions(); - - _deleted = other.deleted(); - _doCompact = other.doCompact(); - _isSystem = other.isSystem(); - _isVolatile = other.isVolatile(); - _waitForSync = other.waitForSync(); -} - std::shared_ptr VocbaseCollectionInfo::toVelocyPack() const { auto builder = std::make_shared(); builder->openObject(); diff --git a/arangod/VocBase/collection.h b/arangod/VocBase/collection.h index bf5ae05f1b..736f239d41 100644 --- a/arangod/VocBase/collection.h +++ b/arangod/VocBase/collection.h @@ -143,36 +143,9 @@ class VocbaseCollectionInfo { // If true waits for mysnc bool waitForSync() const; - void setCollectionId(TRI_voc_cid_t); - void setPlanId(TRI_voc_cid_t); - - - - void setDeleted(bool); void clearKeyOptions(); - - ////////////////////////////////////////////////////////////////////////////// - /// @brief updates settings for this collection info. - /// If the second parameter is false it will only - /// update the values explicitly contained in the slice. - /// If the second parameter is true and the third is a nullptr, - /// it will use global default values for all missing options in the - /// slice. - /// If the third parameter is not nullptr and the second is true, it - /// will - /// use the defaults stored in the vocbase. - ////////////////////////////////////////////////////////////////////////////// - - void update(arangodb::velocypack::Slice const&, bool, TRI_vocbase_t const*); - - ////////////////////////////////////////////////////////////////////////////// - /// @brief updates settings for this collection info with the content of the - /// other - ////////////////////////////////////////////////////////////////////////////// - - void update(VocbaseCollectionInfo const&); }; } // namespace arangodb @@ -209,22 +182,12 @@ struct TRI_collection_t { // datafile management std::string const& path() const { return _path; } - std::string label() const; double lastCompaction() const { return _lastCompaction; } void lastCompaction(double value) { _lastCompaction = value; } arangodb::Ditches* ditches() { return &_ditches; } - void setPath(std::string const& path) { _path = path; } - - private: - /// @brief creates the initial indexes for the collection - int createInitialIndexes(); - - int deleteSecondaryIndexes(arangodb::Transaction*, TRI_doc_mptr_t const*, - bool); - public: TRI_vocbase_t* _vocbase; TRI_voc_tick_t _tickMax;