use of com.linkedin.pinot.common.config.IndexingConfig in project pinot by linkedin.
the class PerfBenchmarkDriver method configureTable.
public void configureTable(String tableName, List<String> invertedIndexColumns) throws Exception {
String jsonString = ControllerRequestBuilderUtil.buildCreateOfflineTableJSON(tableName, _serverTenantName, _brokerTenantName, _numReplicas, _segmentAssignmentStrategy).toString();
AbstractTableConfig offlineTableConfig = AbstractTableConfig.init(jsonString);
offlineTableConfig.getValidationConfig().setRetentionTimeUnit("DAYS");
offlineTableConfig.getValidationConfig().setRetentionTimeValue("");
IndexingConfig indexingConfig = offlineTableConfig.getIndexingConfig();
indexingConfig.setLoadMode(_loadMode);
indexingConfig.setSegmentFormatVersion(_segmentFormatVersion);
if (invertedIndexColumns != null && !invertedIndexColumns.isEmpty()) {
indexingConfig.setInvertedIndexColumns(invertedIndexColumns);
}
_helixResourceManager.addTable(offlineTableConfig);
}
use of com.linkedin.pinot.common.config.IndexingConfig in project pinot by linkedin.
the class PinotLLCRealtimeSegmentManagerTest method makeTableConfig.
// Make a tableconfig that returns the topic name and nReplicas per partition as we need it.
private AbstractTableConfig makeTableConfig(int nReplicas, String topic) {
AbstractTableConfig mockTableConfig = mock(AbstractTableConfig.class);
SegmentsValidationAndRetentionConfig mockValidationConfig = mock(SegmentsValidationAndRetentionConfig.class);
when(mockValidationConfig.getReplicasPerPartition()).thenReturn(Integer.toString(nReplicas));
when(mockTableConfig.getValidationConfig()).thenReturn(mockValidationConfig);
Map<String, String> streamConfigMap = new HashMap<>(1);
String consumerTypesCsv = streamConfigMap.put(StringUtil.join(".", CommonConstants.Helix.DataSource.STREAM_PREFIX, CommonConstants.Helix.DataSource.Realtime.Kafka.CONSUMER_TYPE), "simple");
streamConfigMap.put(StringUtil.join(".", CommonConstants.Helix.DataSource.STREAM_PREFIX, CommonConstants.Helix.DataSource.Realtime.Kafka.TOPIC_NAME), topic);
IndexingConfig mockIndexConfig = mock(IndexingConfig.class);
when(mockIndexConfig.getStreamConfigs()).thenReturn(streamConfigMap);
when(mockTableConfig.getIndexingConfig()).thenReturn(mockIndexConfig);
TenantConfig mockTenantConfig = mock(TenantConfig.class);
when(mockTenantConfig.getServer()).thenReturn("freeTenant");
when(mockTableConfig.getTenantConfig()).thenReturn(mockTenantConfig);
return mockTableConfig;
}
Aggregations