
org.apache.pinot.spi.utils.IngestionConfigUtils 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.utils;
import com.google.common.base.Preconditions;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.pinot.spi.config.table.TableConfig;
import org.apache.pinot.spi.config.table.TableType;
import org.apache.pinot.spi.config.table.ingestion.AggregationConfig;
import org.apache.pinot.spi.config.table.ingestion.BatchIngestionConfig;
import org.apache.pinot.spi.env.PinotConfiguration;
import org.apache.pinot.spi.ingestion.batch.BatchConfigProperties;
/**
* Helper methods for extracting fields from IngestionConfig in a backward compatible manner
*/
public final class IngestionConfigUtils {
private IngestionConfigUtils() {
}
public static final String DOT_SEPARATOR = ".";
private static final String DEFAULT_SEGMENT_NAME_GENERATOR_TYPE =
BatchConfigProperties.SegmentNameGeneratorType.SIMPLE;
private static final String DEFAULT_PUSH_MODE = "tar";
private static final int DEFAULT_PUSH_ATTEMPTS = 5;
private static final int DEFAULT_PUSH_PARALLELISM = 1;
private static final long DEFAULT_PUSH_RETRY_INTERVAL_MILLIS = 1000L;
/**
* Fetches the streamConfig from the given realtime table.
* First, the ingestionConfigs->stream->streamConfigs will be checked.
* If not found, the indexingConfig->streamConfigs will be checked (which is deprecated).
* @param tableConfig realtime table config
* @return streamConfigs map
*/
public static Map getStreamConfigMap(TableConfig tableConfig) {
String tableNameWithType = tableConfig.getTableName();
Preconditions.checkState(tableConfig.getTableType() == TableType.REALTIME,
"Cannot fetch streamConfigs for OFFLINE table: %s", tableNameWithType);
Map streamConfigMap = null;
if (tableConfig.getIngestionConfig() != null
&& tableConfig.getIngestionConfig().getStreamIngestionConfig() != null) {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy