Search in sources :

Example 6 with NettyTCPServer

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();
}
Also used : NettyTCPServer(com.linkedin.pinot.transport.netty.NettyTCPServer) AggregatedMetricsRegistry(com.linkedin.pinot.common.metrics.AggregatedMetricsRegistry)

Example 7 with NettyTCPServer

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);
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) QueryScheduler(com.linkedin.pinot.core.query.scheduler.QueryScheduler) QueryExecutor(com.linkedin.pinot.common.query.QueryExecutor) RequestHandlerFactory(com.linkedin.pinot.transport.netty.NettyServer.RequestHandlerFactory) DataManager(com.linkedin.pinot.common.data.DataManager) NettyTCPServer(com.linkedin.pinot.transport.netty.NettyTCPServer) File(java.io.File) NettyServer(com.linkedin.pinot.transport.netty.NettyServer)

Aggregations

NettyTCPServer (com.linkedin.pinot.transport.netty.NettyTCPServer)7 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)5 BrokerMetrics (com.linkedin.pinot.common.metrics.BrokerMetrics)4 ServerInstance (com.linkedin.pinot.common.response.ServerInstance)4 SegmentId (com.linkedin.pinot.transport.common.SegmentId)4 SegmentIdSet (com.linkedin.pinot.transport.common.SegmentIdSet)4 NettyClientMetrics (com.linkedin.pinot.transport.metrics.NettyClientMetrics)4 NettyClientConnection (com.linkedin.pinot.transport.netty.NettyClientConnection)4 PooledNettyClientResourceManager (com.linkedin.pinot.transport.netty.PooledNettyClientResourceManager)4 KeyedPoolImpl (com.linkedin.pinot.transport.pool.KeyedPoolImpl)4 ByteBuf (io.netty.buffer.ByteBuf)4 EventLoopGroup (io.netty.channel.EventLoopGroup)4 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)4 HashedWheelTimer (io.netty.util.HashedWheelTimer)4 HashMap (java.util.HashMap)4 ExecutorService (java.util.concurrent.ExecutorService)4 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)4 ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)4 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)4 Test (org.testng.annotations.Test)4