1
0
Fork 0

Feature/dont get local system collections alltogether (#6250)

* don't need to look at local _system collections in maintenace
* Use system() API to determine if a collection is a system coll.
This commit is contained in:
Kaveh Vahedipour 2018-09-03 09:23:06 +02:00 committed by Max Neunhöffer
parent a669d5a03d
commit c7bb7a6f44
2 changed files with 11 additions and 13 deletions

View File

@ -84,12 +84,15 @@ Result getLocalCollections(VPackBuilder& collections) {
auto cols = vocbase->collections(false); auto cols = vocbase->collections(false);
for (auto const& collection : cols) { for (auto const& collection : cols) {
collections.add(VPackValue(collection->name())); if (!collection->system()) {
std::string const colname = collection->name();
collections.add(VPackValue(colname));
VPackObjectBuilder col(&collections); VPackObjectBuilder col(&collections);
collection->toVelocyPack(collections,true,false); collection->toVelocyPack(collections,true,false);
collections.add( collections.add(
"theLeader", VPackValue(collection->followers()->getLeader())); "theLeader", VPackValue(collection->followers()->getLeader()));
} }
}
} catch (std::exception const& e) { } catch (std::exception const& e) {
return Result( return Result(
TRI_ERROR_INTERNAL, TRI_ERROR_INTERNAL,

View File

@ -437,13 +437,11 @@ arangodb::Result arangodb::maintenance::diffPlanLocal (
if (pdbs.hasKey(dbname)) { // if in plan if (pdbs.hasKey(dbname)) { // if in plan
for (auto const& sh : VPackObjectIterator(db.value)) { // for each local shard for (auto const& sh : VPackObjectIterator(db.value)) { // for each local shard
std::string shName = sh.key.copyString(); std::string shName = sh.key.copyString();
if (shName.front() != '_') { // exclude local system shards/collections
handleLocalShard(dbname, shName, sh.value, shardMap.slice(), commonShrds, handleLocalShard(dbname, shName, sh.value, shardMap.slice(), commonShrds,
indis, serverId, actions); indis, serverId, actions);
} }
} }
} }
}
@ -805,9 +803,6 @@ arangodb::Result arangodb::maintenance::reportInCurrent(
for (auto const& shard : VPackObjectIterator(database.value)) { for (auto const& shard : VPackObjectIterator(database.value)) {
auto const shName = shard.key.copyString(); auto const shName = shard.key.copyString();
if (shName.at(0) == '_') { // local system collection
continue;
}
auto const shSlice = shard.value; auto const shSlice = shard.value;
auto const colName = shSlice.get(PLAN_ID).copyString(); auto const colName = shSlice.get(PLAN_ID).copyString();