diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-07-04 10:54:38 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-07-04 10:54:38 +0200 |
commit | d42bb9567c5ab0e2f81eb6ed6d4f3477238b95c6 (patch) | |
tree | fb61ba8bb6f1bc204c328d234b00664787216e64 /container-core | |
parent | 7d9ac9ea8b2591cfcfd2555c1f8f5a332fb6e04d (diff) |
Revert "Revert "Bratseth/only one clustercontroller per host 2""
This reverts commit f9b197a293c63e824cf1062b5642b67a3f00c16e.
Diffstat (limited to 'container-core')
-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, 10 insertions, 14 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 2ce345ad355..d9bbd30a474 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,7 +38,6 @@ 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; @@ -46,24 +45,21 @@ public class ProcessingResponse extends AsyncHttpResponse { private boolean explicitStatusSet = false; @SuppressWarnings("unchecked") - 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) { + public ProcessingResponse(int status, com.yahoo.processing.Request processingRequest, + com.yahoo.processing.Response processingResponse, + Renderer renderer, + Executor renderingExecutor, 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(final OutputStream stream, final ContentChannel channel, - final CompletionHandler completionHandler) throws IOException { + public void render(OutputStream stream, ContentChannel channel, + 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 cc186ea21ee..eeb4a2ef36d 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 - // calling init() and then render(). + // NOTE: Renderers are *prototype objects* - a new instance is created for each rendering by invoking + // clone(), 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. - // Burst traffic may add work faster than we can complete it, so use an unbounded queue. + // 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. // The executor SHOULD be reused across all instances having the same prototype private final ThreadPoolExecutor renderingExecutor = createExecutor(); private static ThreadPoolExecutor createExecutor() { |