1
0
Fork 0

Merge branch 'generic-col-types' of https://github.com/arangodb/arangodb into generic-col-types

This commit is contained in:
jsteemann 2016-08-30 11:30:14 +02:00
commit e227d670f0
1 changed files with 12 additions and 16 deletions

View File

@ -194,7 +194,7 @@ LogicalCollection::LogicalCollection(TRI_vocbase_t* vocbase,
_isLocal(isLocal),
// THESE VALUES HAVE ARBITRARY VALUES. FIX THEM.
_isDeleted(false),
_doCompact(false),
_doCompact(true),
_isSystem(LogicalCollection::IsSystemName(name)),
_isVolatile(isVolatile),
_waitForSync(false),
@ -299,7 +299,7 @@ LogicalCollection::LogicalCollection(TRI_vocbase_t* vocbase, VPackSlice info)
info, "status", TRI_VOC_COL_STATUS_CORRUPTED)),
_isLocal(!ServerState::instance()->isCoordinator()),
_isDeleted(ReadBooleanValue(info, "deleted", false)),
_doCompact(ReadBooleanValue(info, "doCompact", false)),
_doCompact(ReadBooleanValue(info, "doCompact", true)),
_isSystem(ReadBooleanValue(info, "isSystem", false)),
_isVolatile(ReadBooleanValue(info, "isVolatile", false)),
_waitForSync(ReadBooleanValue(info, "waitForSync", false)),
@ -321,6 +321,16 @@ LogicalCollection::LogicalCollection(TRI_vocbase_t* vocbase, VPackSlice info)
_numberDocuments(0),
_collection(nullptr),
_lock() {
if (_isVolatile && _waitForSync) {
// Illegal collection configuration
THROW_ARANGO_EXCEPTION_MESSAGE(
TRI_ERROR_BAD_PARAMETER,
"volatile collections do not support the waitForSync option");
}
if (_journalSize < TRI_JOURNAL_MINIMAL_SIZE) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER,
"<properties>.journalSize too small");
}
if (info.isObject()) {
// Otherwise the cluster communication is broken.
// We cannot store anything further.
@ -372,20 +382,6 @@ LogicalCollection::LogicalCollection(TRI_vocbase_t* vocbase, VPackSlice info)
createPhysical();
VPackSlice slice;
if (_keyOptions != nullptr) {
slice = VPackSlice(_keyOptions->data());
}
std::unique_ptr<KeyGenerator> keyGenerator(KeyGenerator::factory(slice));
if (keyGenerator == nullptr) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_INVALID_KEY_GENERATOR);
}
_keyGenerator.reset(keyGenerator.release());
// TODO Only DBServer? Is this correct?
if (ServerState::instance()->isDBServer()) {
_followers.reset(new FollowerInfo(this));