Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,22 @@ protected TableConfig createDedupTableConfig(File sampleAvroFile, String primary
columnPartitionConfigMap.put(primaryKeyColumn, new ColumnPartitionConfig("Murmur", numPartitions));

return new TableConfigBuilder(TableType.REALTIME).setTableName(getTableName())
.setTimeColumnName(getTimeColumnName()).setFieldConfigList(getFieldConfigs()).setNumReplicas(getNumReplicas())
.setSegmentVersion(getSegmentVersion()).setLoadMode(getLoadMode()).setTaskConfig(getTaskConfig())
.setBrokerTenant(getBrokerTenant()).setServerTenant(getServerTenant()).setIngestionConfig(getIngestionConfig())
.setStreamConfigs(getStreamConfigs()).setNullHandlingEnabled(getNullHandlingEnabled()).setRoutingConfig(
.setTimeColumnName(getTimeColumnName())
.setFieldConfigList(getFieldConfigs())
.setNumReplicas(getNumReplicas())
.setSegmentVersion(getSegmentVersion())
.setLoadMode(getLoadMode())
.setTaskConfig(getTaskConfig())
.setBrokerTenant(getBrokerTenant())
.setServerTenant(getServerTenant())
.setIngestionConfig(getIngestionConfig())
.setNullHandlingEnabled(getNullHandlingEnabled())
.setRoutingConfig(
new RoutingConfig(null, null, RoutingConfig.STRICT_REPLICA_GROUP_INSTANCE_SELECTOR_TYPE, false))
.setSegmentPartitionConfig(new SegmentPartitionConfig(columnPartitionConfigMap))
.setReplicaGroupStrategyConfig(new ReplicaGroupStrategyConfig(primaryKeyColumn, 1))
.setDedupConfig(new DedupConfig()).build();
.setDedupConfig(new DedupConfig())
.build();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import org.apache.pinot.spi.config.table.SegmentPartitionConfig;
import org.apache.pinot.spi.config.table.TableConfig;
import org.apache.pinot.spi.config.table.TableType;
import org.apache.pinot.spi.config.table.ingestion.IngestionConfig;
import org.apache.pinot.spi.config.table.ingestion.ParallelSegmentConsumptionPolicy;
import org.apache.pinot.spi.config.table.ingestion.StreamIngestionConfig;
import org.apache.pinot.spi.data.Schema;
import org.apache.pinot.spi.utils.Enablement;
import org.apache.pinot.spi.utils.StringUtil;
Expand All @@ -45,7 +48,7 @@
import static org.testng.Assert.assertEquals;


public class DedupIntegrationTest extends BaseClusterIntegrationTestSet {
public class BaseDedupIntegrationTest extends BaseClusterIntegrationTestSet {

private List<File> _avroFiles;
private static final String DEDUP_TABLE_WITH_REPLICAS = "DedupTableWithReplicas_REALTIME";
Expand Down Expand Up @@ -87,6 +90,17 @@ public void createDedupConfigsWithReplicas()
waitForDocsLoaded(600_000L, true, DEDUP_TABLE_WITH_REPLICAS);
}

@Override
protected IngestionConfig getIngestionConfig() {
IngestionConfig ingestionConfig = new IngestionConfig();
ingestionConfig.setStreamIngestionConfig(new StreamIngestionConfig(List.of(getStreamConfigs())));
assert ingestionConfig.getStreamIngestionConfig() != null;
ingestionConfig.getStreamIngestionConfig()
.setParallelSegmentConsumptionPolicy(ParallelSegmentConsumptionPolicy.ALLOW_DURING_BUILD_ONLY);
ingestionConfig.getStreamIngestionConfig().setEnforceConsumptionInOrder(true);
return ingestionConfig;
}

/**
* Creates a new Dedup enabled table config with replication=2 and metadatTTL=30
*/
Expand All @@ -100,13 +114,21 @@ protected TableConfig createDedupTableWithReplicas(File sampleAvroFile, String p
dedupConfig.setMetadataTTL(30);
dedupConfig.setPreload(Enablement.ENABLE);
return new TableConfigBuilder(TableType.REALTIME).setTableName("DedupTableWithReplicas_REALTIME")
.setTimeColumnName(getTimeColumnName()).setFieldConfigList(getFieldConfigs()).setNumReplicas(2)
.setSegmentVersion(getSegmentVersion()).setLoadMode(getLoadMode()).setTaskConfig(getTaskConfig())
.setBrokerTenant(getBrokerTenant()).setServerTenant(getServerTenant()).setIngestionConfig(getIngestionConfig())
.setStreamConfigs(getStreamConfigs()).setNullHandlingEnabled(getNullHandlingEnabled()).setRoutingConfig(
.setTimeColumnName(getTimeColumnName())
.setFieldConfigList(getFieldConfigs())
.setNumReplicas(2)
.setSegmentVersion(getSegmentVersion())
.setLoadMode(getLoadMode())
.setTaskConfig(getTaskConfig())
.setBrokerTenant(getBrokerTenant())
.setServerTenant(getServerTenant())
.setIngestionConfig(getIngestionConfig())
.setNullHandlingEnabled(getNullHandlingEnabled())
.setRoutingConfig(
new RoutingConfig(null, null, RoutingConfig.STRICT_REPLICA_GROUP_INSTANCE_SELECTOR_TYPE, false))
.setSegmentPartitionConfig(new SegmentPartitionConfig(columnPartitionConfigMap))
.setReplicaGroupStrategyConfig(new ReplicaGroupStrategyConfig(primaryKeyColumn, 2)).setDedupConfig(dedupConfig)
.setReplicaGroupStrategyConfig(new ReplicaGroupStrategyConfig(primaryKeyColumn, 2))
.setDedupConfig(dedupConfig)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import org.apache.pinot.spi.config.table.SegmentPartitionConfig;
import org.apache.pinot.spi.config.table.TableConfig;
import org.apache.pinot.spi.config.table.TableType;
import org.apache.pinot.spi.config.table.ingestion.IngestionConfig;
import org.apache.pinot.spi.config.table.ingestion.ParallelSegmentConsumptionPolicy;
import org.apache.pinot.spi.config.table.ingestion.StreamIngestionConfig;
import org.apache.pinot.spi.data.Schema;
import org.apache.pinot.spi.env.PinotConfiguration;
import org.apache.pinot.spi.utils.CommonConstants.Server;
Expand Down Expand Up @@ -144,6 +147,16 @@ public void testValues()
}
}

@Override
protected IngestionConfig getIngestionConfig() {
IngestionConfig ingestionConfig = new IngestionConfig();
ingestionConfig.setStreamIngestionConfig(new StreamIngestionConfig(List.of(getStreamConfigs())));
ingestionConfig.getStreamIngestionConfig()
.setParallelSegmentConsumptionPolicy(ParallelSegmentConsumptionPolicy.ALLOW_DURING_BUILD_ONLY);
ingestionConfig.getStreamIngestionConfig().setEnforceConsumptionInOrder(true);
return ingestionConfig;
}

@Override
protected TableConfig createDedupTableConfig(File sampleAvroFile, String primaryKeyColumn, int numPartitions) {
AvroFileSchemaKafkaAvroMessageDecoder._avroFile = sampleAvroFile;
Expand All @@ -154,13 +167,21 @@ protected TableConfig createDedupTableConfig(File sampleAvroFile, String primary
dedupConfig.setPreload(Enablement.ENABLE);

return new TableConfigBuilder(TableType.REALTIME).setTableName(getTableName())
.setTimeColumnName(getTimeColumnName()).setFieldConfigList(getFieldConfigs()).setNumReplicas(getNumReplicas())
.setSegmentVersion(getSegmentVersion()).setLoadMode(getLoadMode()).setTaskConfig(getTaskConfig())
.setBrokerTenant(getBrokerTenant()).setServerTenant(getServerTenant()).setIngestionConfig(getIngestionConfig())
.setStreamConfigs(getStreamConfigs()).setNullHandlingEnabled(getNullHandlingEnabled()).setRoutingConfig(
.setTimeColumnName(getTimeColumnName())
.setFieldConfigList(getFieldConfigs())
.setNumReplicas(getNumReplicas())
.setSegmentVersion(getSegmentVersion())
.setLoadMode(getLoadMode())
.setTaskConfig(getTaskConfig())
.setBrokerTenant(getBrokerTenant())
.setServerTenant(getServerTenant())
.setIngestionConfig(getIngestionConfig())
.setNullHandlingEnabled(getNullHandlingEnabled())
.setRoutingConfig(
new RoutingConfig(null, null, RoutingConfig.STRICT_REPLICA_GROUP_INSTANCE_SELECTOR_TYPE, false))
.setSegmentPartitionConfig(new SegmentPartitionConfig(columnPartitionConfigMap))
.setReplicaGroupStrategyConfig(new ReplicaGroupStrategyConfig(primaryKeyColumn, 1)).setDedupConfig(dedupConfig)
.setReplicaGroupStrategyConfig(new ReplicaGroupStrategyConfig(primaryKeyColumn, 1))
.setDedupConfig(dedupConfig)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* 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.integration.tests;

import org.apache.pinot.spi.config.table.ingestion.IngestionConfig;


public class PauselessRealtimeIngestionWithDedupIntegrationTest extends BaseDedupIntegrationTest {
@Override
protected IngestionConfig getIngestionConfig() {
IngestionConfig ingestionConfig = super.getIngestionConfig();
assert ingestionConfig != null;
assert ingestionConfig.getStreamIngestionConfig() != null;
ingestionConfig.getStreamIngestionConfig().setPauselessConsumptionEnabled(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not enable rest of the pauseless + dedup configs here like parallel consumption policy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They will be enabled from line 27.
IngestionConfig ingestionConfig = super.getIngestionConfig();

return ingestionConfig;
}
}
Loading