315157973 commented on a change in pull request #9877: URL: https://github.com/apache/pulsar/pull/9877#discussion_r592025051
########## File path: pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/GetTopicsMode.java ########## @@ -0,0 +1,61 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.pulsar.client.admin; + +/** + * Pulsar supports persistent topic and non-persistent topic. + * The GetTopicsMode is used to get persistent/non-persistent topics. + */ +public enum GetTopicsMode { Review comment: Maybe we can reuse the `TopicType` enumeration, when the type is not set, then read all. This is just a suggestion. ########## File path: pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java ########## @@ -90,6 +120,29 @@ */ CompletableFuture<List<String>> getListAsync(String namespace); + /** + * Get the list of topics under a namespace asynchronously. + * <p/> + * Response example: + * + * <pre> + * <code>["topic://my-tenant/my-namespace/topic-1", + * "topic://my-tenant/my-namespace/topic-2"]</code> + * </pre> + * + * @param namespace + * Namespace name + * + * @param mode + * Get topic mode + * use {@link GetTopicsMode#PERSISTENT} to get persistent topics + * use {@link GetTopicsMode#NON_PERSISTENT} to get non-persistent topics Review comment: The non-persistent topic will always return empty, so this interface cannot get the non-Persistent topic ---------------------------------------------------------------- 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]
