support one, and all, all-1 for index.recovery.initial_shards

This commit is contained in:
Shay Banon 2012-01-17 11:47:21 +02:00
parent 56a9c66df1
commit 0d2d0936a7
1 changed files with 4 additions and 2 deletions

View File

@ -164,9 +164,11 @@ public class LocalGatewayAllocator extends AbstractComponent implements GatewayA
if (indexMetaData.numberOfReplicas() > 2) {
requiredAllocation = ((1 + indexMetaData.numberOfReplicas()) / 2);
}
} else if ("full".equals(initialShards)) {
} else if ("one".equals(initialShards)) {
requiredAllocation = 1;
} else if ("full".equals(initialShards) || "all".equals(initialShards)) {
requiredAllocation = indexMetaData.numberOfReplicas() + 1;
} else if ("full-1".equals(initialShards)) {
} else if ("full-1".equals(initialShards) || "all-1".equals(initialShards)) {
if (indexMetaData.numberOfReplicas() > 1) {
requiredAllocation = indexMetaData.numberOfReplicas();
}