Jackie-Jiang commented on code in PR #9849: URL: https://github.com/apache/pinot/pull/9849#discussion_r1030839172
########## pinot-spi/src/main/java/org/apache/pinot/spi/config/table/TableConfig.java: ########## @@ -354,4 +356,31 @@ public Map<String, SegmentAssignmentConfig> getSegmentAssignmentConfigMap() { public void setSegmentAssignmentConfigMap(Map<String, SegmentAssignmentConfig> segmentAssignmentConfigMap) { _segmentAssignmentConfigMap = segmentAssignmentConfigMap; } + + @JsonIgnore + public int getReplicationNumber() { + Preconditions.checkNotNull(_validationConfig, "Validation config should not be null."); Review Comment: (minor) This check is redundant. It is already checked in the constructor ########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java: ########## @@ -813,7 +813,7 @@ public String getTableAggregateMetadata( TableConfig tableConfig = _pinotHelixResourceManager.getTableConfig(tableNameWithType); SegmentsValidationAndRetentionConfig segmentsConfig = tableConfig != null ? tableConfig.getValidationConfig() : null; - int numReplica = segmentsConfig == null ? 1 : Integer.parseInt(segmentsConfig.getReplication()); + int numReplica = segmentsConfig == null ? 1 : tableConfig.getReplicationNumber(); Review Comment: ```suggestion int numReplica = tableConfig == null ? 1 : tableConfig.getReplicationNumber(); ``` ########## pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java: ########## @@ -813,7 +813,7 @@ public String getTableAggregateMetadata( TableConfig tableConfig = _pinotHelixResourceManager.getTableConfig(tableNameWithType); SegmentsValidationAndRetentionConfig segmentsConfig = Review Comment: Remove this line? ########## pinot-spi/src/main/java/org/apache/pinot/spi/config/table/SegmentsValidationAndRetentionConfig.java: ########## @@ -124,6 +124,9 @@ public void setSegmentPushType(String segmentPushType) { _segmentPushType = segmentPushType; } + /** Review Comment: Don't deprecate them. The one in table config is just a helper method. They are also needed for json ser/de ########## pinot-spi/src/main/java/org/apache/pinot/spi/config/table/TableConfig.java: ########## @@ -354,4 +356,31 @@ public Map<String, SegmentAssignmentConfig> getSegmentAssignmentConfigMap() { public void setSegmentAssignmentConfigMap(Map<String, SegmentAssignmentConfig> segmentAssignmentConfigMap) { _segmentAssignmentConfigMap = segmentAssignmentConfigMap; } + + @JsonIgnore + public int getReplicationNumber() { Review Comment: (minor) Rename to `getReplication()` -- 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