mirror of https://gitee.com/bigwinds/arangodb
removed unused methods
This commit is contained in:
parent
e227d670f0
commit
a7cf45342f
|
@ -460,104 +460,8 @@ bool VocbaseCollectionInfo::isVolatile() const { return _isVolatile; }
|
||||||
// If true waits for mysnc
|
// If true waits for mysnc
|
||||||
bool VocbaseCollectionInfo::waitForSync() const { return _waitForSync; }
|
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::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<DatabaseFeature>("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<TRI_voc_size_t>(
|
|
||||||
slice, "journalSize", static_cast<TRI_voc_size_t>(database->maximalJournalSize()));
|
|
||||||
} else {
|
|
||||||
_maximalSize = arangodb::basics::VelocyPackHelper::getNumericValue<TRI_voc_size_t>(
|
|
||||||
slice, "maximalSize", static_cast<TRI_voc_size_t>(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<TRI_voc_size_t>(
|
|
||||||
slice, "journalSize", TRI_JOURNAL_DEFAULT_SIZE);
|
|
||||||
} else {
|
|
||||||
_maximalSize =
|
|
||||||
arangodb::basics::VelocyPackHelper::getNumericValue<TRI_voc_size_t>(
|
|
||||||
slice, "maximalSize", TRI_JOURNAL_DEFAULT_SIZE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_indexBuckets =
|
|
||||||
arangodb::basics::VelocyPackHelper::getNumericValue<uint32_t>(
|
|
||||||
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<TRI_voc_size_t>(
|
|
||||||
slice, "journalSize", _maximalSize);
|
|
||||||
} else {
|
|
||||||
_maximalSize =
|
|
||||||
arangodb::basics::VelocyPackHelper::getNumericValue<TRI_voc_size_t>(
|
|
||||||
slice, "maximalSize", _maximalSize);
|
|
||||||
}
|
|
||||||
_indexBuckets =
|
|
||||||
arangodb::basics::VelocyPackHelper::getNumericValue<uint32_t>(
|
|
||||||
slice, "indexBuckets", _indexBuckets);
|
|
||||||
|
|
||||||
_initialCount =
|
|
||||||
arangodb::basics::VelocyPackHelper::getNumericValue<int64_t>(
|
|
||||||
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<VPackBuilder> VocbaseCollectionInfo::toVelocyPack() const {
|
std::shared_ptr<VPackBuilder> VocbaseCollectionInfo::toVelocyPack() const {
|
||||||
auto builder = std::make_shared<VPackBuilder>();
|
auto builder = std::make_shared<VPackBuilder>();
|
||||||
builder->openObject();
|
builder->openObject();
|
||||||
|
|
|
@ -143,36 +143,9 @@ class VocbaseCollectionInfo {
|
||||||
// If true waits for mysnc
|
// If true waits for mysnc
|
||||||
bool waitForSync() const;
|
bool waitForSync() const;
|
||||||
|
|
||||||
void setCollectionId(TRI_voc_cid_t);
|
|
||||||
|
|
||||||
void setPlanId(TRI_voc_cid_t);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void setDeleted(bool);
|
|
||||||
|
|
||||||
void clearKeyOptions();
|
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
|
} // namespace arangodb
|
||||||
|
@ -209,22 +182,12 @@ struct TRI_collection_t {
|
||||||
// datafile management
|
// datafile management
|
||||||
|
|
||||||
std::string const& path() const { return _path; }
|
std::string const& path() const { return _path; }
|
||||||
std::string label() const;
|
|
||||||
|
|
||||||
double lastCompaction() const { return _lastCompaction; }
|
double lastCompaction() const { return _lastCompaction; }
|
||||||
void lastCompaction(double value) { _lastCompaction = value; }
|
void lastCompaction(double value) { _lastCompaction = value; }
|
||||||
|
|
||||||
arangodb::Ditches* ditches() { return &_ditches; }
|
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:
|
public:
|
||||||
TRI_vocbase_t* _vocbase;
|
TRI_vocbase_t* _vocbase;
|
||||||
TRI_voc_tick_t _tickMax;
|
TRI_voc_tick_t _tickMax;
|
||||||
|
|
Loading…
Reference in New Issue