use of com.linkedin.pinot.transport.netty.NettyServer in project pinot by linkedin.
the class ServerBuilder method buildNettyServer.
public NettyServer buildNettyServer(NettyServerConfig nettyServerConfig, RequestHandlerFactory requestHandlerFactory) {
LOGGER.info("Trying to build NettyTCPServer with port : " + nettyServerConfig.getPort());
NettyServer nettyServer = new NettyTCPServer(nettyServerConfig.getPort(), requestHandlerFactory, null);
return nettyServer;
}
use of com.linkedin.pinot.transport.netty.NettyServer in project pinot by linkedin.
the class FileBasedServer method main.
public static void main(String[] args) throws Exception {
//Process Command Line to get config and port
processCommandLineArgs(args);
LOGGER.info("Trying to build server config");
MetricsRegistry metricsRegistry = new MetricsRegistry();
ServerBuilder serverBuilder = new ServerBuilder(new File(_serverConfigPath), metricsRegistry);
LOGGER.info("Trying to build InstanceDataManager");
final DataManager instanceDataManager = serverBuilder.buildInstanceDataManager();
LOGGER.info("Trying to start InstanceDataManager");
instanceDataManager.start();
// bootstrapSegments(instanceDataManager);
LOGGER.info("Trying to build QueryExecutor");
final QueryExecutor queryExecutor = serverBuilder.buildQueryExecutor(instanceDataManager);
final QueryScheduler queryScheduler = serverBuilder.buildQueryScheduler(queryExecutor);
LOGGER.info("Trying to build RequestHandlerFactory");
RequestHandlerFactory simpleRequestHandlerFactory = serverBuilder.buildRequestHandlerFactory(queryScheduler);
LOGGER.info("Trying to build NettyServer");
NettyServer nettyServer = new NettyTCPServer(_serverPort, simpleRequestHandlerFactory, null);
Thread serverThread = new Thread(nettyServer);
ShutdownHook shutdownHook = new ShutdownHook(nettyServer);
serverThread.start();
Runtime.getRuntime().addShutdownHook(shutdownHook);
}
Aggregations