Search in sources :

Example 6 with IndexingConfig

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);
}
Also used : IndexingConfig(com.linkedin.pinot.common.config.IndexingConfig) AbstractTableConfig(com.linkedin.pinot.common.config.AbstractTableConfig)

Example 7 with IndexingConfig

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;
}
Also used : IndexingConfig(com.linkedin.pinot.common.config.IndexingConfig) HashMap(java.util.HashMap) TenantConfig(com.linkedin.pinot.common.config.TenantConfig) SegmentsValidationAndRetentionConfig(com.linkedin.pinot.common.config.SegmentsValidationAndRetentionConfig) AbstractTableConfig(com.linkedin.pinot.common.config.AbstractTableConfig)

Aggregations

IndexingConfig (com.linkedin.pinot.common.config.IndexingConfig)7 AbstractTableConfig (com.linkedin.pinot.common.config.AbstractTableConfig)5 HashMap (java.util.HashMap)3 ZNRecord (org.apache.helix.ZNRecord)3 IdealState (org.apache.helix.model.IdealState)3 SegmentsValidationAndRetentionConfig (com.linkedin.pinot.common.config.SegmentsValidationAndRetentionConfig)2 TenantConfig (com.linkedin.pinot.common.config.TenantConfig)2 LLCSegmentName (com.linkedin.pinot.common.utils.LLCSegmentName)2 ArrayList (java.util.ArrayList)2 Schema (com.linkedin.pinot.common.data.Schema)1 TimeFieldSpec (com.linkedin.pinot.common.data.TimeFieldSpec)1 LLCRealtimeSegmentZKMetadata (com.linkedin.pinot.common.metadata.segment.LLCRealtimeSegmentZKMetadata)1 KafkaStreamMetadata (com.linkedin.pinot.common.metadata.stream.KafkaStreamMetadata)1 TableType (com.linkedin.pinot.common.utils.CommonConstants.Helix.TableType)1 ControllerConf (com.linkedin.pinot.controller.ControllerConf)1 SegmentVersion (com.linkedin.pinot.core.indexsegment.generator.SegmentVersion)1 Field (java.lang.reflect.Field)1 HashSet (java.util.HashSet)1 TimeUnit (java.util.concurrent.TimeUnit)1 HelixAdmin (org.apache.helix.HelixAdmin)1