gongxuanzhang commented on code in PR #19702:
URL: https://github.com/apache/kafka/pull/19702#discussion_r2086284493
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java:
##########
@@ -561,10 +561,11 @@ public static void
validateRemoteStorageOnlyIfSystemEnabled(Map<?, ?> props, boo
}
}
- private static void validateNoRemoteStorageForCompactedTopic(Map<?, ?>
props) {
- String cleanupPolicy =
props.get(TopicConfig.CLEANUP_POLICY_CONFIG).toString().toLowerCase(Locale.getDefault());
- if (cleanupPolicy.contains(TopicConfig.CLEANUP_POLICY_COMPACT)) {
- throw new ConfigException("Remote log storage is unsupported for
the compacted topics");
+ @SuppressWarnings("unchecked")
+ private static void
validateRemoteStorageRequiresDeleteCleanupPolicy(Map<?, ?> props) {
+ List<String> cleanupPolicy = (List<String>)
props.get(TopicConfig.CLEANUP_POLICY_CONFIG);
+ if (cleanupPolicy.size() != 1 ||
!cleanupPolicy.get(0).toLowerCase(Locale.getDefault()).equals(TopicConfig.CLEANUP_POLICY_DELETE))
{
+ throw new ConfigException("Remote log storage only supports topics
with cleanup.policy=delete");
Review Comment:
Thanks for your review , I update it
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]