-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored PulsarResources to avoid building metadata paths everywhere (
#11693) * Refactored PulsarResources to avoid building metadata paths everywhere * Fixed usages of ZkAdminPaths * Removed unused import * Fixed proxy * Fixed ResourceGroupServiceTest * Added MetadataStore deleteRecursive operation * Fixed merge issues * Use constant * Removed unused import * Fixes for ResourceGroupConfigListenerTest * Fixed cluster resources cleanup * Fixed topic list rest call * Fixed NPE in PersistentDispatcherFailoverConsumerTest setup * Fixed flaky test ReplicatorTest.testRemoveClusterFromNamespace * Fixed handling notification for V1 path namespaces * Fixed LocalPoliciesResources create * Fixed deadlock when making blocking calls from MetadataStore callback thread * Fixed usage of NamespaceName as key * Fixed missing mock in BacklogQuotaManagerConfigurationTest * Fixed RGUsageMTAggrWaitForAllMesgsTest * fixed ServerCnxTest * Fixed mock in PersistentSubscriptionTest * Fixed PersistentTopicTest * Fixed getting partitions list from NamespaceService * Fixed tenant not found expectation * Fixed ProxyConnection to check for existence of auth_data field
- Loading branch information
Showing
60 changed files
with
1,412 additions
and
1,208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/BrokerResources.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* 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.broker.resources; | ||
|
||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.function.Function; | ||
import lombok.Getter; | ||
import org.apache.pulsar.common.policies.data.ClusterData; | ||
import org.apache.pulsar.common.policies.data.FailureDomainImpl; | ||
import org.apache.pulsar.metadata.api.MetadataStore; | ||
import org.apache.pulsar.metadata.api.MetadataStoreException; | ||
|
||
public class BrokerResources extends BaseResources<ClusterData> { | ||
|
||
public BrokerResources(MetadataStore store, int operationTimeoutSec) { | ||
super(store, ClusterData.class, operationTimeoutSec); | ||
} | ||
|
||
public Set<String> listActiveBrokers() throws MetadataStoreException { | ||
return new HashSet<>(super.getChildren(BASE_CLUSTERS_PATH)); | ||
} | ||
} |
Oops, something went wrong.