mcvsubbu commented on a change in pull request #5737: URL: https://github.com/apache/incubator-pinot/pull/5737#discussion_r460340851
########## File path: pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/RealtimeProvisioningHelperCommand.java ########## @@ -158,17 +173,36 @@ public boolean execute() throw new RuntimeException("Exception in reading table config from file " + _tableConfigFile, e); } + StringBuilder note = new StringBuilder(); + note.append("\nNote:\n"); int numReplicas = tableConfig.getValidationConfig().getReplicasPerPartitionNumber(); - if (_retentionHours == 0) { - if (tableConfig.getValidationConfig().getSegmentPushFrequency().equalsIgnoreCase("hourly")) { - _retentionHours = DEFAULT_RETENTION_FOR_HOURLY_PUSH; + int tableRetentionHours = (int) TimeUnit.valueOf(tableConfig.getValidationConfig().getRetentionTimeUnit()) + .toHours(Long.parseLong(tableConfig.getValidationConfig().getRetentionTimeValue())); + if (_retentionHours > 0) { + note.append("\n* Table retention and push frequency ignored for determining retentionHours"); + } else { + if (_pushFrequency == null) { + // This is a realtime-only table. Pick up the retention time + _retentionHours = tableRetentionHours; + note.append("\n* Retention hours taken from tableConfig"); } else { - _retentionHours = DEFAULT_RETENTION_FOR_DAILY_PUSH; + if ("hourly".equalsIgnoreCase(_pushFrequency)) { + _retentionHours = DEFAULT_RETENTION_FOR_HOURLY_PUSH; + } else if ("daily".equalsIgnoreCase(_pushFrequency)) { + _retentionHours = DEFAULT_RETENTION_FOR_DAILY_PUSH; + } else if ("weekly".equalsIgnoreCase(_pushFrequency)) { Review comment: Done ---------------------------------------------------------------- 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. 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