Search in sources :

Example 1 with AdminApiApplication

use of com.linkedin.pinot.server.starter.helix.AdminApiApplication 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)

Aggregations

ServerConf (com.linkedin.pinot.server.conf.ServerConf)1 InstanceServerStarter (com.linkedin.pinot.server.integration.InstanceServerStarter)1 ServerInstance (com.linkedin.pinot.server.starter.ServerInstance)1 AdminApiApplication (com.linkedin.pinot.server.starter.helix.AdminApiApplication)1 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)1 File (java.io.File)1 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)1