Skip to content

Commit

Permalink
[AMORO-3153]Modify the implementation class of the thrift server (#3154)
Browse files Browse the repository at this point in the history
Modify the implementation class of the thrift server

Co-authored-by: xiaosefeng <[email protected]>
Co-authored-by: Xavier Bai <[email protected]>
  • Loading branch information
3 people authored Sep 2, 2024
1 parent 365b272 commit 8207efc
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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) {
Expand Down

0 comments on commit 8207efc

Please sign in to comment.