From 8207efcd4c39c1af471812bd00dfe1291d1286b8 Mon Sep 17 00:00:00 2001 From: feng xiaohang <43104233+engraving-knife@users.noreply.github.com> Date: Mon, 2 Sep 2024 18:00:39 +0800 Subject: [PATCH] [AMORO-3153]Modify the implementation class of the thrift server (#3154) Modify the implementation class of the thrift server Co-authored-by: xiaosefeng Co-authored-by: Xavier Bai --- .../apache/amoro/server/AmoroServiceContainer.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/AmoroServiceContainer.java b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/AmoroServiceContainer.java index 92f0dff2b9..1dd763f324 100644 --- a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/AmoroServiceContainer.java +++ b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/AmoroServiceContainer.java @@ -52,8 +52,8 @@ import org.apache.amoro.shade.thrift.org.apache.thrift.TProcessor; import org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TBinaryProtocol; import org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolFactory; +import org.apache.amoro.shade.thrift.org.apache.thrift.server.THsHaServer; import org.apache.amoro.shade.thrift.org.apache.thrift.server.TServer; -import org.apache.amoro.shade.thrift.org.apache.thrift.server.TThreadedSelectorServer; import org.apache.amoro.shade.thrift.org.apache.thrift.transport.TNonblockingServerSocket; import org.apache.amoro.shade.thrift.org.apache.thrift.transport.TTransportException; import org.apache.amoro.shade.thrift.org.apache.thrift.transport.TTransportFactory; @@ -374,15 +374,13 @@ private TServer createThriftServer( TTransportFactory transportFactory = new TFramedTransport.Factory(); TMultiplexedProcessor multiplexedProcessor = new TMultiplexedProcessor(); multiplexedProcessor.registerProcessor(processorName, processor); - TThreadedSelectorServer.Args args = - new TThreadedSelectorServer.Args(serverTransport) + THsHaServer.Args args = + new THsHaServer.Args(serverTransport) .processor(multiplexedProcessor) .transportFactory(transportFactory) .protocolFactory(protocolFactory) .inputProtocolFactory(inputProtoFactory) - .executorService(executorService) - .selectorThreads(selectorThreads) - .acceptQueueSizePerThread(queueSizePerSelector); + .executorService(executorService); LOG.info( "The number of selector threads for the {} thrift server is: {}", processorName, @@ -391,7 +389,7 @@ private TServer createThriftServer( "The size of per-selector queue for the {} thrift server is: {}", processorName, queueSizePerSelector); - return new TThreadedSelectorServer(args); + return new THsHaServer(args); } private ThreadFactory getThriftThreadFactory(String processorName) {