BewareMyPower commented on PR #24293:
URL: https://github.com/apache/pulsar/pull/24293#issuecomment-2876333380

   I agree with @AuroraTwinkle.
   
   It's not a public API like methods in `pulsar-client-api` though it's a 
public method. Adding the `Async` suffix everywhere breaks the beauty of the 
code.
   
   I think the root cause is that `NamespaceService` is designed to have both 
asynchronous and synchronous methods, so it adopts similar naming rules with 
the client APIs.
   
   If I reviewed this PR in time, I would definitely leave a requested change 
to prevent merging it. The reason is that once such a PR was merged, there 
could be much more meaningless PRs doing the similar thing.
   
   ```java
   % grep "public CompletableFuture" 
pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
 | grep -v Async
       public CompletableFuture<String> getHeartbeatOrSLAMonitorBrokerId(
       public CompletableFuture<LookupResult> createLookupResult(String 
candidateBroker, boolean authoritativeRedirect,
       public CompletableFuture<Void> unloadNamespaceBundle(NamespaceBundle 
bundle) {
       public CompletableFuture<Void> unloadNamespaceBundle(NamespaceBundle 
bundle, Optional<String> destinationBroker) {
       public CompletableFuture<Void> unloadNamespaceBundle(NamespaceBundle 
bundle,
       public CompletableFuture<Void> unloadNamespaceBundle(NamespaceBundle 
bundle,
       public CompletableFuture<Void> unloadNamespaceBundle(NamespaceBundle 
bundle,
       public CompletableFuture<Void> unloadNamespaceBundle(NamespaceBundle 
bundle,
       public CompletableFuture<Boolean> isNamespaceBundleOwned(NamespaceBundle 
bundle) {
       public CompletableFuture<Void> splitAndOwnBundle(NamespaceBundle bundle, 
boolean unload,
       public CompletableFuture<Pair<NamespaceBundles, List<NamespaceBundle>>> 
getSplitBoundary(
       public CompletableFuture<List<Long>> getSplitBoundary(
       public CompletableFuture<Void> 
updateNamespaceBundlesForPolicies(NamespaceName nsname,
       public CompletableFuture<Void> updateNamespaceBundles(NamespaceName 
nsname, NamespaceBundles nsBundles) {
       public CompletableFuture<Boolean> checkTopicOwnership(TopicName 
topicName) {
       public CompletableFuture<List<String>> getFullListOfTopics(NamespaceName 
namespaceName) {
       public CompletableFuture<List<String>> 
getFullListOfPartitionedTopic(NamespaceName namespaceName) {
       public CompletableFuture<List<String>> 
getOwnedTopicListForNamespaceBundle(NamespaceBundle bundle) {
       public CompletableFuture<TopicExistsInfo> checkTopicExists(TopicName 
topic) {
       public CompletableFuture<Boolean> 
checkNonPartitionedTopicExists(TopicName topic) {
       public CompletableFuture<Boolean> 
checkNonPersistentNonPartitionedTopicExists(String topic) {
       public CompletableFuture<List<String>> getListOfTopics(NamespaceName 
namespaceName, Mode mode) {
       public CompletableFuture<List<String>> getListOfUserTopics(NamespaceName 
namespaceName, Mode mode) {
       public CompletableFuture<List<String>> getAllPartitions(NamespaceName 
namespaceName) {
       public CompletableFuture<List<String>> getPartitions(NamespaceName 
namespaceName, TopicDomain topicDomain) {
       public CompletableFuture<List<String>> 
getListOfPersistentTopics(NamespaceName namespaceName) {
       public CompletableFuture<List<String>> 
getListOfNonPersistentTopics(NamespaceName namespaceName) {
   ```
   
   We should avoid encouraging new guys pushing similar PRs like:
   - Add `Async` to `getListOfTopics`
   - Add `Async` to `getListOfUserTopics`
   - ...


-- 
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]

Reply via email to