From 4125a42bfcdc56966ccb6e0b90ce4a3f53af17e4 Mon Sep 17 00:00:00 2001 From: "igor.petrenko" Date: Tue, 24 Mar 2026 07:45:34 +0200 Subject: [PATCH 1/3] pnio: PnioHttpHandler#requestSize, PnioHttpHandler#responseSize: rm final --- .../src/main/java/oap/http/pniov3/PnioHttpHandler.java | 7 ++----- pom.xml | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java b/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java index 613b103a0..4a49cb495 100644 --- a/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java +++ b/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java @@ -22,9 +22,8 @@ public class PnioHttpHandler implements PnioHttpHandlerReference { public final String uniqueName; - public final int requestSize; - public final int responseSize; - public final int ioQueueSize; + public int requestSize; + public int responseSize; public final boolean important; public final PnioListener pnioListener; public final ConcurrentHashMap> exchanges = new ConcurrentHashMap<>(); @@ -40,7 +39,6 @@ public PnioHttpHandler( String uniqueName, this.uniqueName = uniqueName; this.requestSize = settings.requestSize; this.responseSize = settings.responseSize; - this.ioQueueSize = settings.ioQueueSize; this.important = settings.important; this.task = task; @@ -113,7 +111,6 @@ public PnioHttpHandler getPnioHttpHandler() { public static class PnioHttpSettings { int requestSize; int responseSize; - int ioQueueSize; boolean important; } } diff --git a/pom.xml b/pom.xml index 380b7af61..f495da37d 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ - 25.4.8 + 25.4.9 25.0.1 25.0.0 From 90edc37fda8b3279b6247135e14f4b3b9a411fb2 Mon Sep 17 00:00:00 2001 From: "igor.petrenko" Date: Tue, 24 Mar 2026 08:03:26 +0200 Subject: [PATCH 2/3] pnio: PnioHttpHandler#requestSize, PnioHttpHandler#responseSize: rm final --- .../java/oap/http/pniov3/PnioHttpHandler.java | 22 +++---------------- .../java/oap/http/pniov3/PerformanceTest.java | 6 +---- .../oap/http/pniov3/PnioHttpHandlerTest.java | 8 +++---- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java b/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java index 4a49cb495..886a23687 100644 --- a/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java +++ b/oap-http/oap-pnio-v3/src/main/java/oap/http/pniov3/PnioHttpHandler.java @@ -9,10 +9,8 @@ package oap.http.pniov3; -import com.google.common.base.Preconditions; import io.undertow.io.Receiver; import io.undertow.util.SameThreadExecutor; -import lombok.Builder; import lombok.extern.slf4j.Slf4j; import oap.http.server.nio.HttpServerExchange; @@ -21,33 +19,26 @@ @Slf4j public class PnioHttpHandler implements PnioHttpHandlerReference { public final String uniqueName; - - public int requestSize; - public int responseSize; - public final boolean important; public final PnioListener pnioListener; public final ConcurrentHashMap> exchanges = new ConcurrentHashMap<>(); private final PnioController pnioController; private final PnioMetrics metrics; + public int requestSize = 64 * 1024; + public int responseSize = 32 * 1024; + public boolean important = false; public ComputeTask task; public PnioHttpHandler( String uniqueName, - PnioHttpSettings settings, ComputeTask task, PnioListener pnioListener, PnioController pnioController ) { this.uniqueName = uniqueName; - this.requestSize = settings.requestSize; - this.responseSize = settings.responseSize; - this.important = settings.important; this.task = task; this.pnioListener = pnioListener; this.pnioController = pnioController; this.metrics = new PnioMetrics( uniqueName ); - - Preconditions.checkArgument( settings.responseSize > 0, "responseSize must be greater than 0" ); } public void handleRequest( HttpServerExchange oapExchange, long timeout, RequestState requestState ) { @@ -106,11 +97,4 @@ public void handleRequest( HttpServerExchange oapExchange, long timeout, Request public PnioHttpHandler getPnioHttpHandler() { return this; } - - @Builder - public static class PnioHttpSettings { - int requestSize; - int responseSize; - boolean important; - } } diff --git a/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PerformanceTest.java b/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PerformanceTest.java index efdbce204..7ab67a891 100644 --- a/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PerformanceTest.java +++ b/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PerformanceTest.java @@ -32,17 +32,13 @@ public void test() throws IOException { int port = 12345; - PnioHttpHandler.PnioHttpSettings settings = PnioHttpHandler.PnioHttpSettings.builder() - .requestSize( 64000 ) - .responseSize( 64000 ) - .build(); try( PnioController pnioController = new PnioController( 10, 10000 ); NioHttpServer httpServer = new NioHttpServer( new NioHttpServer.DefaultPort( port ) ) ) { httpServer.ioThreads = 2; httpServer.statistics = true; httpServer.start(); - PnioHttpHandler httpHandler = new PnioHttpHandler<>( "perf", settings, new TestHandler(), new PnioHttpHandlerTest.TestPnioListener(), pnioController ); + PnioHttpHandler httpHandler = new PnioHttpHandler<>( "perf", new TestHandler(), new PnioHttpHandlerTest.TestPnioListener(), pnioController ); Scheduler.scheduleWithFixedDelay( 10, TimeUnit.SECONDS, () -> { System.out.println(); diff --git a/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java b/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java index 4ae5ecfa7..5c6222ab3 100644 --- a/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java +++ b/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java @@ -273,16 +273,14 @@ private void runWithWorkflow( int requestSize, int responseSize, int ioThreads, int maxThreads, long timeout, ComputeTask task, Consumer cons ) throws IOException { int port = Ports.getFreePort( getClass() ); - PnioHttpHandler.PnioHttpSettings settings = PnioHttpHandler.PnioHttpSettings.builder() - .requestSize( requestSize ) - .responseSize( responseSize ) - .build(); try( NioHttpServer httpServer = new NioHttpServer( new NioHttpServer.DefaultPort( port ) ) ) { httpServer.ioThreads = ioThreads; httpServer.start(); try( PnioController pnioController = new PnioController( ioThreads, maxThreads ) ) { - PnioHttpHandler httpHandler = new PnioHttpHandler<>( "test", settings, task, new TestPnioListener(), pnioController ); + PnioHttpHandler httpHandler = new PnioHttpHandler<>( "test", task, new TestPnioListener(), pnioController ); + httpHandler.responseSize = requestSize; + httpHandler.responseSize = responseSize; httpServer.bind( "/test", exchange -> httpHandler.handleRequest( exchange, timeout, new TestState() ), false ); From 899e4374c45369dea38e70f0fb42feb10cd79626 Mon Sep 17 00:00:00 2001 From: "igor.petrenko" Date: Tue, 24 Mar 2026 08:09:06 +0200 Subject: [PATCH 3/3] pnio: PnioHttpHandler#requestSize, PnioHttpHandler#responseSize: rm final --- .../src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java b/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java index 5c6222ab3..decb0f6fb 100644 --- a/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java +++ b/oap-http/oap-pnio-v3/src/test/java/oap/http/pniov3/PnioHttpHandlerTest.java @@ -279,7 +279,7 @@ private void runWithWorkflow( int requestSize, int responseSize, int ioThreads, try( PnioController pnioController = new PnioController( ioThreads, maxThreads ) ) { PnioHttpHandler httpHandler = new PnioHttpHandler<>( "test", task, new TestPnioListener(), pnioController ); - httpHandler.responseSize = requestSize; + httpHandler.requestSize = requestSize; httpHandler.responseSize = responseSize; httpServer.bind( "/test", exchange -> httpHandler.handleRequest( exchange, timeout, new TestState() ), false );