Search in sources :

Example 1 with BrokerServerBuilder

use of com.linkedin.pinot.broker.broker.BrokerServerBuilder in project pinot by linkedin.

the class FileBasedServerBrokerStarters method startAll.

public void startAll() throws Exception {
    final PropertiesConfiguration broker = brokerProperties();
    final PropertiesConfiguration server = serverProperties();
    log(broker, "broker");
    log(server, "server");
    System.out.println("************************ 1");
    serverInstance = new ServerInstance();
    System.out.println("************************ 2");
    serverInstance.init(new ServerConf(server), new MetricsRegistry());
    System.out.println("************************ 3");
    bld = new BrokerServerBuilder(broker, null, null, null);
    System.out.println("************************ 4");
    bld.buildNetwork();
    System.out.println("************************ 5");
    bld.buildHTTP();
    System.out.println("************************ 6");
    startServer();
    startBroker();
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) ServerConf(com.linkedin.pinot.server.conf.ServerConf) BrokerServerBuilder(com.linkedin.pinot.broker.broker.BrokerServerBuilder) ServerInstance(com.linkedin.pinot.server.starter.ServerInstance) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 2 with BrokerServerBuilder

use of com.linkedin.pinot.broker.broker.BrokerServerBuilder in project pinot by linkedin.

the class HelixBrokerStarter method startBroker.

private BrokerServerBuilder startBroker(Configuration config) throws Exception {
    if (config == null) {
        config = DefaultHelixBrokerConfig.getDefaultBrokerConf();
    }
    final BrokerServerBuilder brokerServerBuilder = new BrokerServerBuilder(config, _helixExternalViewBasedRouting, _helixExternalViewBasedRouting.getTimeBoundaryService(), _liveInstancesListener);
    brokerServerBuilder.buildNetwork();
    brokerServerBuilder.buildHTTP();
    _helixExternalViewBasedRouting.setBrokerMetrics(brokerServerBuilder.getBrokerMetrics());
    brokerServerBuilder.start();
    LOGGER.info("Pinot broker ready and listening on port {} for API requests", config.getProperty("pinot.broker.client.queryPort"));
    Runtime.getRuntime().addShutdownHook(new Thread() {

        @Override
        public void run() {
            try {
                brokerServerBuilder.stop();
            } catch (final Exception e) {
                LOGGER.error("Caught exception while running shutdown hook", e);
            }
        }
    });
    return brokerServerBuilder;
}
Also used : BrokerServerBuilder(com.linkedin.pinot.broker.broker.BrokerServerBuilder)

Aggregations

BrokerServerBuilder (com.linkedin.pinot.broker.broker.BrokerServerBuilder)2 ServerConf (com.linkedin.pinot.server.conf.ServerConf)1 ServerInstance (com.linkedin.pinot.server.starter.ServerInstance)1 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)1 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)1