Search in sources :

Example 6 with TableDataManagerConfig

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;
}
Also used : Field(java.lang.reflect.Field) MetricsRegistry(com.yammer.metrics.core.MetricsRegistry) OfflineSegmentDataManager(com.linkedin.pinot.core.data.manager.offline.OfflineSegmentDataManager) TableDataManagerConfig(com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig) OfflineTableDataManager(com.linkedin.pinot.core.data.manager.offline.OfflineTableDataManager) ServerMetrics(com.linkedin.pinot.common.metrics.ServerMetrics)

Aggregations

TableDataManagerConfig (com.linkedin.pinot.core.data.manager.config.TableDataManagerConfig)6 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)2 ServerMetrics (com.linkedin.pinot.common.metrics.ServerMetrics)1 FileBasedInstanceDataManagerConfig (com.linkedin.pinot.core.data.manager.config.FileBasedInstanceDataManagerConfig)1 FileBasedInstanceDataManager (com.linkedin.pinot.core.data.manager.offline.FileBasedInstanceDataManager)1 OfflineSegmentDataManager (com.linkedin.pinot.core.data.manager.offline.OfflineSegmentDataManager)1 OfflineTableDataManager (com.linkedin.pinot.core.data.manager.offline.OfflineTableDataManager)1 TableDataManager (com.linkedin.pinot.core.data.manager.offline.TableDataManager)1 MetricsRegistry (com.yammer.metrics.core.MetricsRegistry)1 File (java.io.File)1 Field (java.lang.reflect.Field)1 Configuration (org.apache.commons.configuration.Configuration)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1