1
0
Fork 0

Fixed dumping of keygen. It was created too late.

This commit is contained in:
Michael Hackstein 2016-09-27 10:44:24 +02:00
parent 40dbed7a19
commit b97005cca3
1 changed files with 44 additions and 47 deletions

View File

@ -486,13 +486,14 @@ LogicalCollection::LogicalCollection(TRI_vocbase_t* vocbase,
} }
} }
if (_replicationFactor == 0 ||_replicationFactor > 10) { if (_replicationFactor == 0 || _replicationFactor > 10) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER, THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER,
"invalid replicationFactor"); "invalid replicationFactor");
} }
} }
if (info.isObject()) { _keyGenerator.reset(KeyGenerator::factory(info.get("keyOptions")));
auto shardsSlice = info.get("shards"); auto shardsSlice = info.get("shards");
if (shardsSlice.isObject()) { if (shardsSlice.isObject()) {
for (auto const& shardSlice : VPackObjectIterator(shardsSlice)) { for (auto const& shardSlice : VPackObjectIterator(shardsSlice)) {
@ -511,8 +512,8 @@ LogicalCollection::LogicalCollection(TRI_vocbase_t* vocbase,
auto indexesSlice = info.get("indexes"); auto indexesSlice = info.get("indexes");
if (indexesSlice.isArray()) { if (indexesSlice.isArray()) {
for (auto const& v : VPackArrayIterator(indexesSlice)) { for (auto const& v : VPackArrayIterator(indexesSlice)) {
if (arangodb::basics::VelocyPackHelper::getBooleanValue( if (arangodb::basics::VelocyPackHelper::getBooleanValue(v, "error",
v, "error", false)) { false)) {
// We have an error here. // We have an error here.
// Do not add index. // Do not add index.
// TODO Handle Properly // TODO Handle Properly
@ -541,10 +542,6 @@ LogicalCollection::LogicalCollection(TRI_vocbase_t* vocbase,
_path = engine->createCollection(_vocbase, _cid, this); _path = engine->createCollection(_vocbase, _cid, this);
} }
} }
}
_keyGenerator.reset(KeyGenerator::factory(info.get("keyOptions")));
createPhysical(); createPhysical();