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