mirror of https://gitee.com/bigwinds/arangodb
API cleanup in LogicalCollection. Removed some unused exposed toVelocypack functions. Removed toVelocyPack with maxTick variant. That is available in the StorageEngine instead
This commit is contained in:
parent
cac32a4d1d
commit
900b15dd3a
|
@ -823,15 +823,19 @@ void LogicalCollection::toVelocyPackForClusterInventory(VPackBuilder& result,
|
|||
}
|
||||
result.openObject();
|
||||
result.add(VPackValue("parameters"));
|
||||
result.openObject();
|
||||
toVelocyPackInObject(result, true);
|
||||
result.close();
|
||||
|
||||
std::unordered_set<std::string> ignoreKeys{"allowUserKeys", "cid", "count",
|
||||
"statusString"
|
||||
"version"};
|
||||
VPackBuilder params = toVelocyPackIgnore(ignoreKeys, true);
|
||||
result.add(params.slice());
|
||||
|
||||
result.add(VPackValue("indexes"));
|
||||
getIndexesVPack(result, false);
|
||||
result.close(); // CollectionInfo
|
||||
}
|
||||
|
||||
void LogicalCollection::toVelocyPack2(VPackBuilder& result, bool translateCids) const {
|
||||
void LogicalCollection::toVelocyPack(VPackBuilder& result, bool translateCids) const {
|
||||
// We write into an open object
|
||||
TRI_ASSERT(result.isOpenObject());
|
||||
|
||||
|
@ -922,7 +926,7 @@ void LogicalCollection::toVelocyPack2(VPackBuilder& result, bool translateCids)
|
|||
VPackBuilder LogicalCollection::toVelocyPackIgnore(std::unordered_set<std::string> const& ignoreKeys, bool translateCids) const {
|
||||
VPackBuilder full;
|
||||
full.openObject();
|
||||
toVelocyPack2(full, translateCids);
|
||||
toVelocyPack(full, translateCids);
|
||||
full.close();
|
||||
return VPackCollection::remove(full.slice(), ignoreKeys);
|
||||
}
|
||||
|
@ -974,13 +978,6 @@ void LogicalCollection::toVelocyPackInObject(VPackBuilder& result, bool translat
|
|||
getIndexesVPack(result, false);
|
||||
}
|
||||
|
||||
void LogicalCollection::toVelocyPack(VPackBuilder& builder, bool includeIndexes,
|
||||
TRI_voc_tick_t maxTick) {
|
||||
TRI_ASSERT(!builder.isClosed());
|
||||
StorageEngine* engine = EngineSelectorFeature::ENGINE;
|
||||
engine->getCollectionInfo(_vocbase, _cid, builder, includeIndexes, maxTick);
|
||||
}
|
||||
|
||||
void LogicalCollection::increaseInternalVersion() { ++_internalVersion; }
|
||||
|
||||
CollectionResult LogicalCollection::updateProperties(VPackSlice const& slice,
|
||||
|
|
|
@ -243,21 +243,14 @@ class LogicalCollection {
|
|||
virtual void setStatus(TRI_vocbase_col_status_e);
|
||||
|
||||
// SECTION: Serialisation
|
||||
void toVelocyPack2(velocypack::Builder&, bool translateCids) const;
|
||||
void toVelocyPack(velocypack::Builder&, bool translateCids) const;
|
||||
|
||||
velocypack::Builder toVelocyPackIgnore(
|
||||
std::unordered_set<std::string> const& ignoreKeys,
|
||||
bool translateCids) const;
|
||||
|
||||
// void toVelocyPack(velocypack::Builder&, bool withPath) const;
|
||||
|
||||
virtual void toVelocyPackForClusterInventory(velocypack::Builder&,
|
||||
bool useSystem) const;
|
||||
// virtual void toVelocyPackForClusterCollectionInfo(velocypack::Builder&) const;
|
||||
|
||||
/// @brief transform the information for this collection to velocypack
|
||||
/// The builder has to be an opened Type::Object
|
||||
void toVelocyPack(velocypack::Builder&, bool, TRI_voc_tick_t);
|
||||
|
||||
inline TRI_vocbase_t* vocbase() const { return _vocbase; }
|
||||
|
||||
|
|
|
@ -783,7 +783,10 @@ std::shared_ptr<VPackBuilder> TRI_vocbase_t::inventory(TRI_voc_tick_t maxTick,
|
|||
continue;
|
||||
}
|
||||
|
||||
collection->toVelocyPack(*builder, true, maxTick);
|
||||
TRI_ASSERT(!builder->isClosed());
|
||||
StorageEngine* engine = EngineSelectorFeature::ENGINE;
|
||||
engine->getCollectionInfo(collection->vocbase(), collection->cid(),
|
||||
*(builder.get()), true, maxTick);
|
||||
}
|
||||
|
||||
builder->close();
|
||||
|
|
Loading…
Reference in New Issue