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();
}
Aggregations