use of com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager 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 com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager 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