1
0
Fork 0

arangorestore/cluster: default to 1 shard.

If shards is not given in the structure description, take 1 shard.
This commit is contained in:
Max Neunhoeffer 2014-05-09 22:58:08 +02:00
parent e9f55d8b61
commit 7c8fc95de8
2 changed files with 6 additions and 10 deletions

View File

@ -2218,16 +2218,12 @@ int RestReplicationHandler::processRestoreCollectionCoordinator (
// now re-create the collection
// dig out number of shards:
uint64_t numberOfShards = 1;
TRI_json_t const* shards = JsonHelper::getArrayElement(parameters, "shards");
if (0 == shards) {
errorMsg = "did not find \"shards\" attribute in parameters";
return TRI_ERROR_INTERNAL;
if (0 != shards && TRI_IsArrayJson(shards)) {
numberOfShards = TRI_LengthVector(&shards->_value._objects)/2;
}
if (! TRI_IsArrayJson(shards)) {
errorMsg = "\"shards\" attribute in parameters is not an array";
return TRI_ERROR_INTERNAL;
}
uint64_t numberOfShards = TRI_LengthVector(&shards->_value._objects)/2;
// We take one shard if "shards" was not given
TRI_voc_tick_t new_id_tick = ci->uniqid(1);
string new_id = StringUtils::itoa(new_id_tick);

View File

@ -29,8 +29,8 @@ severity = human
username = root
password =
disable-dispatcher-kickstarter = true
disable-dispatcher-frontend = true
disable-dispatcher-kickstarter = false
disable-dispatcher-frontend = false
data-path = ./cluster/data
log-path = ./cluster/log
agent-path = ./bin/etcd-arango