Introduce a Few Settings Singleton Instances (#78897) (#78908)

This is mostly motivated by the ILM steps changes, that showed up as hot in
profiling since instantiating a `Settings` instance turns out to be somewhat expensive.
Also cleans up a couple of other spots and some duplication as well.
This commit is contained in:
Armin Braun 2021-10-11 12:20:40 +02:00 committed by GitHub
parent 0989704f28
commit 7630301bd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 101 additions and 74 deletions

View file

@ -36,8 +36,6 @@ import java.util.Map;
import java.util.Objects;
import java.util.Set;
import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS;
/**
* A request to create an index.
*/
@ -47,7 +45,7 @@ public class CreateIndexRequest extends TimedRequest implements Validatable, ToX
static final ParseField ALIASES = new ParseField("aliases");
private final String index;
private Settings settings = EMPTY_SETTINGS;
private Settings settings = Settings.EMPTY;
private BytesReference mappings;
private XContentType mappingsXContentType;

View file

@ -178,7 +178,7 @@ public class IndexTemplateMetadata {
private List<String> indexPatterns;
private Settings settings = Settings.Builder.EMPTY_SETTINGS;
private Settings settings = Settings.EMPTY;
private MappingMetadata mappings;

View file

@ -40,7 +40,6 @@ import java.util.Set;
import java.util.stream.Collectors;
import static org.elasticsearch.action.ValidateActions.addValidationError;
import static org.elasticsearch.common.settings.Settings.Builder.EMPTY_SETTINGS;
/**
* A request to create an index template.
@ -66,7 +65,7 @@ public class PutIndexTemplateRequest extends MasterNodeRequest<PutIndexTemplateR
private boolean create;
private Settings settings = EMPTY_SETTINGS;
private Settings settings = Settings.EMPTY;
private BytesReference mappings = null;