mirror of https://gitee.com/bigwinds/arangodb
arangorestore/cluster: default to 1 shard.
If shards is not given in the structure description, take 1 shard.
This commit is contained in:
parent
e9f55d8b61
commit
7c8fc95de8
|
@ -2218,16 +2218,12 @@ int RestReplicationHandler::processRestoreCollectionCoordinator (
|
||||||
|
|
||||||
// now re-create the collection
|
// now re-create the collection
|
||||||
// dig out number of shards:
|
// dig out number of shards:
|
||||||
|
uint64_t numberOfShards = 1;
|
||||||
TRI_json_t const* shards = JsonHelper::getArrayElement(parameters, "shards");
|
TRI_json_t const* shards = JsonHelper::getArrayElement(parameters, "shards");
|
||||||
if (0 == shards) {
|
if (0 != shards && TRI_IsArrayJson(shards)) {
|
||||||
errorMsg = "did not find \"shards\" attribute in parameters";
|
numberOfShards = TRI_LengthVector(&shards->_value._objects)/2;
|
||||||
return TRI_ERROR_INTERNAL;
|
|
||||||
}
|
}
|
||||||
if (! TRI_IsArrayJson(shards)) {
|
// We take one shard if "shards" was not given
|
||||||
errorMsg = "\"shards\" attribute in parameters is not an array";
|
|
||||||
return TRI_ERROR_INTERNAL;
|
|
||||||
}
|
|
||||||
uint64_t numberOfShards = TRI_LengthVector(&shards->_value._objects)/2;
|
|
||||||
|
|
||||||
TRI_voc_tick_t new_id_tick = ci->uniqid(1);
|
TRI_voc_tick_t new_id_tick = ci->uniqid(1);
|
||||||
string new_id = StringUtils::itoa(new_id_tick);
|
string new_id = StringUtils::itoa(new_id_tick);
|
||||||
|
|
|
@ -29,8 +29,8 @@ severity = human
|
||||||
username = root
|
username = root
|
||||||
password =
|
password =
|
||||||
|
|
||||||
disable-dispatcher-kickstarter = true
|
disable-dispatcher-kickstarter = false
|
||||||
disable-dispatcher-frontend = true
|
disable-dispatcher-frontend = false
|
||||||
data-path = ./cluster/data
|
data-path = ./cluster/data
|
||||||
log-path = ./cluster/log
|
log-path = ./cluster/log
|
||||||
agent-path = ./bin/etcd-arango
|
agent-path = ./bin/etcd-arango
|
||||||
|
|
Loading…
Reference in New Issue