Mappings: Remove includeExisting flag from adding ObjectMapper and

FieldMapper listeners

This flag is unused by the 2 places that add these listeners.
This commit is contained in:
Ryan Ernst 2015-01-07 12:48:30 -08:00
parent 959e3ca9da
commit 1ad64a97ec
2 changed files with 4 additions and 10 deletions

View File

@ -666,11 +666,8 @@ public class DocumentMapper implements ToXContent {
}
}
public void addFieldMapperListener(FieldMapperListener fieldMapperListener, boolean includeExisting) {
public void addFieldMapperListener(FieldMapperListener fieldMapperListener) {
fieldMapperListeners.add(fieldMapperListener);
if (includeExisting) {
traverse(fieldMapperListener);
}
}
public void traverse(FieldMapperListener listener) {
@ -702,11 +699,8 @@ public class DocumentMapper implements ToXContent {
}
}
public void addObjectMapperListener(ObjectMapperListener objectMapperListener, boolean includeExisting) {
public void addObjectMapperListener(ObjectMapperListener objectMapperListener) {
objectMapperListeners.add(objectMapperListener);
if (includeExisting) {
traverse(objectMapperListener);
}
}
public void traverse(ObjectMapperListener listener) {

View File

@ -352,12 +352,12 @@ public class MapperService extends AbstractIndexComponent {
FieldMapperListener.Aggregator fieldMappersAgg = new FieldMapperListener.Aggregator();
mapper.traverse(fieldMappersAgg);
addFieldMappers(fieldMappersAgg.mappers);
mapper.addFieldMapperListener(fieldMapperListener, false);
mapper.addFieldMapperListener(fieldMapperListener);
ObjectMapperListener.Aggregator objectMappersAgg = new ObjectMapperListener.Aggregator();
mapper.traverse(objectMappersAgg);
addObjectMappers(objectMappersAgg.mappers.toArray(new ObjectMapper[objectMappersAgg.mappers.size()]));
mapper.addObjectMapperListener(objectMapperListener, false);
mapper.addObjectMapperListener(objectMapperListener);
for (DocumentTypeListener typeListener : typeListeners) {
typeListener.beforeCreate(mapper);