All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.pinot.spi.config.table.IndexingConfig Maven / Gradle / Ivy

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.pinot.spi.config.table;

import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import org.apache.pinot.spi.config.BaseJsonConfig;
import org.apache.pinot.spi.config.table.ingestion.IngestionConfig;


public class IndexingConfig extends BaseJsonConfig {

  public static final int DEFAULT_RANGE_INDEX_VERSION = 2;

  private List _invertedIndexColumns;
  private List _rangeIndexColumns;
  private int _rangeIndexVersion = DEFAULT_RANGE_INDEX_VERSION;
  @Deprecated
  private List _jsonIndexColumns;
  private Map _jsonIndexConfigs;
  private List _h3IndexColumns;
  private List _sortedColumn;
  private List _bloomFilterColumns;
  private Map _bloomFilterConfigs;
  private String _loadMode;
  @Deprecated // Moved to {@link IngestionConfig#getStreamIngestionConfig}
  private Map _streamConfigs;
  private String _segmentFormatVersion;
  private FSTType _fstTypeForFSTIndex;
  private String _columnMinMaxValueGeneratorMode;
  private List _noDictionaryColumns; // TODO: replace this with noDictionaryConfig.
  private Map _noDictionaryConfig;
  private List _onHeapDictionaryColumns;
  private boolean _enableDefaultStarTree;
  private List _starTreeIndexConfigs;
  // Whether to allow creating star-tree when server loads the segment
  private boolean _enableDynamicStarTreeCreation;
  private SegmentPartitionConfig _segmentPartitionConfig;
  private boolean _aggregateMetrics;
  private boolean _nullHandlingEnabled;

  /**
   * If `optimizeDictionary` enabled, dictionary is not created for the high-cardinality
   * single-valued columns for which rawIndexSize / forwardIndexSize is less than the `noDictionarySizeRatioThreshold`.
   * It also disables dictionary for json and text columns.
   */
  private boolean _optimizeDictionary;

  /**
   * Same as `optimizeDictionary` but only for metric columns.
   */
  private boolean _optimizeDictionaryForMetrics;

  private double _noDictionarySizeRatioThreshold;

  // TODO: Add a new configuration related to the segment generation
  private boolean _autoGeneratedInvertedIndex;
  private boolean _createInvertedIndexDuringSegmentGeneration;
  private String _segmentNameGeneratorType;

  /**
   * The list of columns for which the variable length dictionary needs to be enabled in offline
   * segments. This is only valid for string and bytes columns and has no impact for columns of
   * other data types.
   */
  private List _varLengthDictionaryColumns;

  @Nullable
  public List getInvertedIndexColumns() {
    return _invertedIndexColumns;
  }

  public void setInvertedIndexColumns(List invertedIndexColumns) {
    _invertedIndexColumns = invertedIndexColumns;
  }

  public List getRangeIndexColumns() {
    return _rangeIndexColumns;
  }

  public void setRangeIndexColumns(List rangeIndexColumns) {
    _rangeIndexColumns = rangeIndexColumns;
  }

  public int getRangeIndexVersion() {
    return _rangeIndexVersion;
  }

  public void setFSTIndexType(FSTType fstType) {
    _fstTypeForFSTIndex = fstType;
  }

  public FSTType getFSTIndexType() {
    return _fstTypeForFSTIndex;
  }

  public void setRangeIndexVersion(int rangeIndexVersion) {
    _rangeIndexVersion = rangeIndexVersion;
  }

  public List getJsonIndexColumns() {
    return _jsonIndexColumns;
  }

  public void setJsonIndexColumns(List jsonIndexColumns) {
    _jsonIndexColumns = jsonIndexColumns;
  }

  public Map getJsonIndexConfigs() {
    return _jsonIndexConfigs;
  }

  public void setJsonIndexConfigs(Map jsonIndexConfigs) {
    _jsonIndexConfigs = jsonIndexConfigs;
  }

  public boolean isAutoGeneratedInvertedIndex() {
    return _autoGeneratedInvertedIndex;
  }

  public void setAutoGeneratedInvertedIndex(boolean autoGeneratedInvertedIndex) {
    _autoGeneratedInvertedIndex = autoGeneratedInvertedIndex;
  }

  public boolean isCreateInvertedIndexDuringSegmentGeneration() {
    return _createInvertedIndexDuringSegmentGeneration;
  }

  public void setCreateInvertedIndexDuringSegmentGeneration(boolean createInvertedIndexDuringSegmentGeneration) {
    _createInvertedIndexDuringSegmentGeneration = createInvertedIndexDuringSegmentGeneration;
  }

  @Nullable
  public List getSortedColumn() {
    return _sortedColumn;
  }

  public void setSortedColumn(List sortedColumn) {
    _sortedColumn = sortedColumn;
  }

  @Nullable
  public List getBloomFilterColumns() {
    return _bloomFilterColumns;
  }

  public void setBloomFilterColumns(List bloomFilterColumns) {
    _bloomFilterColumns = bloomFilterColumns;
  }

  @Nullable
  public Map getBloomFilterConfigs() {
    return _bloomFilterConfigs;
  }

  public void setBloomFilterConfigs(Map bloomFilterConfigs) {
    _bloomFilterConfigs = bloomFilterConfigs;
  }

  @Nullable
  public String getLoadMode() {
    return _loadMode;
  }

  public void setLoadMode(String loadMode) {
    _loadMode = loadMode;
  }

  /**
   * @deprecated Use List> streamConfigs from
   * {@link IngestionConfig#getStreamIngestionConfig()}
   */
  @Nullable
  public Map getStreamConfigs() {
    return _streamConfigs;
  }

  public void setStreamConfigs(Map streamConfigs) {
    _streamConfigs = streamConfigs;
  }

  @Nullable
  public String getSegmentFormatVersion() {
    return _segmentFormatVersion;
  }

  public void setSegmentFormatVersion(String segmentFormatVersion) {
    _segmentFormatVersion = segmentFormatVersion;
  }

  @Nullable
  public String getColumnMinMaxValueGeneratorMode() {
    return _columnMinMaxValueGeneratorMode;
  }

  public void setColumnMinMaxValueGeneratorMode(String columnMinMaxValueGeneratorMode) {
    _columnMinMaxValueGeneratorMode = columnMinMaxValueGeneratorMode;
  }

  @Nullable
  public List getNoDictionaryColumns() {
    return _noDictionaryColumns;
  }

  public void setNoDictionaryColumns(List noDictionaryColumns) {
    _noDictionaryColumns = noDictionaryColumns;
  }

  @Nullable
  public Map getNoDictionaryConfig() {
    return _noDictionaryConfig;
  }

  public void setNoDictionaryConfig(Map noDictionaryConfig) {
    _noDictionaryConfig = noDictionaryConfig;
  }

  @Nullable
  public List getOnHeapDictionaryColumns() {
    return _onHeapDictionaryColumns;
  }

  public void setOnHeapDictionaryColumns(List onHeapDictionaryColumns) {
    _onHeapDictionaryColumns = onHeapDictionaryColumns;
  }

  @Nullable
  public List getVarLengthDictionaryColumns() {
    return _varLengthDictionaryColumns;
  }

  public void setVarLengthDictionaryColumns(List varLengthDictionaryColumns) {
    _varLengthDictionaryColumns = varLengthDictionaryColumns;
  }

  public boolean isEnableDefaultStarTree() {
    return _enableDefaultStarTree;
  }

  public void setEnableDefaultStarTree(boolean enableDefaultStarTree) {
    _enableDefaultStarTree = enableDefaultStarTree;
  }

  @Nullable
  public List getStarTreeIndexConfigs() {
    return _starTreeIndexConfigs;
  }

  public void setStarTreeIndexConfigs(List starTreeIndexConfigs) {
    _starTreeIndexConfigs = starTreeIndexConfigs;
  }

  public boolean isEnableDynamicStarTreeCreation() {
    return _enableDynamicStarTreeCreation;
  }

  public void setEnableDynamicStarTreeCreation(boolean enableDynamicStarTreeCreation) {
    _enableDynamicStarTreeCreation = enableDynamicStarTreeCreation;
  }

  @Nullable
  public SegmentPartitionConfig getSegmentPartitionConfig() {
    return _segmentPartitionConfig;
  }

  public void setSegmentPartitionConfig(SegmentPartitionConfig segmentPartitionConfig) {
    _segmentPartitionConfig = segmentPartitionConfig;
  }

  public boolean isAggregateMetrics() {
    return _aggregateMetrics;
  }

  public void setAggregateMetrics(boolean value) {
    _aggregateMetrics = value;
  }

  public boolean isNullHandlingEnabled() {
    return _nullHandlingEnabled;
  }

  public void setNullHandlingEnabled(boolean nullHandlingEnabled) {
    _nullHandlingEnabled = nullHandlingEnabled;
  }

  public boolean isOptimizeDictionary() {
    return _optimizeDictionary;
  }

  public void setOptimizeDictionary(boolean optimizeDictionary) {
    _optimizeDictionary = optimizeDictionary;
  }

  public boolean isOptimizeDictionaryForMetrics() {
    return _optimizeDictionaryForMetrics;
  }

  public void setOptimizeDictionaryForMetrics(boolean optimizeDictionaryForMetrics) {
    _optimizeDictionaryForMetrics = optimizeDictionaryForMetrics;
  }

  public double getNoDictionarySizeRatioThreshold() {
    return _noDictionarySizeRatioThreshold;
  }

  public void setNoDictionarySizeRatioThreshold(double noDictionarySizeRatioThreshold) {
    _noDictionarySizeRatioThreshold = noDictionarySizeRatioThreshold;
  }

  public String getSegmentNameGeneratorType() {
    return _segmentNameGeneratorType;
  }

  public void setSegmentNameGeneratorType(String segmentNameGeneratorType) {
    _segmentNameGeneratorType = segmentNameGeneratorType;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy