Search in sources :

Example 6 with FileBasedInstanceDataManager

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));
}
Also used : FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) TableDataManagerConfig(com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig) File(java.io.File) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration)

Example 7 with FileBasedInstanceDataManager

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));
    }
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) ServerConf(com.linkedin.pinot.server.conf.ServerConf) FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) ServerInstance(com.linkedin.pinot.server.starter.ServerInstance) File(java.io.File) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

FileBasedInstanceDataManager (com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager)7 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)7 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)6 File (java.io.File)6 ServerMetrics (com.linkedin.pinot.common.metrics.ServerMetrics)5 FileBasedInstanceDataManagerConfig (com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig)5 ServerQueryExecutorV1Impl (com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl)5 BeforeClass (org.testng.annotations.BeforeClass)5 IndexSegment (com.linkedin.pinot.core.indexsegment.IndexSegment)3 TableDataManagerConfig (com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig)1 AvroRecordToPinotRowGenerator (com.linkedin.pinot.core.realtime.impl.kafka.AvroRecordToPinotRowGenerator)1 ServerConf (com.linkedin.pinot.server.conf.ServerConf)1 ServerInstance (com.linkedin.pinot.server.starter.ServerInstance)1 BeforeTest (org.testng.annotations.BeforeTest)1