revert rename InternalTemplateService -> MustacheTemplateService

This commit is contained in:
javanna 2016-01-06 11:08:23 +01:00 committed by Luca Cavanna
parent 8251a50667
commit 94469d75f9
4 changed files with 7 additions and 7 deletions

View File

@ -130,7 +130,7 @@ public class IngestPlugin extends Plugin {
processorsModule.addProcessor(SplitProcessor.TYPE, (environment, templateService) -> new SplitProcessor.Factory()); processorsModule.addProcessor(SplitProcessor.TYPE, (environment, templateService) -> new SplitProcessor.Factory());
processorsModule.addProcessor(JoinProcessor.TYPE, (environment, templateService) -> new JoinProcessor.Factory()); processorsModule.addProcessor(JoinProcessor.TYPE, (environment, templateService) -> new JoinProcessor.Factory());
processorsModule.addProcessor(UppercaseProcessor.TYPE, (environment, templateService) -> new UppercaseProcessor.Factory()); processorsModule.addProcessor(UppercaseProcessor.TYPE, (environment, templateService) -> new UppercaseProcessor.Factory());
processorsModule.addProcessor(LowercaseProcessor.TYPE, (environment, mustacheFactory) -> new LowercaseProcessor.Factory()); processorsModule.addProcessor(LowercaseProcessor.TYPE, (environment, templateService) -> new LowercaseProcessor.Factory());
processorsModule.addProcessor(TrimProcessor.TYPE, (environment, templateService) -> new TrimProcessor.Factory()); processorsModule.addProcessor(TrimProcessor.TYPE, (environment, templateService) -> new TrimProcessor.Factory());
processorsModule.addProcessor(ConvertProcessor.TYPE, (environment, templateService) -> new ConvertProcessor.Factory()); processorsModule.addProcessor(ConvertProcessor.TYPE, (environment, templateService) -> new ConvertProcessor.Factory());
processorsModule.addProcessor(GsubProcessor.TYPE, (environment, templateService) -> new GsubProcessor.Factory()); processorsModule.addProcessor(GsubProcessor.TYPE, (environment, templateService) -> new GsubProcessor.Factory());
@ -170,6 +170,6 @@ public class IngestPlugin extends Plugin {
} }
public void onModule(ScriptModule module) { public void onModule(ScriptModule module) {
module.registerScriptContext(MustacheTemplateService.INGEST_SCRIPT_CONTEXT); module.registerScriptContext(InternalTemplateService.INGEST_SCRIPT_CONTEXT);
} }
} }

View File

@ -30,13 +30,13 @@ import org.elasticsearch.script.ScriptService;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
class MustacheTemplateService implements TemplateService { class InternalTemplateService implements TemplateService {
public static final ScriptContext.Plugin INGEST_SCRIPT_CONTEXT = new ScriptContext.Plugin("elasticsearch-ingest", "ingest"); public static final ScriptContext.Plugin INGEST_SCRIPT_CONTEXT = new ScriptContext.Plugin("elasticsearch-ingest", "ingest");
private final ScriptService scriptService; private final ScriptService scriptService;
MustacheTemplateService(ScriptService scriptService) { InternalTemplateService(ScriptService scriptService) {
this.scriptService = scriptService; this.scriptService = scriptService;
} }

View File

@ -87,7 +87,7 @@ public class PipelineStore extends AbstractComponent implements Closeable {
public void buildProcessorFactoryRegistry(Map<String, ProcessorFactoryProvider> processorFactoryProviders, Environment environment, ScriptService scriptService) { public void buildProcessorFactoryRegistry(Map<String, ProcessorFactoryProvider> processorFactoryProviders, Environment environment, ScriptService scriptService) {
Map<String, Processor.Factory> processorFactories = new HashMap<>(); Map<String, Processor.Factory> processorFactories = new HashMap<>();
TemplateService templateService = new MustacheTemplateService(scriptService); TemplateService templateService = new InternalTemplateService(scriptService);
for (Map.Entry<String, ProcessorFactoryProvider> entry : processorFactoryProviders.entrySet()) { for (Map.Entry<String, ProcessorFactoryProvider> entry : processorFactoryProviders.entrySet()) {
Processor.Factory processorFactory = entry.getValue().apply(environment, templateService); Processor.Factory processorFactory = entry.getValue().apply(environment, templateService);
processorFactories.put(entry.getKey(), processorFactory); processorFactories.put(entry.getKey(), processorFactory);

View File

@ -42,12 +42,12 @@ public abstract class AbstractMustacheTests extends ESTestCase {
.build(); .build();
MustacheScriptEngineService mustache = new MustacheScriptEngineService(settings); MustacheScriptEngineService mustache = new MustacheScriptEngineService(settings);
ScriptContextRegistry registry = new ScriptContextRegistry( ScriptContextRegistry registry = new ScriptContextRegistry(
Collections.singletonList(MustacheTemplateService.INGEST_SCRIPT_CONTEXT) Collections.singletonList(InternalTemplateService.INGEST_SCRIPT_CONTEXT)
); );
ScriptService scriptService = new ScriptService( ScriptService scriptService = new ScriptService(
settings, new Environment(settings), Collections.singleton(mustache), null, registry settings, new Environment(settings), Collections.singleton(mustache), null, registry
); );
templateService = new MustacheTemplateService(scriptService); templateService = new InternalTemplateService(scriptService);
} }
} }