use of com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig in project pinot by linkedin.
the class OfflineTableDataManagerTest method makeTestableManager.
private OfflineTableDataManager makeTestableManager() throws Exception {
OfflineTableDataManager tableDataManager = new OfflineTableDataManager();
TableDataManagerConfig config;
{
config = mock(TableDataManagerConfig.class);
when(config.getTableName()).thenReturn(tableName);
when(config.getDataDir()).thenReturn(_tmpDir.getAbsolutePath());
when(config.getReadMode()).thenReturn(readMode.toString());
when(config.getIndexLoadingConfigMetadata()).thenReturn(null);
}
tableDataManager.init(config, new ServerMetrics(new MetricsRegistry()), null);
tableDataManager.start();
Field segsMapField = AbstractTableDataManager.class.getDeclaredField("_segmentsMap");
segsMapField.setAccessible(true);
_internalSegMap = (Map<String, OfflineSegmentDataManager>) segsMapField.get(tableDataManager);
return tableDataManager;
}
use of com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig 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);
}
}
use of com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig in project pinot by linkedin.
the class FileBasedInstanceDataManager method init.
public synchronized void init(FileBasedInstanceDataManagerConfig instanceDataManagerConfig) throws ConfigurationException, InstantiationException, IllegalAccessException, ClassNotFoundException {
_instanceDataManagerConfig = instanceDataManagerConfig;
for (String tableName : _instanceDataManagerConfig.getTableNames()) {
TableDataManagerConfig tableDataManagerConfig = _instanceDataManagerConfig.getTableDataManagerConfig(tableName);
TableDataManager tableDataManager = TableDataManagerProvider.getTableDataManager(tableDataManagerConfig, null);
_tableDataManagerMap.put(tableName, tableDataManager);
}
_segmentMetadataLoader = getSegmentMetadataLoader(_instanceDataManagerConfig.getSegmentMetadataLoaderClass());
}
use of com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig in project pinot by linkedin.
the class HelixInstanceDataManager method addTableIfNeed.
public synchronized void addTableIfNeed(AbstractTableConfig tableConfig, String tableName, String serverInstance) throws ConfigurationException {
TableDataManagerConfig tableDataManagerConfig = getDefaultHelixTableDataManagerConfig(tableName);
if (tableConfig != null) {
tableDataManagerConfig.overrideConfigs(tableName, tableConfig);
}
TableDataManager tableDataManager = TableDataManagerProvider.getTableDataManager(tableDataManagerConfig, serverInstance);
tableDataManager.start();
addTableDataManager(tableName, tableDataManager);
}
use of com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig 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));
}
Aggregations