Skip to content

Commit ab5d0c2

Browse files
committed
Improved code comments
1 parent 8843a78 commit ab5d0c2

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ public final void validate(MappingLookup mappers) {
554554
}
555555
}
556556

557+
/**
558+
* This method is separated out to allow subclasses (such as RootObjectMapper) to
559+
* override it and add in additional validations beyond what the mapper.validate()
560+
* method will check on each mapping.
561+
*/
557562
protected void validateSubField(Mapper mapper, MappingLookup mappers) {
558563
mapper.validate(mappers);
559564
}

server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ public int getTotalFieldsCount() {
554554
return super.getTotalFieldsCount() - 1 + runtimeFields.size();
555555
}
556556

557+
/**
558+
* Overrides in order to run the namespace validator first and then delegates to the
559+
* standard validateSubField on the parent class
560+
*/
557561
@Override
558562
protected void validateSubField(Mapper mapper, MappingLookup mappers) {
559563
namespaceValidator.validateNamespace(subobjects(), mapper.leafName());

server/src/main/java/org/elasticsearch/node/NodeConstruction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,6 @@ private void construct(
697697

698698
modules.bindToInstance(Tracer.class, telemetryProvider.getTracer());
699699

700-
// serverless deployments plug-in the namespace validator that prohibits mappings with "_project"
701700
RootObjectMapperNamespaceValidator namespaceValidator = pluginsService.loadSingletonServiceProvider(
702701
RootObjectMapperNamespaceValidator.class,
703702
() -> new DefaultRootObjectMapperNamespaceValidator()

0 commit comments

Comments
 (0)