From 50d3b2caa861ad16ff82d73689adad747b02d6da Mon Sep 17 00:00:00 2001 From: Nisarg Thakkar Date: Thu, 22 Aug 2024 11:14:12 -0700 Subject: [PATCH] Address review comments --- .../src/main/java/com/linkedin/venice/ConfigKeys.java | 1 + .../java/com/linkedin/venice/meta/HybridStoreConfig.java | 4 ++-- .../java/com/linkedin/venice/utils/PartitionUtils.java | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/venice-common/src/main/java/com/linkedin/venice/ConfigKeys.java b/internal/venice-common/src/main/java/com/linkedin/venice/ConfigKeys.java index e5647be9f3c..d5f14c73e39 100644 --- a/internal/venice-common/src/main/java/com/linkedin/venice/ConfigKeys.java +++ b/internal/venice-common/src/main/java/com/linkedin/venice/ConfigKeys.java @@ -346,6 +346,7 @@ private ConfigKeys() { /** * Whether the superset schema generation in Primary Controller should be done via passed callback or not. + * @deprecated Use {@link #CONTROLLER_EXTERNAL_SUPERSET_SCHEMA_GENERATION_ENABLED} */ @Deprecated public static final String CONTROLLER_PARENT_EXTERNAL_SUPERSET_SCHEMA_GENERATION_ENABLED = diff --git a/internal/venice-common/src/main/java/com/linkedin/venice/meta/HybridStoreConfig.java b/internal/venice-common/src/main/java/com/linkedin/venice/meta/HybridStoreConfig.java index 3952f8f4a26..cbceaff05c4 100644 --- a/internal/venice-common/src/main/java/com/linkedin/venice/meta/HybridStoreConfig.java +++ b/internal/venice-common/src/main/java/com/linkedin/venice/meta/HybridStoreConfig.java @@ -29,7 +29,7 @@ public interface HybridStoreConfig extends DataModelBackedStructure= 0 && (this.getOffsetLagThresholdToGoOnline() >= 0 - || this.getProducerTimestampLagThresholdToGoOnlineInSeconds() >= 0); + return getRewindTimeInSeconds() >= 0 + && (getOffsetLagThresholdToGoOnline() >= 0 || getProducerTimestampLagThresholdToGoOnlineInSeconds() >= 0); } } diff --git a/internal/venice-common/src/main/java/com/linkedin/venice/utils/PartitionUtils.java b/internal/venice-common/src/main/java/com/linkedin/venice/utils/PartitionUtils.java index c3e84fde88e..fb84adef7e7 100644 --- a/internal/venice-common/src/main/java/com/linkedin/venice/utils/PartitionUtils.java +++ b/internal/venice-common/src/main/java/com/linkedin/venice/utils/PartitionUtils.java @@ -63,14 +63,16 @@ public static int calculatePartitionCount( } else if (partitionCount < minPartitionCount) { partitionCount = minPartitionCount; } + + int returnPartitionCount = partitionCount <= 0 ? 1 : (int) partitionCount; + LOGGER.info( "Assign partition count: {} calculated by storage quota: {} to the new version of store: {}", - partitionCount, + returnPartitionCount, storageQuota, storeName); - // At least 1 partition - return partitionCount <= 0 ? 1 : (int) partitionCount; + return returnPartitionCount; } public static VenicePartitioner getVenicePartitioner(PartitionerConfig config) {