Thrift Server. Java

package com.mts.dataops.virtualization;
 
import com.mts.dataops.datavirtualization.TrinoThriftService;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TThreadPoolServer;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TServerTransport;
import org.apache.thrift.transport.TTransportException;
import org.apache.thrift.transport.layered.TFramedTransport;
 
public class Main {
    public static void main(String[] args) throws TTransportException {
        Server trino = new Server();
        TrinoThriftService.Processor<Server> processor = new TrinoThriftService.Processor<>(trino);
 
        TServerTransport serverTransport = new TServerSocket(9998);
        TFramedTransport.Factory transportFactory = new TFramedTransport.Factory();
        TBinaryProtocol.Factory protocolFactory = new TBinaryProtocol.Factory();
 
        TThreadPoolServer.Args thriftArgs = new TThreadPoolServer.Args(serverTransport)
                .processor(processor).
                inputProtocolFactory(protocolFactory).
                inputTransportFactory(transportFactory).
                outputTransportFactory(transportFactory);
        TServer server = new TThreadPoolServer(thriftArgs);
 
        Thread thread = new Thread(server::serve);
        thread.start();
    }
}

Debug

Для Java Π½Π΅Ρ‚ Debug Ρ€Π΅Π°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΏΡ€ΠΎΡ‚ΠΎΠΊΠΎΠ»ΠΎΠ².