Issue #9300 - Rename RetainableByteBufferPool to ByteBufferPool
ArrayRetainableByteBufferPool -> ArrayByteBufferPool. Updated field names. Updates tests. Updated *.mod files to not reference RetainableByteBufferPool. Updated javadocs. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
44980ebfc3
commit
5cc07994c0
|
@ -33,7 +33,7 @@ The `ClientConnector` primarily wraps the link:{javadoc-url}/org/eclipse/jetty/i
|
|||
|
||||
* a thread pool (in form of an `java.util.concurrent.Executor`)
|
||||
* a scheduler (in form of `org.eclipse.jetty.util.thread.Scheduler`)
|
||||
* a byte buffer pool (in form of `org.eclipse.jetty.io.RetainableByteBufferPool`)
|
||||
* a byte buffer pool (in form of `org.eclipse.jetty.io.ByteBufferPool`)
|
||||
* a TLS factory (in form of `org.eclipse.jetty.util.ssl.SslContextFactory.Client`)
|
||||
|
||||
The `ClientConnector` is where you want to set those components after you have configured them.
|
||||
|
|
|
@ -48,7 +48,7 @@ import org.eclipse.jetty.http.HttpHeader;
|
|||
import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.http.HttpParser;
|
||||
import org.eclipse.jetty.http.HttpScheme;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.ClientConnectionFactory;
|
||||
import org.eclipse.jetty.io.ClientConnector;
|
||||
|
@ -201,7 +201,7 @@ public class HttpClient extends ContainerLifeCycle
|
|||
: ProcessorUtils.availableProcessors() * 2;
|
||||
ByteBufferPool byteBufferPool = getByteBufferPool();
|
||||
if (byteBufferPool == null)
|
||||
setByteBufferPool(new ArrayRetainableByteBufferPool(0, 2048, 65536, maxBucketSize));
|
||||
setByteBufferPool(new ArrayByteBufferPool(0, 2048, 65536, maxBucketSize));
|
||||
Scheduler scheduler = getScheduler();
|
||||
if (scheduler == null)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.util.zip.GZIPOutputStream;
|
|||
|
||||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.Content;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
|
@ -243,8 +243,8 @@ public class HttpClientGZIPTest extends AbstractHttpClientServerTest
|
|||
});
|
||||
|
||||
ByteBufferPool pool = client.getByteBufferPool();
|
||||
assumeTrue(pool instanceof ArrayRetainableByteBufferPool);
|
||||
ArrayRetainableByteBufferPool bufferPool = (ArrayRetainableByteBufferPool)pool;
|
||||
assumeTrue(pool instanceof ArrayByteBufferPool);
|
||||
ArrayByteBufferPool bufferPool = (ArrayByteBufferPool)pool;
|
||||
|
||||
ContentResponse response = client.newRequest("localhost", connector.getLocalPort())
|
||||
.scheme(scenario.getScheme())
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.eclipse.jetty.http.HttpHeader;
|
|||
import org.eclipse.jetty.http.HttpHeaderValue;
|
||||
import org.eclipse.jetty.http.HttpScheme;
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.ClientConnectionFactory;
|
||||
import org.eclipse.jetty.io.ClientConnector;
|
||||
|
@ -753,7 +753,7 @@ public class HttpClientTLSTest
|
|||
|
||||
assertThrows(Exception.class, () -> client.newRequest("localhost", connector.getLocalPort()).scheme(HttpScheme.HTTPS.asString()).send());
|
||||
|
||||
ArrayRetainableByteBufferPool bufferPool = (ArrayRetainableByteBufferPool)server.getByteBufferPool();
|
||||
ArrayByteBufferPool bufferPool = (ArrayByteBufferPool)server.getByteBufferPool();
|
||||
Pool<RetainableByteBuffer> bucket = bufferPool.poolFor(16 * 1024 + 1, connector.getConnectionFactory(HttpConnectionFactory.class).isUseInputDirectByteBuffers());
|
||||
assertEquals(1, bucket.size());
|
||||
assertEquals(1, bucket.getIdleCount());
|
||||
|
@ -769,7 +769,7 @@ public class HttpClientTLSTest
|
|||
QueuedThreadPool serverThreads = new QueuedThreadPool();
|
||||
serverThreads.setName("server");
|
||||
List<RetainableByteBuffer> leakedBuffers = new CopyOnWriteArrayList<>();
|
||||
ByteBufferPool bufferPool = new ByteBufferPool.Wrapper(new ArrayRetainableByteBufferPool())
|
||||
ByteBufferPool bufferPool = new ByteBufferPool.Wrapper(new ArrayByteBufferPool())
|
||||
{
|
||||
@Override
|
||||
public RetainableByteBuffer acquire(int size, boolean direct)
|
||||
|
@ -839,7 +839,7 @@ public class HttpClientTLSTest
|
|||
QueuedThreadPool serverThreads = new QueuedThreadPool();
|
||||
serverThreads.setName("server");
|
||||
List<RetainableByteBuffer> leakedBuffers = new CopyOnWriteArrayList<>();
|
||||
ByteBufferPool bufferPool = new ByteBufferPool.Wrapper(new ArrayRetainableByteBufferPool())
|
||||
ByteBufferPool bufferPool = new ByteBufferPool.Wrapper(new ArrayByteBufferPool())
|
||||
{
|
||||
@Override
|
||||
public RetainableByteBuffer acquire(int size, boolean direct)
|
||||
|
@ -924,7 +924,7 @@ public class HttpClientTLSTest
|
|||
QueuedThreadPool serverThreads = new QueuedThreadPool();
|
||||
serverThreads.setName("server");
|
||||
List<RetainableByteBuffer> leakedBuffers = new CopyOnWriteArrayList<>();
|
||||
ByteBufferPool bufferPool = new ByteBufferPool.Wrapper(new ArrayRetainableByteBufferPool())
|
||||
ByteBufferPool bufferPool = new ByteBufferPool.Wrapper(new ArrayByteBufferPool())
|
||||
{
|
||||
@Override
|
||||
public RetainableByteBuffer acquire(int size, boolean direct)
|
||||
|
|
|
@ -19,7 +19,7 @@ import javax.net.ssl.SSLEngine;
|
|||
import javax.net.ssl.SSLHandshakeException;
|
||||
|
||||
import org.eclipse.jetty.io.AbstractConnection;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteArrayEndPoint;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
|
@ -43,7 +43,7 @@ public class SslConnectionTest
|
|||
sslContextFactory.setKeyStorePassword("storepwd");
|
||||
sslContextFactory.start();
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool();
|
||||
threadPool.start();
|
||||
ByteArrayEndPoint endPoint = new ByteArrayEndPoint();
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.jetty.fcgi.FCGI;
|
|||
import org.eclipse.jetty.fcgi.parser.ServerParser;
|
||||
import org.eclipse.jetty.http.HttpField;
|
||||
import org.eclipse.jetty.http.HttpFields;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class ClientGeneratorTest
|
|||
String longLongValue = new String(chars);
|
||||
fields.put(new HttpField(longLongName, longLongValue));
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
ClientGenerator generator = new ClientGenerator(bufferPool);
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
int id = 13;
|
||||
|
@ -157,7 +157,7 @@ public class ClientGeneratorTest
|
|||
{
|
||||
ByteBuffer content = ByteBuffer.allocate(contentLength);
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
ClientGenerator generator = new ClientGenerator(bufferPool);
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
int id = 13;
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.eclipse.jetty.fcgi.FCGI;
|
|||
import org.eclipse.jetty.fcgi.generator.ServerGenerator;
|
||||
import org.eclipse.jetty.http.HttpField;
|
||||
import org.eclipse.jetty.http.HttpFields;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class ClientParserTest
|
|||
String contentTypeValue = "text/html;charset=utf-8";
|
||||
fields.put(contentTypeName, contentTypeValue);
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
ServerGenerator generator = new ServerGenerator(bufferPool);
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
generator.generateResponseHeaders(accumulator, id, statusCode, statusMessage, fields);
|
||||
|
@ -108,7 +108,7 @@ public class ClientParserTest
|
|||
HttpFields fields = HttpFields.build()
|
||||
.put("Content-Length", "0");
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
ServerGenerator generator = new ServerGenerator(bufferPool);
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
generator.generateResponseHeaders(accumulator, id, 200, "OK", fields);
|
||||
|
@ -158,7 +158,7 @@ public class ClientParserTest
|
|||
String contentTypeValue = String.valueOf(contentLength);
|
||||
fields.put(contentTypeName, contentTypeValue);
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
ServerGenerator generator = new ServerGenerator(bufferPool);
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
generator.generateResponseHeaders(accumulator, id, code, "OK", fields);
|
||||
|
@ -209,7 +209,7 @@ public class ClientParserTest
|
|||
String contentTypeValue = String.valueOf(contentLength);
|
||||
fields.put(contentTypeName, contentTypeValue);
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
ServerGenerator generator = new ServerGenerator(bufferPool);
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
generator.generateResponseHeaders(accumulator, id, code, "OK", fields);
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.jetty.client.HttpClientTransport;
|
|||
import org.eclipse.jetty.client.LeakTrackingConnectionPool;
|
||||
import org.eclipse.jetty.fcgi.client.transport.HttpClientTransportOverFCGI;
|
||||
import org.eclipse.jetty.http.HttpScheme;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.ClientConnector;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
|
@ -53,7 +53,7 @@ public abstract class AbstractHttpClientServerTest
|
|||
server = new Server(serverThreads);
|
||||
ServerFCGIConnectionFactory fcgiConnectionFactory = new ServerFCGIConnectionFactory(new HttpConfiguration());
|
||||
// TODO: restore leak tracking.
|
||||
serverBufferPool = new ArrayRetainableByteBufferPool();
|
||||
serverBufferPool = new ArrayByteBufferPool();
|
||||
connector = new ServerConnector(server, null, null, serverBufferPool,
|
||||
1, Math.max(1, ProcessorUtils.availableProcessors() / 2), fcgiConnectionFactory);
|
||||
server.addConnector(connector);
|
||||
|
@ -67,7 +67,7 @@ public abstract class AbstractHttpClientServerTest
|
|||
clientConnector.setExecutor(clientThreads);
|
||||
// TODO: restore leak tracking.
|
||||
if (clientBufferPool == null)
|
||||
clientBufferPool = new ArrayRetainableByteBufferPool();
|
||||
clientBufferPool = new ArrayByteBufferPool();
|
||||
clientConnector.setByteBufferPool(clientBufferPool);
|
||||
HttpClientTransport transport = new HttpClientTransportOverFCGI(clientConnector, "");
|
||||
transport.setConnectionPoolFactory(destination -> new LeakTrackingConnectionPool(destination, client.getMaxConnectionsPerDestination())
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
|
@ -47,7 +47,7 @@ public class GZIPContentDecoderTest
|
|||
@BeforeEach
|
||||
public void before()
|
||||
{
|
||||
pool = new ByteBufferPool.Wrapper(new ArrayRetainableByteBufferPool())
|
||||
pool = new ByteBufferPool.Wrapper(new ArrayByteBufferPool())
|
||||
{
|
||||
@Override
|
||||
public RetainableByteBuffer acquire(int size, boolean direct)
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.jetty.http2.generator.HeadersGenerator;
|
|||
import org.eclipse.jetty.http2.hpack.HpackEncoder;
|
||||
import org.eclipse.jetty.http2.internal.Flags;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class ContinuationParseTest
|
|||
@Test
|
||||
public void testParseOneByteAtATime() throws Exception
|
||||
{
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
HeadersGenerator generator = new HeadersGenerator(new HeaderGenerator(bufferPool), new HpackEncoder());
|
||||
|
||||
final List<HeadersFrame> frames = new ArrayList<>();
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.function.UnaryOperator;
|
|||
import org.eclipse.jetty.http2.generator.DataGenerator;
|
||||
import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -34,7 +34,7 @@ public class DataGenerateParseTest
|
|||
{
|
||||
private final byte[] smallContent = new byte[128];
|
||||
private final byte[] largeContent = new byte[128 * 1024];
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
public DataGenerateParseTest()
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.eclipse.jetty.http2.WindowRateControl;
|
|||
import org.eclipse.jetty.http2.hpack.HpackEncoder;
|
||||
import org.eclipse.jetty.http2.internal.Flags;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -33,7 +33,7 @@ import static org.hamcrest.Matchers.lessThan;
|
|||
|
||||
public class FrameFloodTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
// Frame structure:
|
||||
// | Len0 | Len1 | Len2 | Type | Flags | StreamID0 |StreamID1 |StreamID2 |StreamID3 | Payload... |
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.function.UnaryOperator;
|
|||
import org.eclipse.jetty.http2.generator.GoAwayGenerator;
|
||||
import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
|||
|
||||
public class GoAwayGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParse() throws Exception
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
|||
import org.eclipse.jetty.http2.generator.HeadersGenerator;
|
||||
import org.eclipse.jetty.http2.hpack.HpackEncoder;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -38,7 +38,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
|
||||
public class HeadersGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParse() throws Exception
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.jetty.http2.generator.HeadersGenerator;
|
|||
import org.eclipse.jetty.http2.hpack.HpackEncoder;
|
||||
import org.eclipse.jetty.http2.hpack.HpackException;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
|
||||
public class HeadersTooLargeParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testProtocolErrorURITooLong() throws HpackException
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.function.UnaryOperator;
|
|||
|
||||
import org.eclipse.jetty.http2.ErrorCode;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -27,7 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
|
||||
public class MaxFrameSizeParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testMaxFrameSize()
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.function.UnaryOperator;
|
|||
import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
||||
import org.eclipse.jetty.http2.generator.PingGenerator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.NanoTime;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
|
||||
public class PingGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParse() throws Exception
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.function.UnaryOperator;
|
|||
import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
||||
import org.eclipse.jetty.http2.generator.PriorityGenerator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
|
||||
public class PriorityGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParse() throws Exception
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
|||
import org.eclipse.jetty.http2.generator.PushPromiseGenerator;
|
||||
import org.eclipse.jetty.http2.hpack.HpackEncoder;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
|
||||
public class PushPromiseGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParse() throws Exception
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.function.UnaryOperator;
|
|||
import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
||||
import org.eclipse.jetty.http2.generator.ResetGenerator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
|
||||
public class ResetGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParse() throws Exception
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.eclipse.jetty.http2.ErrorCode;
|
|||
import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
||||
import org.eclipse.jetty.http2.generator.SettingsGenerator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
|
||||
public class SettingsGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParseNoSettings()
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.function.UnaryOperator;
|
|||
|
||||
import org.eclipse.jetty.http2.ErrorCode;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
|||
|
||||
public class UnknownParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testParse()
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.function.UnaryOperator;
|
|||
import org.eclipse.jetty.http2.generator.HeaderGenerator;
|
||||
import org.eclipse.jetty.http2.generator.WindowUpdateGenerator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
|
||||
public class WindowUpdateGenerateParseTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testGenerateParse() throws Exception
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.jetty.http2.generator.Generator;
|
|||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory;
|
||||
import org.eclipse.jetty.http2.server.RawHTTP2ServerConnectionFactory;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.server.ConnectionFactory;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
|
@ -68,7 +68,7 @@ public class AbstractServerTest
|
|||
connector = new ServerConnector(server, connectionFactory);
|
||||
server.addConnector(connector);
|
||||
path = "/test";
|
||||
bufferPool = new ArrayRetainableByteBufferPool();
|
||||
bufferPool = new ArrayByteBufferPool();
|
||||
generator = new Generator(bufferPool);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.eclipse.jetty.http2.api.server.ServerSessionListener;
|
|||
import org.eclipse.jetty.http2.frames.DataFrame;
|
||||
import org.eclipse.jetty.http2.frames.HeadersFrame;
|
||||
import org.eclipse.jetty.http2.generator.Generator;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.FuturePromise;
|
||||
|
@ -365,7 +365,7 @@ public class DataDemandTest extends AbstractTest
|
|||
// Generate a lot of small DATA frames and write them in a single
|
||||
// write so that the server will continuously be notified and demand,
|
||||
// which will test that it won't throw StackOverflowError.
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
Generator generator = new Generator(bufferPool);
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
for (int i = 512; i >= 0; --i)
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.eclipse.jetty.http2.frames.PrefaceFrame;
|
|||
import org.eclipse.jetty.http2.frames.SettingsFrame;
|
||||
import org.eclipse.jetty.http2.generator.Generator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
|
@ -150,7 +150,7 @@ public class HTTP2CServerTest extends AbstractServerTest
|
|||
|
||||
assertTrue(upgrade.toString().startsWith("HTTP/1.1 101 "));
|
||||
|
||||
bufferPool = new ArrayRetainableByteBufferPool();
|
||||
bufferPool = new ArrayByteBufferPool();
|
||||
generator = new Generator(bufferPool);
|
||||
|
||||
final AtomicReference<HeadersFrame> headersRef = new AtomicReference<>();
|
||||
|
@ -231,7 +231,7 @@ public class HTTP2CServerTest extends AbstractServerTest
|
|||
{
|
||||
final CountDownLatch latch = new CountDownLatch(3);
|
||||
|
||||
bufferPool = new ArrayRetainableByteBufferPool();
|
||||
bufferPool = new ArrayByteBufferPool();
|
||||
generator = new Generator(bufferPool);
|
||||
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
|
@ -328,7 +328,7 @@ public class HTTP2CServerTest extends AbstractServerTest
|
|||
// Now send an HTTP/2 direct request, which
|
||||
// will have the PRI * HTTP/2.0 preface.
|
||||
|
||||
bufferPool = new ArrayRetainableByteBufferPool();
|
||||
bufferPool = new ArrayByteBufferPool();
|
||||
generator = new Generator(bufferPool);
|
||||
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
|
|
|
@ -67,7 +67,7 @@ import org.eclipse.jetty.http2.generator.Generator;
|
|||
import org.eclipse.jetty.http2.hpack.HpackException;
|
||||
import org.eclipse.jetty.http2.parser.ServerParser;
|
||||
import org.eclipse.jetty.http2.server.RawHTTP2ServerConnectionFactory;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.ClientConnector;
|
||||
import org.eclipse.jetty.io.Content;
|
||||
|
@ -541,7 +541,7 @@ public class HttpClientTransportOverHTTP2Test extends AbstractTest
|
|||
resultLatch.countDown();
|
||||
});
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
ByteBufferPool.Accumulator accumulator = new ByteBufferPool.Accumulator();
|
||||
Generator generator = new Generator(bufferPool);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.eclipse.jetty.http2.frames.SettingsFrame;
|
|||
import org.eclipse.jetty.http2.generator.Generator;
|
||||
import org.eclipse.jetty.http2.parser.Parser;
|
||||
import org.eclipse.jetty.http2.server.HTTP2CServerConnectionFactory;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
|
@ -247,7 +247,7 @@ public class PrefaceTest extends AbstractTest
|
|||
});
|
||||
server.start();
|
||||
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
try (SocketChannel socket = SocketChannel.open())
|
||||
{
|
||||
socket.connect(new InetSocketAddress("localhost", connector.getLocalPort()));
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.eclipse.jetty.http3.qpack.internal.instruction.InsertCountIncrementIn
|
|||
import org.eclipse.jetty.http3.qpack.internal.instruction.LiteralNameEntryInstruction;
|
||||
import org.eclipse.jetty.http3.qpack.internal.instruction.SectionAcknowledgmentInstruction;
|
||||
import org.eclipse.jetty.http3.qpack.internal.instruction.SetCapacityInstruction;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
@ -56,7 +56,7 @@ public class BlockedStreamsTest
|
|||
{
|
||||
_encoderHandler = new TestEncoderHandler();
|
||||
_decoderHandler = new TestDecoderHandler();
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
_encoder = new QpackEncoder(bufferPool, _encoderHandler, MAX_BLOCKED_STREAMS);
|
||||
_decoder = new QpackDecoder(bufferPool, _decoderHandler, MAX_HEADER_SIZE);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.jetty.http3.qpack.internal.instruction.SectionAcknowledgmentI
|
|||
import org.eclipse.jetty.http3.qpack.internal.instruction.SetCapacityInstruction;
|
||||
import org.eclipse.jetty.http3.qpack.internal.parser.DecoderInstructionParser;
|
||||
import org.eclipse.jetty.http3.qpack.internal.parser.EncoderInstructionParser;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
@ -58,7 +58,7 @@ public class EncodeDecodeTest
|
|||
{
|
||||
_encoderHandler = new TestEncoderHandler();
|
||||
_decoderHandler = new TestDecoderHandler();
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
_encoder = new QpackEncoder(bufferPool, _encoderHandler, MAX_BLOCKED_STREAMS)
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.eclipse.jetty.http.HttpField;
|
|||
import org.eclipse.jetty.http.HttpFields;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.http.MetaData;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -42,7 +42,7 @@ public class EvictionTest
|
|||
@BeforeEach
|
||||
public void before()
|
||||
{
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
_decoder = new QpackDecoder(bufferPool, _decoderHandler, MAX_HEADER_SIZE);
|
||||
_encoder = new QpackEncoder(bufferPool, _encoderHandler, MAX_BLOCKED_STREAMS)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ package org.eclipse.jetty.http3.qpack;
|
|||
|
||||
import org.eclipse.jetty.http3.qpack.internal.instruction.IndexedNameEntryInstruction;
|
||||
import org.eclipse.jetty.http3.qpack.internal.instruction.SectionAcknowledgmentInstruction;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -26,7 +26,7 @@ import static org.hamcrest.Matchers.is;
|
|||
|
||||
public class InstructionGeneratorTest
|
||||
{
|
||||
private final ByteBufferPool _bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool _bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
private String toHexString(Instruction instruction)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.nio.ByteBuffer;
|
|||
|
||||
import org.eclipse.jetty.http3.qpack.QpackException.SessionException;
|
||||
import org.eclipse.jetty.http3.qpack.internal.instruction.SectionAcknowledgmentInstruction;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
@ -48,7 +48,7 @@ public class SectionAcknowledgmentTest
|
|||
{
|
||||
_encoderHandler = new TestEncoderHandler();
|
||||
_decoderHandler = new TestDecoderHandler();
|
||||
ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
_encoder = new QpackEncoder(bufferPool, _encoderHandler, MAX_BLOCKED_STREAMS);
|
||||
_decoder = new QpackDecoder(bufferPool, _decoderHandler, MAX_HEADER_SIZE);
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ import org.slf4j.LoggerFactory;
|
|||
* divided by 8.</p>
|
||||
*/
|
||||
@ManagedObject
|
||||
public class ArrayRetainableByteBufferPool implements ByteBufferPool, Dumpable
|
||||
public class ArrayByteBufferPool implements ByteBufferPool, Dumpable
|
||||
{
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ArrayRetainableByteBufferPool.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ArrayByteBufferPool.class);
|
||||
static final int DEFAULT_FACTOR = 4096;
|
||||
static final int DEFAULT_MAX_CAPACITY_BY_FACTOR = 16;
|
||||
|
||||
|
@ -60,29 +60,29 @@ public class ArrayRetainableByteBufferPool implements ByteBufferPool, Dumpable
|
|||
private final IntUnaryOperator _bucketIndexFor;
|
||||
|
||||
/**
|
||||
* Creates a new ArrayRetainableByteBufferPool with a default configuration.
|
||||
* Creates a new ArrayByteBufferPool with a default configuration.
|
||||
* Both {@code maxHeapMemory} and {@code maxDirectMemory} default to 0 to use default heuristic.
|
||||
*/
|
||||
public ArrayRetainableByteBufferPool()
|
||||
public ArrayByteBufferPool()
|
||||
{
|
||||
this(0, -1, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ArrayRetainableByteBufferPool with the given configuration.
|
||||
* Creates a new ArrayByteBufferPool with the given configuration.
|
||||
* Both {@code maxHeapMemory} and {@code maxDirectMemory} default to 0 to use default heuristic.
|
||||
*
|
||||
* @param minCapacity the minimum ByteBuffer capacity
|
||||
* @param factor the capacity factor
|
||||
* @param maxCapacity the maximum ByteBuffer capacity
|
||||
*/
|
||||
public ArrayRetainableByteBufferPool(int minCapacity, int factor, int maxCapacity)
|
||||
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity)
|
||||
{
|
||||
this(minCapacity, factor, maxCapacity, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ArrayRetainableByteBufferPool with the given configuration.
|
||||
* Creates a new ArrayByteBufferPool with the given configuration.
|
||||
* Both {@code maxHeapMemory} and {@code maxDirectMemory} default to 0 to use default heuristic.
|
||||
*
|
||||
* @param minCapacity the minimum ByteBuffer capacity
|
||||
|
@ -90,13 +90,13 @@ public class ArrayRetainableByteBufferPool implements ByteBufferPool, Dumpable
|
|||
* @param maxCapacity the maximum ByteBuffer capacity
|
||||
* @param maxBucketSize the maximum number of ByteBuffers for each bucket
|
||||
*/
|
||||
public ArrayRetainableByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize)
|
||||
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize)
|
||||
{
|
||||
this(minCapacity, factor, maxCapacity, maxBucketSize, 0L, 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ArrayRetainableByteBufferPool with the given configuration.
|
||||
* Creates a new ArrayByteBufferPool with the given configuration.
|
||||
*
|
||||
* @param minCapacity the minimum ByteBuffer capacity
|
||||
* @param factor the capacity factor
|
||||
|
@ -105,13 +105,13 @@ public class ArrayRetainableByteBufferPool implements ByteBufferPool, Dumpable
|
|||
* @param maxHeapMemory the max heap memory in bytes, -1 for unlimited memory or 0 to use default heuristic
|
||||
* @param maxDirectMemory the max direct memory in bytes, -1 for unlimited memory or 0 to use default heuristic
|
||||
*/
|
||||
public ArrayRetainableByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)
|
||||
public ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory)
|
||||
{
|
||||
this(minCapacity, factor, maxCapacity, maxBucketSize, maxHeapMemory, maxDirectMemory, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ArrayRetainableByteBufferPool with the given configuration.
|
||||
* Creates a new ArrayByteBufferPool with the given configuration.
|
||||
*
|
||||
* @param minCapacity the minimum ByteBuffer capacity
|
||||
* @param factor the capacity factor
|
||||
|
@ -122,7 +122,7 @@ public class ArrayRetainableByteBufferPool implements ByteBufferPool, Dumpable
|
|||
* @param bucketIndexFor a {@link IntUnaryOperator} that takes a capacity and returns a bucket index
|
||||
* @param bucketCapacity a {@link IntUnaryOperator} that takes a bucket index and returns a capacity
|
||||
*/
|
||||
protected ArrayRetainableByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory, IntUnaryOperator bucketIndexFor, IntUnaryOperator bucketCapacity)
|
||||
protected ArrayByteBufferPool(int minCapacity, int factor, int maxCapacity, int maxBucketSize, long maxHeapMemory, long maxDirectMemory, IntUnaryOperator bucketIndexFor, IntUnaryOperator bucketCapacity)
|
||||
{
|
||||
if (minCapacity <= 0)
|
||||
minCapacity = 0;
|
||||
|
@ -505,11 +505,11 @@ public class ArrayRetainableByteBufferPool implements ByteBufferPool, Dumpable
|
|||
}
|
||||
|
||||
/**
|
||||
* A variant of the {@link ArrayRetainableByteBufferPool} that
|
||||
* A variant of the {@link ArrayByteBufferPool} that
|
||||
* uses buckets of buffers that increase in size by a power of
|
||||
* 2 (eg 1k, 2k, 4k, 8k, etc.).
|
||||
*/
|
||||
public static class Quadratic extends ArrayRetainableByteBufferPool
|
||||
public static class Quadratic extends ArrayByteBufferPool
|
||||
{
|
||||
public Quadratic()
|
||||
{
|
|
@ -367,7 +367,7 @@ public class ClientConnector extends ContainerLifeCycle
|
|||
if (scheduler == null)
|
||||
setScheduler(new ScheduledExecutorScheduler(String.format("client-scheduler@%x", hashCode()), false));
|
||||
if (byteBufferPool == null)
|
||||
setByteBufferPool(new ArrayRetainableByteBufferPool());
|
||||
setByteBufferPool(new ArrayByteBufferPool());
|
||||
if (sslContextFactory == null)
|
||||
setSslContextFactory(newSslContextFactory());
|
||||
selectorManager = newSelectorManager();
|
||||
|
|
|
@ -108,7 +108,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
|
|||
private final List<SslHandshakeListener> handshakeListeners = new ArrayList<>();
|
||||
private final AtomicLong _bytesIn = new AtomicLong();
|
||||
private final AtomicLong _bytesOut = new AtomicLong();
|
||||
private final ByteBufferPool _retainableByteBufferPool;
|
||||
private final ByteBufferPool _bufferPool;
|
||||
private final SSLEngine _sslEngine;
|
||||
private final DecryptedEndPoint _decryptedEndPoint;
|
||||
private final boolean _encryptedDirectBuffers;
|
||||
|
@ -175,7 +175,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
|
|||
// This connection does not execute calls to onFillable(), so they will be called by the selector thread.
|
||||
// onFillable() does not block and will only wakeup another thread to do the actual reading and handling.
|
||||
super(endPoint, executor);
|
||||
this._retainableByteBufferPool = byteBufferPool;
|
||||
this._bufferPool = byteBufferPool;
|
||||
this._sslEngine = sslEngine;
|
||||
this._decryptedEndPoint = newDecryptedEndPoint();
|
||||
this._encryptedDirectBuffers = useDirectBuffersForEncryption;
|
||||
|
@ -310,14 +310,14 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
|
|||
private void acquireEncryptedInput()
|
||||
{
|
||||
if (_encryptedInput == null)
|
||||
_encryptedInput = _retainableByteBufferPool.acquire(getPacketBufferSize(), _encryptedDirectBuffers);
|
||||
_encryptedInput = _bufferPool.acquire(getPacketBufferSize(), _encryptedDirectBuffers);
|
||||
}
|
||||
|
||||
private void acquireEncryptedOutput()
|
||||
{
|
||||
// TODO: before the output was done with the BBP only.
|
||||
if (_encryptedOutput == null)
|
||||
_encryptedOutput = _retainableByteBufferPool.acquire(getPacketBufferSize(), _encryptedDirectBuffers);
|
||||
_encryptedOutput = _bufferPool.acquire(getPacketBufferSize(), _encryptedDirectBuffers);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -682,7 +682,7 @@ public class SslConnection extends AbstractConnection implements Connection.Upgr
|
|||
}
|
||||
else
|
||||
{
|
||||
_decryptedInput = _retainableByteBufferPool.acquire(appBufferSize, _decryptedDirectBuffers);
|
||||
_decryptedInput = _bufferPool.acquire(appBufferSize, _decryptedDirectBuffers);
|
||||
appIn = _decryptedInput.getByteBuffer();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,12 +31,12 @@ import static org.hamcrest.Matchers.sameInstance;
|
|||
import static org.hamcrest.core.Is.is;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
public class ArrayRetainableByteBufferPoolTest
|
||||
public class ArrayByteBufferPoolTest
|
||||
{
|
||||
@Test
|
||||
public void testMaxMemoryEviction()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(0, 10, 20, Integer.MAX_VALUE, 40, 40);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(0, 10, 20, Integer.MAX_VALUE, 40, 40);
|
||||
|
||||
List<RetainableByteBuffer> buffers = new ArrayList<>();
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testBelowMinCapacityDoesNotPool()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
|
||||
RetainableByteBuffer buf1 = pool.acquire(1, true);
|
||||
assertThat(buf1.capacity(), is(1));
|
||||
|
@ -89,7 +89,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testOverMaxCapacityDoesNotPool()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
|
||||
RetainableByteBuffer buf1 = pool.acquire(21, true);
|
||||
assertThat(buf1.capacity(), is(21));
|
||||
|
@ -104,7 +104,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testRetain()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
|
||||
RetainableByteBuffer buf1 = pool.acquire(10, true);
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testTooManyReleases()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
|
||||
RetainableByteBuffer buf1 = pool.acquire(10, true);
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testMaxBucketSize()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(0, 10, 20, 2);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(0, 10, 20, 2);
|
||||
|
||||
RetainableByteBuffer buf1 = pool.acquire(1, true); // pooled
|
||||
assertThat(buf1.capacity(), is(10));
|
||||
|
@ -192,7 +192,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testBufferReleaseRepools()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(0, 10, 20, 1);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(0, 10, 20, 1);
|
||||
|
||||
List<RetainableByteBuffer> all = new ArrayList<>();
|
||||
|
||||
|
@ -217,7 +217,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testFactorAndCapacity()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool(10, 10, 20, Integer.MAX_VALUE);
|
||||
|
||||
pool.acquire(1, true); // not pooled, < minCapacity
|
||||
pool.acquire(10, true); // pooled
|
||||
|
@ -233,13 +233,13 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testClearUnlinksLeakedBuffers()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool();
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool();
|
||||
|
||||
pool.acquire(10, true);
|
||||
pool.acquire(10, true);
|
||||
|
||||
assertThat(pool.getDirectByteBufferCount(), is(2L));
|
||||
assertThat(pool.getDirectMemory(), is(2L * ArrayRetainableByteBufferPool.DEFAULT_FACTOR));
|
||||
assertThat(pool.getDirectMemory(), is(2L * ArrayByteBufferPool.DEFAULT_FACTOR));
|
||||
assertThat(pool.getAvailableDirectByteBufferCount(), is(0L));
|
||||
assertThat(pool.getAvailableDirectMemory(), is(0L));
|
||||
|
||||
|
@ -254,7 +254,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testRetainAfterRePooledThrows()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool();
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool();
|
||||
RetainableByteBuffer buf1 = pool.acquire(10, true);
|
||||
assertThat(pool.getDirectByteBufferCount(), is(1L));
|
||||
assertThat(pool.getAvailableDirectByteBufferCount(), is(0L));
|
||||
|
@ -277,22 +277,22 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testAcquireRelease()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool();
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool();
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
RetainableByteBuffer buf1 = pool.acquire(10, true);
|
||||
assertThat(buf1, is(notNullValue()));
|
||||
assertThat(buf1.capacity(), is(ArrayRetainableByteBufferPool.DEFAULT_FACTOR));
|
||||
assertThat(buf1.capacity(), is(ArrayByteBufferPool.DEFAULT_FACTOR));
|
||||
RetainableByteBuffer buf2 = pool.acquire(10, true);
|
||||
assertThat(buf2, is(notNullValue()));
|
||||
assertThat(buf2.capacity(), is(ArrayRetainableByteBufferPool.DEFAULT_FACTOR));
|
||||
assertThat(buf2.capacity(), is(ArrayByteBufferPool.DEFAULT_FACTOR));
|
||||
buf1.release();
|
||||
buf2.release();
|
||||
|
||||
RetainableByteBuffer buf3 = pool.acquire(16384 + 1, true);
|
||||
assertThat(buf3, is(notNullValue()));
|
||||
assertThat(buf3.capacity(), is(16384 + ArrayRetainableByteBufferPool.DEFAULT_FACTOR));
|
||||
assertThat(buf3.capacity(), is(16384 + ArrayByteBufferPool.DEFAULT_FACTOR));
|
||||
buf3.release();
|
||||
|
||||
RetainableByteBuffer buf4 = pool.acquire(32768, true);
|
||||
|
@ -308,7 +308,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
|
||||
assertThat(pool.getDirectByteBufferCount(), is(4L));
|
||||
assertThat(pool.getHeapByteBufferCount(), is(1L));
|
||||
assertThat(pool.getDirectMemory(), is(ArrayRetainableByteBufferPool.DEFAULT_FACTOR * 3L + 16384 + 32768L));
|
||||
assertThat(pool.getDirectMemory(), is(ArrayByteBufferPool.DEFAULT_FACTOR * 3L + 16384 + 32768L));
|
||||
assertThat(pool.getHeapMemory(), is(32768L));
|
||||
|
||||
pool.clear();
|
||||
|
@ -322,7 +322,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testQuadraticPool()
|
||||
{
|
||||
ArrayRetainableByteBufferPool pool = new ArrayRetainableByteBufferPool.Quadratic();
|
||||
ArrayByteBufferPool pool = new ArrayByteBufferPool.Quadratic();
|
||||
|
||||
RetainableByteBuffer retain5 = pool.acquire(5, false);
|
||||
retain5.release();
|
||||
|
@ -365,7 +365,7 @@ public class ArrayRetainableByteBufferPoolTest
|
|||
@Test
|
||||
public void testEndiannessResetOnRelease()
|
||||
{
|
||||
ArrayRetainableByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
ArrayByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
RetainableByteBuffer buffer = bufferPool.acquire(10, true);
|
||||
assertThat(buffer.getByteBuffer().order(), Matchers.is(ByteOrder.BIG_ENDIAN));
|
||||
buffer.getByteBuffer().order(ByteOrder.LITTLE_ENDIAN);
|
|
@ -298,7 +298,7 @@ public class ByteBufferAccumulatorTest
|
|||
|
||||
public CountingBufferPool()
|
||||
{
|
||||
super(new ArrayRetainableByteBufferPool());
|
||||
super(new ArrayByteBufferPool());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -616,7 +616,7 @@ public class SocketChannelEndPointTest
|
|||
{
|
||||
private final NormalScenario _normalScenario;
|
||||
private final SslContextFactory _sslCtxFactory = new SslContextFactory.Server();
|
||||
private final ByteBufferPool _bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool _bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
public SslScenario(NormalScenario normalScenario) throws Exception
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ public class SslConnectionTest
|
|||
private static final int TIMEOUT = 1000000;
|
||||
|
||||
// TODO: track leaks
|
||||
private final ByteBufferPool _bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool _bufferPool = new ArrayByteBufferPool();
|
||||
private final SslContextFactory _sslCtxFactory = new SslContextFactory.Server();
|
||||
protected volatile EndPoint _lastEndp;
|
||||
private volatile boolean _testFill = true;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
<Configure>
|
||||
<New id="byteBufferPool" class="org.eclipse.jetty.io.ArrayRetainableByteBufferPool.Quadratic">
|
||||
<New id="byteBufferPool" class="org.eclipse.jetty.io.ArrayByteBufferPool.Quadratic">
|
||||
<Arg type="int"><Property name="jetty.byteBufferPool.minCapacity" default="0"/></Arg>
|
||||
<Arg type="int"><Property name="jetty.byteBufferPool.maxCapacity" default="65536"/></Arg>
|
||||
<Arg type="int"><Property name="jetty.byteBufferPool.maxBucketSize" default="-1"/></Arg>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
|
||||
<Configure>
|
||||
<New id="byteBufferPool" class="org.eclipse.jetty.io.ArrayRetainableByteBufferPool">
|
||||
<New id="byteBufferPool" class="org.eclipse.jetty.io.ArrayByteBufferPool">
|
||||
<Arg type="int"><Property name="jetty.byteBufferPool.minCapacity" default="0"/></Arg>
|
||||
<Arg type="int"><Property name="jetty.byteBufferPool.factor" default="4096"/></Arg>
|
||||
<Arg type="int"><Property name="jetty.byteBufferPool.maxCapacity" default="65536"/></Arg>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[description]
|
||||
Configures the RetainableByteBufferPool used by ServerConnectors.
|
||||
Configures the ByteBufferPool used by ServerConnectors.
|
||||
The bucket sizes increase quadratically instead of linearly.
|
||||
|
||||
[tags]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[description]
|
||||
Configures the RetainableByteBufferPool used by ServerConnectors.
|
||||
Configures the ByteBufferPool used by ServerConnectors.
|
||||
The bucket sizes increase linearly.
|
||||
Use module "bytebufferpool-quadratic" for a pool that holds more coarse sized buffers.
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.concurrent.Executor;
|
|||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
|
@ -66,7 +66,7 @@ import org.slf4j.LoggerFactory;
|
|||
* {@link ScheduledExecutorScheduler} instance.
|
||||
* </li>
|
||||
* <li>The {@link ByteBufferPool} service is made available to all connections to be used to acquire and release
|
||||
* {@link RetainableByteBuffer} instances from a pool. The default is to use a new {@link ArrayRetainableByteBufferPool}
|
||||
* {@link RetainableByteBuffer} instances from a pool. The default is to use a new {@link ArrayByteBufferPool}
|
||||
* instance.
|
||||
* </li>
|
||||
* </ul>
|
||||
|
@ -145,7 +145,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co
|
|||
private final Server _server;
|
||||
private final Executor _executor;
|
||||
private final Scheduler _scheduler;
|
||||
private final ByteBufferPool _retainableByteBufferPool;
|
||||
private final ByteBufferPool _bufferPool;
|
||||
private final Thread[] _acceptors;
|
||||
private final Set<EndPoint> _endpoints = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||
private final Set<EndPoint> _immutableEndPoints = Collections.unmodifiableSet(_endpoints);
|
||||
|
@ -185,8 +185,8 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co
|
|||
_scheduler = scheduler != null ? scheduler : _server.getScheduler();
|
||||
addBean(_scheduler, scheduler != null);
|
||||
|
||||
_retainableByteBufferPool = bufferPool != null ? bufferPool : server.getByteBufferPool();
|
||||
addBean(_retainableByteBufferPool, bufferPool != null);
|
||||
_bufferPool = bufferPool != null ? bufferPool : server.getByteBufferPool();
|
||||
addBean(_bufferPool, bufferPool != null);
|
||||
|
||||
for (ConnectionFactory factory : factories)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co
|
|||
@Override
|
||||
public ByteBufferPool getByteBufferPool()
|
||||
{
|
||||
return _retainableByteBufferPool;
|
||||
return _bufferPool;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.eclipse.jetty.http.HttpGenerator;
|
|||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.MimeTypes;
|
||||
import org.eclipse.jetty.http.PreEncodedHttpField;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
|
@ -142,7 +142,7 @@ public class Server extends Handler.BaseWrapper implements Attributes
|
|||
addBean(_threadPool);
|
||||
_scheduler = scheduler != null ? scheduler : new ScheduledExecutorScheduler();
|
||||
addBean(_scheduler);
|
||||
_bufferPool = bufferPool != null ? bufferPool : new ArrayRetainableByteBufferPool();
|
||||
_bufferPool = bufferPool != null ? bufferPool : new ArrayByteBufferPool();
|
||||
addBean(_bufferPool);
|
||||
setServer(this);
|
||||
addBean(FileSystemPool.INSTANCE, false);
|
||||
|
|
|
@ -95,7 +95,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Writ
|
|||
private final RequestHandler _requestHandler;
|
||||
private final HttpParser _parser;
|
||||
private final HttpGenerator _generator;
|
||||
private final ByteBufferPool _retainableByteBufferPool;
|
||||
private final ByteBufferPool _bufferPool;
|
||||
private final AtomicReference<HttpStreamOverHTTP1> _stream = new AtomicReference<>();
|
||||
private final Lazy _attributes = new Lazy();
|
||||
private final DemandContentCallback _demandContentCallback = new DemandContentCallback();
|
||||
|
@ -139,7 +139,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Writ
|
|||
_id = __connectionIdGenerator.getAndIncrement();
|
||||
_configuration = configuration;
|
||||
_connector = connector;
|
||||
_retainableByteBufferPool = _connector.getByteBufferPool();
|
||||
_bufferPool = _connector.getByteBufferPool();
|
||||
_generator = newHttpGenerator();
|
||||
_httpChannel = newHttpChannel(connector.getServer(), configuration);
|
||||
_requestHandler = newRequestHandler();
|
||||
|
@ -401,7 +401,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Writ
|
|||
private ByteBuffer getRequestBuffer()
|
||||
{
|
||||
if (_retainableByteBuffer == null)
|
||||
_retainableByteBuffer = _retainableByteBufferPool.acquire(getInputBufferSize(), isUseInputDirectByteBuffers());
|
||||
_retainableByteBuffer = _bufferPool.acquire(getInputBufferSize(), isUseInputDirectByteBuffers());
|
||||
return _retainableByteBuffer.getByteBuffer();
|
||||
}
|
||||
|
||||
|
@ -547,7 +547,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Writ
|
|||
if (_retainableByteBuffer != null && _retainableByteBuffer.isRetained())
|
||||
{
|
||||
// TODO this is almost certainly wrong
|
||||
RetainableByteBuffer newBuffer = _retainableByteBufferPool.acquire(getInputBufferSize(), isUseInputDirectByteBuffers());
|
||||
RetainableByteBuffer newBuffer = _bufferPool.acquire(getInputBufferSize(), isUseInputDirectByteBuffers());
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("replace buffer {} <- {} in {}", _retainableByteBuffer, newBuffer, this);
|
||||
_retainableByteBuffer.release();
|
||||
|
@ -796,7 +796,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Writ
|
|||
|
||||
case NEED_HEADER:
|
||||
{
|
||||
_header = _retainableByteBufferPool.acquire(Math.min(_configuration.getResponseHeaderSize(), _configuration.getOutputBufferSize()), useDirectByteBuffers);
|
||||
_header = _bufferPool.acquire(Math.min(_configuration.getResponseHeaderSize(), _configuration.getOutputBufferSize()), useDirectByteBuffers);
|
||||
continue;
|
||||
}
|
||||
case HEADER_OVERFLOW:
|
||||
|
@ -804,18 +804,18 @@ public class HttpConnection extends AbstractConnection implements Runnable, Writ
|
|||
if (_header.capacity() >= _configuration.getResponseHeaderSize())
|
||||
throw new BadMessageException(INTERNAL_SERVER_ERROR_500, "Response header too large");
|
||||
releaseHeader();
|
||||
_header = _retainableByteBufferPool.acquire(_configuration.getResponseHeaderSize(), useDirectByteBuffers);
|
||||
_header = _bufferPool.acquire(_configuration.getResponseHeaderSize(), useDirectByteBuffers);
|
||||
continue;
|
||||
}
|
||||
case NEED_CHUNK:
|
||||
{
|
||||
_chunk = _retainableByteBufferPool.acquire(HttpGenerator.CHUNK_SIZE, useDirectByteBuffers);
|
||||
_chunk = _bufferPool.acquire(HttpGenerator.CHUNK_SIZE, useDirectByteBuffers);
|
||||
continue;
|
||||
}
|
||||
case NEED_CHUNK_TRAILER:
|
||||
{
|
||||
releaseChunk();
|
||||
_chunk = _retainableByteBufferPool.acquire(_configuration.getResponseHeaderSize(), useDirectByteBuffers);
|
||||
_chunk = _bufferPool.acquire(_configuration.getResponseHeaderSize(), useDirectByteBuffers);
|
||||
continue;
|
||||
}
|
||||
case FLUSH:
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Set;
|
|||
|
||||
import org.eclipse.jetty.http.HttpTester;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.logging.StacklessLogging;
|
||||
import org.eclipse.jetty.server.internal.HttpChannelState;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractHttpTest
|
|||
public void setUp() throws Exception
|
||||
{
|
||||
server = new Server();
|
||||
connector = new ServerConnector(server, null, null, new ArrayRetainableByteBufferPool(64, 2048, 64 * 1024), 1, 1, new HttpConnectionFactory());
|
||||
connector = new ServerConnector(server, null, null, new ArrayByteBufferPool(64, 2048, 64 * 1024), 1, 1, new HttpConnectionFactory());
|
||||
connector.setIdleTimeout(100000);
|
||||
|
||||
server.addConnector(connector);
|
||||
|
|
|
@ -31,7 +31,7 @@ import javax.net.ssl.SSLSocketFactory;
|
|||
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.io.AbstractConnection;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
|
@ -117,7 +117,7 @@ public class DetectorConnectionTest
|
|||
|
||||
private void start(ConnectionFactory... connectionFactories) throws Exception
|
||||
{
|
||||
_server = new Server(null, null, new ArrayRetainableByteBufferPool()
|
||||
_server = new Server(null, null, new ArrayByteBufferPool()
|
||||
{
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.awaitility.Awaitility;
|
|||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpTester;
|
||||
import org.eclipse.jetty.io.AbstractConnection;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.Content;
|
||||
|
@ -1767,7 +1767,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
|
|||
assertThat(total, equalTo(chunk.length * 4L));
|
||||
|
||||
ByteBufferPool rbbp = _connector.getByteBufferPool();
|
||||
if (rbbp instanceof ArrayRetainableByteBufferPool pool)
|
||||
if (rbbp instanceof ArrayByteBufferPool pool)
|
||||
{
|
||||
long buffersBeforeRelease = pool.getAvailableDirectByteBufferCount() + pool.getAvailableHeapByteBufferCount();
|
||||
contents.forEach(Content.Chunk::release);
|
||||
|
@ -1777,7 +1777,7 @@ public abstract class HttpServerTestBase extends HttpServerTestFixture
|
|||
}
|
||||
else
|
||||
{
|
||||
assertThat(rbbp, instanceOf(ArrayRetainableByteBufferPool.class));
|
||||
assertThat(rbbp, instanceOf(ArrayByteBufferPool.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.stream.Stream;
|
|||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
|
@ -85,7 +85,7 @@ public class ThreadStarvationTest
|
|||
sslContextFactory.setKeyStorePassword("storepwd");
|
||||
// TODO: restore leak tracking.
|
||||
// ByteBufferPool pool = new LeakTrackingByteBufferPool(new MappedByteBufferPool.Tagged());
|
||||
ByteBufferPool pool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool pool = new ArrayByteBufferPool();
|
||||
|
||||
HttpConnectionFactory httpConnectionFactory = new HttpConnectionFactory();
|
||||
ServerConnector connector = new ServerConnector(server, null, null, pool, acceptors, selectors,
|
||||
|
|
|
@ -26,7 +26,7 @@ import javax.net.ssl.HttpsURLConnection;
|
|||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.server.AbstractConnectionFactory;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
|
@ -72,7 +72,7 @@ public class DebugHandlerTest
|
|||
sslContextFactory.setKeyStorePassword("storepwd");
|
||||
// TODO: restore leak tracking.
|
||||
// ByteBufferPool pool = new LeakTrackingByteBufferPool(new MappedByteBufferPool.Tagged());
|
||||
ByteBufferPool pool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool pool = new ArrayByteBufferPool();
|
||||
ServerConnector sslConnector = new ServerConnector(server, null, null, pool, 1, 1,
|
||||
AbstractConnectionFactory.getFactories(sslContextFactory, new HttpConnectionFactory()));
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.net.ssl.SSLContext;
|
|||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.Content;
|
||||
import org.eclipse.jetty.server.AbstractConnectionFactory;
|
||||
|
@ -75,7 +75,7 @@ public class ServerConnectorSslServerTest extends HttpServerTestBase
|
|||
sslContextFactory.setKeyStorePassword("storepwd");
|
||||
// TODO: restore leak tracking.
|
||||
// ByteBufferPool pool = new LeakTrackingByteBufferPool(new MappedByteBufferPool.Tagged());
|
||||
ByteBufferPool pool = new ArrayRetainableByteBufferPool();
|
||||
ByteBufferPool pool = new ArrayByteBufferPool();
|
||||
|
||||
HttpConnectionFactory httpConnectionFactory = new HttpConnectionFactory();
|
||||
ServerConnector connector = new ServerConnector(_server, null, null, pool, 1, 1, AbstractConnectionFactory.getFactories(sslContextFactory, httpConnectionFactory));
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.eclipse.jetty.http3.client.transport.HttpClientTransportOverHTTP3;
|
|||
import org.eclipse.jetty.http3.server.AbstractHTTP3ServerConnectionFactory;
|
||||
import org.eclipse.jetty.http3.server.HTTP3ServerConnectionFactory;
|
||||
import org.eclipse.jetty.http3.server.HTTP3ServerConnector;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ClientConnector;
|
||||
import org.eclipse.jetty.quic.server.QuicServerConnector;
|
||||
import org.eclipse.jetty.server.AbstractConnector;
|
||||
|
@ -140,7 +140,7 @@ public class AbstractTest
|
|||
QueuedThreadPool serverThreads = new QueuedThreadPool();
|
||||
serverThreads.setName("server");
|
||||
// TODO: restore leak tracking.
|
||||
return new Server(serverThreads, null, new ArrayRetainableByteBufferPool());
|
||||
return new Server(serverThreads, null, new ArrayByteBufferPool());
|
||||
}
|
||||
|
||||
protected SslContextFactory.Server newSslContextFactoryServer()
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.eclipse.jetty.client.Result;
|
|||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpHeaderValue;
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.Content;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
|
@ -140,7 +140,7 @@ public class HttpClientDemandTest extends AbstractTest
|
|||
});
|
||||
startClient(transport);
|
||||
client.stop();
|
||||
client.setByteBufferPool(new ArrayRetainableByteBufferPool(0, bufferSize, -1));
|
||||
client.setByteBufferPool(new ArrayByteBufferPool(0, bufferSize, -1));
|
||||
client.setResponseBufferSize(bufferSize);
|
||||
client.start();
|
||||
|
||||
|
@ -322,7 +322,7 @@ public class HttpClientDemandTest extends AbstractTest
|
|||
});
|
||||
startClient(transport);
|
||||
client.stop();
|
||||
client.setByteBufferPool(new ArrayRetainableByteBufferPool(0, bufferSize, -1));
|
||||
client.setByteBufferPool(new ArrayByteBufferPool(0, bufferSize, -1));
|
||||
client.setResponseBufferSize(bufferSize);
|
||||
client.start();
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.jetty.client.Result;
|
|||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpHeaderValue;
|
||||
import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.Content;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.NetworkConnector;
|
||||
|
@ -68,7 +68,7 @@ public class HttpClientLoadTest extends AbstractTest
|
|||
setStreamIdleTimeout(120000);
|
||||
client.stop();
|
||||
// TODO: restore leak tracking.
|
||||
client.setByteBufferPool(new ArrayRetainableByteBufferPool());
|
||||
client.setByteBufferPool(new ArrayByteBufferPool());
|
||||
client.setMaxConnectionsPerDestination(32768);
|
||||
client.setMaxRequestsQueuedPerDestination(1024 * 1024);
|
||||
client.setIdleTimeout(120000);
|
||||
|
@ -118,7 +118,7 @@ public class HttpClientLoadTest extends AbstractTest
|
|||
start(transport, new LoadHandler());
|
||||
client.stop();
|
||||
// TODO: restore leak tracking.
|
||||
client.setByteBufferPool(new ArrayRetainableByteBufferPool());
|
||||
client.setByteBufferPool(new ArrayByteBufferPool());
|
||||
client.setMaxConnectionsPerDestination(32768);
|
||||
client.setMaxRequestsQueuedPerDestination(1024 * 1024);
|
||||
client.start();
|
||||
|
|
|
@ -16,7 +16,7 @@ package org.eclipse.jetty.websocket.core;
|
|||
import java.util.concurrent.Executor;
|
||||
import java.util.zip.Deflater;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.DecoratedObjectFactory;
|
||||
import org.eclipse.jetty.util.component.ContainerLifeCycle;
|
||||
|
@ -54,7 +54,7 @@ public class WebSocketComponents extends ContainerLifeCycle
|
|||
{
|
||||
_extensionRegistry = (extensionRegistry == null) ? new WebSocketExtensionRegistry() : extensionRegistry;
|
||||
_objectFactory = (objectFactory == null) ? new DecoratedObjectFactory() : objectFactory;
|
||||
_bufferPool = (bufferPool == null) ? new ArrayRetainableByteBufferPool() : bufferPool;
|
||||
_bufferPool = (bufferPool == null) ? new ArrayByteBufferPool() : bufferPool;
|
||||
_inflaterPool = (inflaterPool == null) ? new InflaterPool(CompressionPool.DEFAULT_CAPACITY, true) : inflaterPool;
|
||||
_deflaterPool = (deflaterPool == null) ? new DeflaterPool(CompressionPool.DEFAULT_CAPACITY, Deflater.DEFAULT_COMPRESSION, true) : deflaterPool;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.nio.ByteBuffer;
|
|||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
|
@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
|
||||
public class GeneratorParserRoundTripTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testParserAndGenerator() throws Exception
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
|
@ -61,7 +61,7 @@ public class MessageHandlerTest
|
|||
|
||||
coreSession = new CoreSession.Empty()
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Override
|
||||
public void sendFrame(Frame frame, Callback callback, boolean batch)
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Base64;
|
|||
|
||||
import org.eclipse.jetty.http.HttpFields;
|
||||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
|
@ -63,7 +63,7 @@ public class WebSocketTester
|
|||
@BeforeEach
|
||||
public void before()
|
||||
{
|
||||
bufferPool = new ArrayRetainableByteBufferPool();
|
||||
bufferPool = new ArrayByteBufferPool();
|
||||
parser = new Parser(bufferPool);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.toolchain.test.ByteBufferAssert;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.FutureCallback;
|
||||
|
@ -62,7 +62,7 @@ public class ExtensionTool
|
|||
assertThat(extensionStack.getExtensions().size(), equalTo(1));
|
||||
|
||||
this.capture = new IncomingFramesCapture();
|
||||
this.parser = new Parser(new ArrayRetainableByteBufferPool());
|
||||
this.parser = new Parser(new ArrayByteBufferPool());
|
||||
}
|
||||
|
||||
public String getRequestedExtParams()
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.FutureCallback;
|
||||
|
@ -52,7 +52,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
|
||||
public class FrameFlusherTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
private Scheduler scheduler;
|
||||
|
||||
@BeforeEach
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.concurrent.BlockingQueue;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.Utf8StringBuilder;
|
||||
|
@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
|||
public class MessageWriterTest
|
||||
{
|
||||
private final CoreSession coreSession = new CoreSession.Empty();
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testMultipleWrites() throws Exception
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.concurrent.BlockingQueue;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.Utf8StringBuilder;
|
||||
|
@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.is;
|
|||
|
||||
public class MessageWriterTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testSingleByteArray512b() throws IOException, InterruptedException
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketSessionLi
|
|||
import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.server.internal.JakartaWebSocketServerContainer;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
|
@ -60,7 +60,7 @@ public class LocalServer extends ContainerLifeCycle implements LocalFuzzer.Provi
|
|||
}
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(LocalServer.class);
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
private Server server;
|
||||
private ServerConnector connector;
|
||||
private LocalConnector localConnector;
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.Arrays;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
|
@ -46,7 +46,7 @@ public class MessageOutputStreamTest
|
|||
@BeforeEach
|
||||
public void setupTest() throws Exception
|
||||
{
|
||||
bufferPool = new ArrayRetainableByteBufferPool()
|
||||
bufferPool = new ArrayByteBufferPool()
|
||||
{
|
||||
@Override
|
||||
public RetainableByteBuffer acquire(int size, boolean direct)
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Set;
|
|||
|
||||
import org.eclipse.jetty.http.HttpTester;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.logging.StacklessLogging;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||
|
@ -51,7 +51,7 @@ public abstract class AbstractHttpTest
|
|||
public void setUp() throws Exception
|
||||
{
|
||||
server = new Server();
|
||||
connector = new ServerConnector(server, null, null, new ArrayRetainableByteBufferPool(64, 2048, 64 * 1024), 1, 1, new HttpConnectionFactory());
|
||||
connector = new ServerConnector(server, null, null, new ArrayByteBufferPool(64, 2048, 64 * 1024), 1, 1, new HttpConnectionFactory());
|
||||
connector.setIdleTimeout(100000);
|
||||
|
||||
server.addConnector(connector);
|
||||
|
|
|
@ -19,7 +19,7 @@ import java.util.concurrent.BlockingQueue;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.Utf8StringBuilder;
|
||||
|
@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.is;
|
|||
|
||||
public class MessageWriterTest
|
||||
{
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
|
||||
@Test
|
||||
public void testSingleByteArray512b() throws IOException, InterruptedException
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.eclipse.jetty.ee9.websocket.jakarta.common.JakartaWebSocketSessionLis
|
|||
import org.eclipse.jetty.ee9.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.ee9.websocket.jakarta.server.internal.JakartaWebSocketServerContainer;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
|
@ -60,7 +60,7 @@ public class LocalServer extends ContainerLifeCycle implements LocalFuzzer.Provi
|
|||
}
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(LocalServer.class);
|
||||
private final ByteBufferPool bufferPool = new ArrayRetainableByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new ArrayByteBufferPool();
|
||||
private Server server;
|
||||
private ServerConnector connector;
|
||||
private LocalConnector localConnector;
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.Arrays;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.eclipse.jetty.io.ArrayRetainableByteBufferPool;
|
||||
import org.eclipse.jetty.io.ArrayByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
|
@ -46,7 +46,7 @@ public class MessageOutputStreamTest
|
|||
@BeforeEach
|
||||
public void beforeEach()
|
||||
{
|
||||
bufferPool = new ArrayRetainableByteBufferPool()
|
||||
bufferPool = new ArrayByteBufferPool()
|
||||
{
|
||||
@Override
|
||||
public RetainableByteBuffer acquire(int size, boolean direct)
|
||||
|
|
Loading…
Reference in New Issue