linlinnn commented on a change in pull request #10339:
URL: https://github.com/apache/pulsar/pull/10339#discussion_r619055288



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
##########
@@ -1515,19 +1515,21 @@ public void removeBacklogQuota(@Suspended final 
AsyncResponse asyncResponse,
     public Integer getMessageTTL(@PathParam("tenant") String tenant,
                              @PathParam("namespace") String namespace,
                              @PathParam("topic") @Encoded String encodedTopic,
-                             @QueryParam("applied") boolean applied) {
+                             @DefaultValue("false")@QueryParam("applied") 
boolean applied) {
         validateTopicName(tenant, namespace, encodedTopic);
         preValidation();
-        return getTopicPolicies(topicName)
-                .map(TopicPolicies::getMessageTTLInSeconds)
-                .orElseGet(() -> {
-                    if (applied) {
-                        Integer otherLevelTTL = 
getNamespacePolicies(namespaceName).message_ttl_in_seconds;
-                        return otherLevelTTL == null ? 
pulsar().getConfiguration().getTtlDurationDefaultInSeconds()
-                                : otherLevelTTL;
-                    }
-                    return null;
-                });
+        Optional<Integer> messageTTL = getTopicPolicies(topicName)

Review comment:
       I'm not sure where the difference after this change

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
##########
@@ -1515,19 +1515,21 @@ public void removeBacklogQuota(@Suspended final 
AsyncResponse asyncResponse,
     public Integer getMessageTTL(@PathParam("tenant") String tenant,
                              @PathParam("namespace") String namespace,
                              @PathParam("topic") @Encoded String encodedTopic,
-                             @QueryParam("applied") boolean applied) {
+                             @DefaultValue("false")@QueryParam("applied") 
boolean applied) {

Review comment:
       The primitive type `boolean`'s default value is false.




-- 
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:
[email protected]


Reply via email to