use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class ResourceTestHelper method addTable.
public void addTable(String tableName) throws IOException, ConfigurationException {
File directory = new File(INDEX_DIR, tableName);
FileUtils.forceMkdir(directory);
PropertiesConfiguration tableConfig = new PropertiesConfiguration();
tableConfig.setProperty("directory", tableName);
tableConfig.setProperty("name", tableName);
tableConfig.setProperty("dataManagerType", "offline");
tableConfig.setProperty("readMode", "heap");
FileBasedInstanceDataManager dataManager = (FileBasedInstanceDataManager) serverInstance.getInstanceDataManager();
dataManager.addTable(new TableDataManagerConfig(tableConfig));
}
use of org.apache.commons.configuration.PropertiesConfiguration 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);
}
use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class RealtimeTableDataManagerTest method getTableDataManagerConfig.
private static TableDataManagerConfig getTableDataManagerConfig() throws ConfigurationException {
String tableName = "testTable_R";
Configuration defaultConfig = new PropertiesConfiguration();
defaultConfig.addProperty(TABLE_DATA_MANAGER_NAME, tableName);
String dataDir = "/tmp/" + tableName;
defaultConfig.addProperty(TABLE_DATA_MANAGER_DATA_DIRECTORY, dataDir);
defaultConfig.addProperty(READ_MODE, ReadMode.heap.toString());
defaultConfig.addProperty(TABLE_DATA_MANAGER_NUM_QUERY_EXECUTOR_THREADS, 20);
TableDataManagerConfig tableDataManagerConfig = new TableDataManagerConfig(defaultConfig);
defaultConfig.addProperty(TABLE_DATA_MANAGER_TYPE, "realtime");
return tableDataManagerConfig;
}
use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class DefaultHelixStarterServerConfig method loadDefaultServerConf.
public static Configuration loadDefaultServerConf() {
Configuration serverConf = new PropertiesConfiguration();
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_DATA_DIR, CommonConstants.Server.DEFAULT_INSTANCE_DATA_DIR);
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_SEGMENT_TAR_DIR, CommonConstants.Server.DEFAULT_INSTANCE_SEGMENT_TAR_DIR);
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_READ_MODE, CommonConstants.Server.DEFAULT_READ_MODE);
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_DATA_MANAGER_CLASS, CommonConstants.Server.DEFAULT_DATA_MANAGER_CLASS);
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_INSTANCE_SEGMENT_METADATA_LOADER_CLASS, CommonConstants.Server.DEFAULT_SEGMENT_METADATA_LOADER_CLASS);
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_SEGMENT_FORMAT_VERSION, CommonConstants.Server.DEFAULT_SEGMENT_FORMAT_VERSION);
// query executor parameters
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_QUERY_EXECUTOR_PRUNER_CLASS, "DataSchemaSegmentPruner,ColumnValueSegmentPruner,ValidSegmentPruner");
serverConf.addProperty("pinot.server.query.executor.pruner.DataSchemaSegmentPruner.id", "0");
serverConf.addProperty("pinot.server.query.executor.pruner.ColumnValueSegmentPruner.id", "1");
serverConf.addProperty("pinot.server.query.executor.pruner.ValidSegmentPruner.id", "2");
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_QUERY_EXECUTOR_TIMEOUT, CommonConstants.Server.DEFAULT_QUERY_EXECUTOR_TIMEOUT);
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_QUERY_EXECUTOR_CLASS, CommonConstants.Server.DEFAULT_QUERY_EXECUTOR_CLASS);
serverConf.addProperty(CommonConstants.Helix.CONFIG_OF_HELIX_FLAPPING_TIMEWINDOW_MS, CommonConstants.Helix.DEFAULT_HELIX_FLAPPING_TIMEWINDOW_MS);
// request handler factory parameters
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_REQUEST_HANDLER_FACTORY_CLASS, CommonConstants.Server.DEFAULT_REQUEST_HANDLER_FACTORY_CLASS);
// netty port
serverConf.addProperty(CommonConstants.Server.CONFIG_OF_NETTY_PORT, CommonConstants.Helix.DEFAULT_SERVER_NETTY_PORT);
return serverConf;
}
use of org.apache.commons.configuration.PropertiesConfiguration in project pinot by linkedin.
the class IntegrationTest method setUp.
@BeforeTest
public void setUp() throws Exception {
//Process Command Line to get config and port
FileUtils.deleteDirectory(new File("/tmp/pinot/test1"));
setupSegmentList();
File confFile = new File(TestUtils.getFileFromResourceUrl(InstanceServerStarter.class.getClassLoader().getResource("conf/" + PINOT_PROPERTIES)));
// build _serverConf
PropertiesConfiguration serverConf = new PropertiesConfiguration();
serverConf.setDelimiterParsingDisabled(false);
serverConf.load(confFile);
_serverConf = new ServerConf(serverConf);
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();
_queryExecutor = _serverInstance.getQueryExecutor();
FileBasedInstanceDataManager instanceDataManager = (FileBasedInstanceDataManager) _serverInstance.getInstanceDataManager();
for (int i = 0; i < 2; ++i) {
instanceDataManager.getTableDataManager("testTable");
instanceDataManager.getTableDataManager("testTable").addSegment(_indexSegmentList.get(i));
}
}
Aggregations