@Override
    public void beginResponse(OutputStream stream) throws IOException {
        long renderingStartTimeMs = timeSource.getAsLong();
        beginJsonCallback(stream);
        fieldConsumerSettings.getSettings(getResult().getQuery());
        setGenerator(generatorFactory.createGenerator(stream, JsonEncoding.UTF8), fieldConsumerSettings);
        renderedChildren = new ArrayDeque<>();
        generator.writeStartObject();
        renderTrace(getExecution().trace());
        renderTiming(renderingStartTimeMs);
        generator.writeFieldName(ROOT);
    }
Creates a json renderer using a custom executor.
Using a custom executor is useful for tests to avoid creating new threads for each renderer registry.
container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java