Search in sources :

Example 6 with FileBasedInstanceDataManagerConfig

use of com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig in project pinot by linkedin.

the class RealtimeQueriesSentinelTest method setup.

@BeforeClass
public void setup() throws Exception {
    TableDataManagerProvider.setServerMetrics(new ServerMetrics(new MetricsRegistry()));
    PINOT_SCHEMA = getTestSchema();
    PINOT_SCHEMA.setSchemaName("realtimeSchema");
    AVRO_RECORD_TRANSFORMER = new AvroRecordToPinotRowGenerator(PINOT_SCHEMA);
    final IndexSegment indexSegment = getRealtimeSegment();
    setUpTestQueries("testTable");
    CONFIG_BUILDER = new TestingServerPropertiesBuilder("testTable");
    final PropertiesConfiguration serverConf = CONFIG_BUILDER.build();
    serverConf.setDelimiterParsingDisabled(false);
    final FileBasedInstanceDataManager instanceDataManager = FileBasedInstanceDataManager.getInstanceDataManager();
    instanceDataManager.init(new FileBasedInstanceDataManagerConfig(serverConf.subset("pinot.server.instance")));
    instanceDataManager.start();
    instanceDataManager.getTableDataManager("testTable");
    instanceDataManager.getTableDataManager("testTable").addSegment(indexSegment);
    QUERY_EXECUTOR = new ServerQueryExecutorV1Impl(false);
    QUERY_EXECUTOR.init(serverConf.subset("pinot.server.query.executor"), instanceDataManager, new ServerMetrics(new MetricsRegistry()));
}
Also used : MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) AvroRecordToPinotRowGenerator(com.linkedin.pinot.core.realtime.impl.kafka.AvroRecordToPinotRowGenerator) IndexSegment(com.linkedin.pinot.core.indexsegment.IndexSegment) FileBasedInstanceDataManager(com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager) ServerQueryExecutorV1Impl(com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl) ServerMetrics(com.linkedin.pinot.common.metrics.ServerMetrics) FileBasedInstanceDataManagerConfig(com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) BeforeClass(org.testng.annotations.BeforeClass)

Example 7 with FileBasedInstanceDataManagerConfig

use of com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig in project pinot by linkedin.

the class FileBasedInstanceDataManager method init.

@Override
public synchronized void init(Configuration dataManagerConfig) {
    try {
        _instanceDataManagerConfig = new FileBasedInstanceDataManagerConfig(dataManagerConfig);
    } catch (Exception e) {
        _instanceDataManagerConfig = null;
        LOGGER.error("Error during InstanceDataManager initialization", e);
        Utils.rethrowException(e);
    }
    for (String tableName : _instanceDataManagerConfig.getTableNames()) {
        TableDataManagerConfig tableDataManagerConfig = _instanceDataManagerConfig.getTableDataManagerConfig(tableName);
        TableDataManager tableDataManager = TableDataManagerProvider.getTableDataManager(tableDataManagerConfig, null);
        _tableDataManagerMap.put(tableName, tableDataManager);
    }
    try {
        _segmentMetadataLoader = getSegmentMetadataLoader(_instanceDataManagerConfig.getSegmentMetadataLoaderClass());
        LOGGER.info("Loaded SegmentMetadataLoader for class name : " + _instanceDataManagerConfig.getSegmentMetadataLoaderClass());
    } catch (Exception e) {
        LOGGER.error("Cannot initialize SegmentMetadataLoader for class name : " + _instanceDataManagerConfig.getSegmentMetadataLoaderClass(), e);
        Utils.rethrowException(e);
    }
}
Also used : TableDataManagerConfig(com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig) FileBasedInstanceDataManagerConfig(com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig) ConfigurationException(org.apache.commons.configuration.ConfigurationException)

Aggregations

FileBasedInstanceDataManagerConfig (com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig)7 ServerMetrics (com.linkedin.pinot.common.metrics.ServerMetrics)5 FileBasedInstanceDataManager (com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager)5 ServerQueryExecutorV1Impl (com.linkedin.pinot.core.query.executor.ServerQueryExecutorV1Impl)5 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)5 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)5 BeforeClass (org.testng.annotations.BeforeClass)5 File (java.io.File)4 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 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1