zhtaoxiang commented on code in PR #13636: URL: https://github.com/apache/pinot/pull/13636#discussion_r1717587840
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/dedup/BaseTableDedupMetadataManager.java: ########## @@ -19,39 +19,60 @@ package org.apache.pinot.segment.local.dedup; import com.google.common.base.Preconditions; +import java.io.IOException; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.collections4.CollectionUtils; import org.apache.pinot.common.metrics.ServerMetrics; import org.apache.pinot.segment.local.data.manager.TableDataManager; import org.apache.pinot.spi.config.table.DedupConfig; -import org.apache.pinot.spi.config.table.HashFunction; import org.apache.pinot.spi.config.table.TableConfig; import org.apache.pinot.spi.data.Schema; -abstract class BaseTableDedupMetadataManager implements TableDedupMetadataManager { +public abstract class BaseTableDedupMetadataManager implements TableDedupMetadataManager { protected final Map<Integer, PartitionDedupMetadataManager> _partitionMetadataManagerMap = new ConcurrentHashMap<>(); protected String _tableNameWithType; - protected List<String> _primaryKeyColumns; - protected ServerMetrics _serverMetrics; - protected HashFunction _hashFunction; + protected DedupContext _dedupContext; @Override public void init(TableConfig tableConfig, Schema schema, TableDataManager tableDataManager, ServerMetrics serverMetrics) { _tableNameWithType = tableConfig.getTableName(); - _primaryKeyColumns = schema.getPrimaryKeyColumns(); - Preconditions.checkArgument(!CollectionUtils.isEmpty(_primaryKeyColumns), + List<String> primaryKeyColumns = schema.getPrimaryKeyColumns(); + Preconditions.checkArgument(!CollectionUtils.isEmpty(primaryKeyColumns), "Primary key columns must be configured for dedup enabled table: %s", _tableNameWithType); - _serverMetrics = serverMetrics; - DedupConfig dedupConfig = tableConfig.getDedupConfig(); Preconditions.checkArgument(dedupConfig != null, "Dedup must be enabled for table: %s", _tableNameWithType); - _hashFunction = dedupConfig.getHashFunction(); + double metadataTTL = dedupConfig.getMetadataTTL(); + String dedupTimeColumn = dedupConfig.getDedupTimeColumn(); + if (metadataTTL > 0) { + dedupTimeColumn = dedupConfig.getDedupTimeColumn(); Review Comment: good catch! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org