1
0
Fork 0

moved parts into TRI_collection_t

This commit is contained in:
jsteemann 2016-07-29 09:14:05 +02:00
parent 9f6545ce13
commit 621e3df766
4 changed files with 8 additions and 13 deletions

View File

@ -121,6 +121,10 @@ bool TRI_collection_t::IsAllowedName(bool allowSystem, std::string const& name)
return true;
}
std::string TRI_collection_t::label() const {
return _vocbase->name() + " / " + _info.name();
}
/// @brief updates the parameter info block
int TRI_collection_t::updateCollectionInfo(TRI_vocbase_t* vocbase,

View File

@ -321,6 +321,7 @@ struct TRI_collection_t {
void addIndexFile(std::string const&);
int removeIndexFile(TRI_idx_iid_t);
std::string const& path() const { return _path; }
std::string label() const;
private:
/// @brief seal a datafile
@ -346,6 +347,9 @@ struct TRI_collection_t {
std::vector<TRI_datafile_t*> _datafiles; // all datafiles
std::vector<TRI_datafile_t*> _journals; // all journals
std::vector<TRI_datafile_t*> _compactors; // all compactor files
// lock for indexes
arangodb::basics::ReadWriteLock _lock;
private:
std::vector<std::string> _indexFiles; // all index filenames
};

View File

@ -87,7 +87,6 @@ using namespace arangodb::basics;
TRI_document_collection_t::TRI_document_collection_t(TRI_vocbase_t* vocbase)
: TRI_collection_t(vocbase),
_lock(),
_nextCompactionStartIndex(0),
_lastCompactionStatus(nullptr),
_useSecondaryIndexes(true),
@ -113,10 +112,6 @@ TRI_document_collection_t::~TRI_document_collection_t() {
delete _keyGenerator;
}
std::string TRI_document_collection_t::label() const {
return _vocbase->name() + " / " + _info.name();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief update statistics for a collection
/// note: the write-lock for the collection must be held to call this

View File

@ -97,14 +97,6 @@ struct TRI_document_collection_t : public TRI_collection_t {
~TRI_document_collection_t();
std::string label() const;
// ...........................................................................
// this lock protects the indexes and _headers attributes
// ...........................................................................
arangodb::basics::ReadWriteLock _lock;
private:
arangodb::Mutex _compactionStatusLock;
size_t _nextCompactionStartIndex;