diff options
Diffstat (limited to 'container-core/src/main/java/com')
-rw-r--r-- | container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java | 16 | ||||
-rw-r--r-- | container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java | 8 |
2 files changed, 14 insertions, 10 deletions
diff --git a/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java b/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java index d9bbd30a474..2ce345ad355 100644 --- a/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java +++ b/container-core/src/main/java/com/yahoo/processing/handler/ProcessingResponse.java @@ -38,6 +38,7 @@ public class ProcessingResponse extends AsyncHttpResponse { private final com.yahoo.processing.Request processingRequest; private final com.yahoo.processing.Response processingResponse; + private final Executor renderingExecutor; private final Execution execution; private final Renderer renderer; @@ -45,21 +46,24 @@ public class ProcessingResponse extends AsyncHttpResponse { private boolean explicitStatusSet = false; @SuppressWarnings("unchecked") - public ProcessingResponse(int status, com.yahoo.processing.Request processingRequest, - com.yahoo.processing.Response processingResponse, - Renderer renderer, - Executor renderingExecutor, Execution execution) { + public ProcessingResponse( + int status, + final com.yahoo.processing.Request processingRequest, + final com.yahoo.processing.Response processingResponse, + final Renderer renderer, + final Executor renderingExecutor, final Execution execution) { super(status); this.processingRequest = processingRequest; this.processingResponse = processingResponse; + this.renderingExecutor = renderingExecutor; this.execution = execution; this.renderer = renderer; } @SuppressWarnings("unchecked") @Override - public void render(OutputStream stream, ContentChannel channel, - CompletionHandler completionHandler) throws IOException { + public void render(final OutputStream stream, final ContentChannel channel, + final CompletionHandler completionHandler) throws IOException { if (renderer instanceof AsynchronousRenderer) { AsynchronousRenderer asyncRenderer = (AsynchronousRenderer)renderer; asyncRenderer.setNetworkWiring(channel, completionHandler); diff --git a/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java b/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java index eeb4a2ef36d..cc186ea21ee 100644 --- a/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java +++ b/container-core/src/main/java/com/yahoo/processing/rendering/AsynchronousSectionedRenderer.java @@ -93,8 +93,8 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e private static final Logger logger = Logger.getLogger(AsynchronousSectionedRenderer.class.getName()); - // NOTE: Renderers are *prototype objects* - a new instance is created for each rendering by invoking - // clone(), init() and then render(). + // NOTE: Renderers are *prototype objects* - a new instance is created for each rendering by invoking clone + // calling init() and then render(). // Hence any field which is not reinitialized in init() or render() will be *reused* in all rendering operations // across all threads! @@ -110,8 +110,8 @@ public abstract class AsynchronousSectionedRenderer<RESPONSE extends Response> e // This MUST be created in the init() method - see comment above private Object singleThreaded; - // Rendering threads should never block so use one thread per core. - // We should complete any work we have already started so use an unbounded queue. + // Rendering threads should never block. + // Burst traffic may add work faster than we can complete it, so use an unbounded queue. // The executor SHOULD be reused across all instances having the same prototype private final ThreadPoolExecutor renderingExecutor = createExecutor(); private static ThreadPoolExecutor createExecutor() { |