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