Better default size for global index -> alias map

The alias -> (index -> alias) map, specifically the index -> alias one, typically just hold one entry, yet we eagerly initialize it to the number of indices. When there are many indices, each with many aliases, this is a very large overhead per alias...
closes #6504
This commit is contained in:
Shay Banon 2014-06-16 00:51:42 +02:00
parent 6d77a248fb
commit 4c579d6c8d
1 changed files with 1 additions and 1 deletions

View File

@ -191,7 +191,7 @@ public class MetaData implements Iterable<IndexMetaData> {
AliasMetaData aliasMd = aliasCursor.value;
ImmutableOpenMap.Builder<String, AliasMetaData> indexAliasMap = (ImmutableOpenMap.Builder<String, AliasMetaData>) tmpAliases.get(aliasMd.alias());
if (indexAliasMap == null) {
indexAliasMap = ImmutableOpenMap.builder(indices.size());
indexAliasMap = ImmutableOpenMap.builder(1); // typically, there is 1 alias pointing to an index
tmpAliases.put(aliasMd.alias(), indexAliasMap);
}
indexAliasMap.put(index, aliasMd);