use of com.linkedin.pinot.transport.netty.NettyTCPServer in project pinot by linkedin.
the class ScatterGatherPerfServer method run.
public void run() {
AggregatedMetricsRegistry metricsRegistry = new AggregatedMetricsRegistry();
_bakedResponse = new byte[_responseSize];
for (int i = 0; i < _responseSize; i++) _bakedResponse[i] = 'a';
MyRequestHandler handler = new MyRequestHandler(new String(_bakedResponse), null, _responseLatencyMs);
MyRequestHandlerFactory handlerFactory = new MyRequestHandlerFactory(handler);
_server = new NettyTCPServer(_serverPort, handlerFactory, metricsRegistry);
Thread serverThread = new Thread(_server, "ServerMain");
ShutdownHook shutdownHook = new ShutdownHook(_server);
Runtime.getRuntime().addShutdownHook(shutdownHook);
serverThread.start();
}
use of com.linkedin.pinot.transport.netty.NettyTCPServer 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