Search in sources :

Example 1 with RequestHandlerFactory

use of com.linkedin.pinot.transport.netty.NettyServer.RequestHandlerFactory 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)

Example 2 with RequestHandlerFactory

use of com.linkedin.pinot.transport.netty.NettyServer.RequestHandlerFactory in project pinot by linkedin.

the class InstanceServerStarter method main.

public static void main(String[] args) throws Exception {
    File confDir = new File(InstanceServerStarter.class.getClassLoader().getResource("conf").toURI());
    LOGGER.info("Trying to build server config");
    MetricsRegistry metricsRegistry = new MetricsRegistry();
    ServerBuilder serverBuilder = new ServerBuilder(confDir.getAbsolutePath(), 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);
    QueryScheduler queryScheduler = serverBuilder.buildQueryScheduler(queryExecutor);
    RequestHandlerFactory simpleRequestHandlerFactory = serverBuilder.buildRequestHandlerFactory(queryScheduler);
    LOGGER.info("Trying to build NettyServer");
    System.out.println(getMaxQuery());
    String queryJson = "";
    System.out.println(getCountQuery().toString());
    sendQueryToQueryExecutor(getCountQuery(), queryExecutor, queryScheduler, serverBuilder.getServerMetrics());
    sendQueryToQueryExecutor(getSumQuery(), queryExecutor, queryScheduler, serverBuilder.getServerMetrics());
    sendQueryToQueryExecutor(getMaxQuery(), queryExecutor, queryScheduler, serverBuilder.getServerMetrics());
    sendQueryToQueryExecutor(getMinQuery(), queryExecutor, queryScheduler, serverBuilder.getServerMetrics());
    LOGGER.info("Trying to build RequestHandlerFactory");
}
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) File(java.io.File) ServerBuilder(com.linkedin.pinot.server.starter.ServerBuilder)

Aggregations

DataManager (com.linkedin.pinot.common.data.DataManager)2 QueryExecutor (com.linkedin.pinot.common.query.QueryExecutor)2 QueryScheduler (com.linkedin.pinot.core.query.scheduler.QueryScheduler)2 RequestHandlerFactory (com.linkedin.pinot.transport.netty.NettyServer.RequestHandlerFactory)2 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)2 File (java.io.File)2 ServerBuilder (com.linkedin.pinot.server.starter.ServerBuilder)1 NettyServer (com.linkedin.pinot.transport.netty.NettyServer)1 NettyTCPServer (com.linkedin.pinot.transport.netty.NettyTCPServer)1