Search in sources :

Example 26 with MetricsRegistry

use of com.yammer.metrics.core.MetricsRegistry in project pinot by linkedin.

the class HelixServerStarter method startServerInstance.

private void startServerInstance(Configuration moreConfigurations) throws Exception {
    Utils.logVersions();
    _serverConf = getInstanceServerConfig(moreConfigurations);
    setupHelixSystemProperties(moreConfigurations);
    if (_serverInstance == null) {
        _serverInstance = new ServerInstance();
        _serverInstance.init(_serverConf, new MetricsRegistry());
        _serverInstance.start();
        LOGGER.info("Started server instance");
    }
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) ServerInstance(com.linkedin.pinot.server.starter.ServerInstance)

Example 27 with MetricsRegistry

use of com.yammer.metrics.core.MetricsRegistry in project pinot by linkedin.

the class HelixStarterTest method testSingleHelixServerStartAndTakingSegment.

@Test
public void testSingleHelixServerStartAndTakingSegment() throws Exception {
    Configuration pinotHelixProperties = new PropertiesConfiguration();
    pinotHelixProperties.addProperty("pinot.server.instance.id", "localhost:0000");
    ServerConf serverConf = DefaultHelixStarterServerConfig.getDefaultHelixServerConfig(pinotHelixProperties);
    ServerInstance serverInstance = new ServerInstance();
    serverInstance.init(serverConf, new MetricsRegistry());
    serverInstance.start();
    File segmentDir0 = new File(INDEX_DIR, "segment0");
    setupSegment(segmentDir0, "testTable0");
    File[] segment0Files = segmentDir0.listFiles();
    Assert.assertNotNull(segment0Files);
    File segmentDir1 = new File(INDEX_DIR, "segment1");
    setupSegment(segmentDir1, "testTable1");
    File[] segment1Files = segmentDir1.listFiles();
    Assert.assertNotNull(segment1Files);
    File segmentDir2 = new File(INDEX_DIR, "segment2");
    setupSegment(segmentDir2, "testTable2");
    File[] segment2Files = segmentDir2.listFiles();
    Assert.assertNotNull(segment2Files);
    DataManager instanceDataManager = serverInstance.getInstanceDataManager();
    instanceDataManager.addSegment(columnarSegmentMetadataLoader.loadIndexSegmentMetadataFromDir(segment0Files[0].getAbsolutePath()), null, null);
    instanceDataManager.addSegment(columnarSegmentMetadataLoader.loadIndexSegmentMetadataFromDir(segment1Files[0].getAbsolutePath()), null, null);
    instanceDataManager.addSegment(columnarSegmentMetadataLoader.loadIndexSegmentMetadataFromDir(segment2Files[0].getAbsolutePath()), null, null);
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) ServerConf(com.linkedin.pinot.server.conf.ServerConf) Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) DataManager(com.linkedin.pinot.common.data.DataManager) ServerInstance(com.linkedin.pinot.server.starter.ServerInstance) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) File(java.io.File) Test(org.testng.annotations.Test)

Example 28 with MetricsRegistry

use of com.yammer.metrics.core.MetricsRegistry 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 29 with MetricsRegistry

use of com.yammer.metrics.core.MetricsRegistry in project pinot by linkedin.

the class SingleNodeServerStarter method main.

// Below is the sample arg put in the running parameters.
// --server_conf src/test/resources/conf
public static void main(String[] args) throws Exception {
    //Process Command Line to get config and port
    processCommandLineArgs(args);
    LOGGER.info("Trying to create a new ServerInstance!");
    _serverInstance = new ServerInstance();
    LOGGER.info("Trying to initial ServerInstance!");
    _serverInstance.init(_serverConf, new MetricsRegistry());
    LOGGER.info("Trying to start ServerInstance!");
    _serverInstance.start();
    LOGGER.info("Adding ShutdownHook!");
    final ShutdownHook shutdownHook = new ShutdownHook(_serverInstance);
    Runtime.getRuntime().addShutdownHook(shutdownHook);
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry)

Example 30 with MetricsRegistry

use of com.yammer.metrics.core.MetricsRegistry 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

MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)45 Test (org.testng.annotations.Test)20 ServerMetrics (com.linkedin.pinot.common.metrics.ServerMetrics)13 File (java.io.File)12 ArrayList (java.util.ArrayList)12 ControllerMetrics (com.linkedin.pinot.common.metrics.ControllerMetrics)10 ServerInstance (com.linkedin.pinot.common.response.ServerInstance)9 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)9 HelixAdmin (org.apache.helix.HelixAdmin)9 NettyClientMetrics (com.linkedin.pinot.transport.metrics.NettyClientMetrics)8 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)8 HashedWheelTimer (io.netty.util.HashedWheelTimer)8 ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)8 IdealState (org.apache.helix.model.IdealState)8 BrokerMetrics (com.linkedin.pinot.common.metrics.BrokerMetrics)7 FileBasedInstanceDataManager (com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager)6 NettyClientConnection (com.linkedin.pinot.transport.netty.NettyClientConnection)6 PooledNettyClientResourceManager (com.linkedin.pinot.transport.netty.PooledNettyClientResourceManager)6 EventLoopGroup (io.netty.channel.EventLoopGroup)6 HashMap (java.util.HashMap)6