Search in sources :

Example 1 with ServerConf

use of com.linkedin.pinot.server.conf.ServerConf 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 ServerConf

use of com.linkedin.pinot.server.conf.ServerConf in project pinot by linkedin.

the class DefaultHelixStarterServerConfig method getDefaultHelixServerConfig.

public static ServerConf getDefaultHelixServerConfig(Configuration externalConfigs) {
    Configuration defaultConfigs = loadDefaultServerConf();
    @SuppressWarnings("unchecked") Iterator<String> iterable = externalConfigs.getKeys();
    while (iterable.hasNext()) {
        String key = iterable.next();
        defaultConfigs.setProperty(key, externalConfigs.getProperty(key));
        LOGGER.info("External config key: {}, value: {}", key, externalConfigs.getProperty(key));
    }
    return new ServerConf(defaultConfigs);
}
Also used : ServerConf(com.linkedin.pinot.server.conf.ServerConf) Configuration(org.apache.commons.configuration.Configuration) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 3 with ServerConf

use of com.linkedin.pinot.server.conf.ServerConf in project pinot by linkedin.

the class ResourceTestHelper method setup.

/**
   * Sets up Pinot server instance, index directory for creation of segments, creates a default segment
   * and starts pinot admin api service
   * This should be called only once in the  @BeforeClass method of a unit test.
   * Caller must ensure teardown() is called when the test completes (in @AfterClass)
   */
public void setup() throws Exception {
    INDEX_DIR = Files.createTempDirectory(TableSizeResourceTest.class.getName() + "_segmentDir").toFile();
    File confFile = new File(TestUtils.getFileFromResourceUrl(InstanceServerStarter.class.getClassLoader().getResource("conf/pinot.properties")));
    config = new PropertiesConfiguration();
    config.setDelimiterParsingDisabled(false);
    config.load(confFile);
    serverConf = new ServerConf(config);
    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();
    apiApplication = new AdminApiApplication(serverInstance);
    apiApplication.start(Integer.parseInt(CommonConstants.Server.DEFAULT_ADMIN_API_PORT));
    client = ClientBuilder.newClient();
    target = client.target(apiApplication.getBaseUri().toString());
    setupSegment();
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) ServerConf(com.linkedin.pinot.server.conf.ServerConf) InstanceServerStarter(com.linkedin.pinot.server.integration.InstanceServerStarter) ServerInstance(com.linkedin.pinot.server.starter.ServerInstance) File(java.io.File) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) AdminApiApplication(com.linkedin.pinot.server.starter.helix.AdminApiApplication)

Example 4 with ServerConf

use of com.linkedin.pinot.server.conf.ServerConf in project pinot by linkedin.

the class SingleNodeServerStarter method buildServerConfig.

/**
   * Construct from config file path
   * @param configFilePath Path to the config file
   * @throws Exception
   */
public static void buildServerConfig(File configFilePath) throws Exception {
    if (!configFilePath.exists()) {
        LOGGER.error("configuration file: " + configFilePath.getAbsolutePath() + " does not exist.");
        throw new ConfigurationException("configuration file: " + configFilePath.getAbsolutePath() + " does not exist.");
    }
    // build _serverConf
    final PropertiesConfiguration serverConf = new PropertiesConfiguration();
    serverConf.setDelimiterParsingDisabled(false);
    serverConf.load(configFilePath);
    _serverConf = new ServerConf(serverConf);
}
Also used : ServerConf(com.linkedin.pinot.server.conf.ServerConf) ConfigurationException(org.apache.commons.configuration.ConfigurationException) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 5 with ServerConf

use of com.linkedin.pinot.server.conf.ServerConf 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)

Aggregations

ServerConf (com.linkedin.pinot.server.conf.ServerConf)6 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)6 ServerInstance (com.linkedin.pinot.server.starter.ServerInstance)4 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)4 File (java.io.File)3 Configuration (org.apache.commons.configuration.Configuration)2 BrokerServerBuilder (com.linkedin.pinot.broker.broker.BrokerServerBuilder)1 DataManager (com.linkedin.pinot.common.data.DataManager)1 FileBasedInstanceDataManager (com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager)1 InstanceServerStarter (com.linkedin.pinot.server.integration.InstanceServerStarter)1 AdminApiApplication (com.linkedin.pinot.server.starter.helix.AdminApiApplication)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1 BeforeTest (org.testng.annotations.BeforeTest)1 Test (org.testng.annotations.Test)1