Skip to content

Commit

Permalink
[cleanup][broker]remove unnecessary variable (apache#17768)
Browse files Browse the repository at this point in the history
* remove unused code

* check style

* remove unused bundleFactory

Co-authored-by: leolinchen <[email protected]>
  • Loading branch information
lordcheng10 and leolinchen authored Sep 22, 2022
1 parent a9531db commit cb7ac2f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ public class OwnershipCache {
*/
private final AsyncLoadingCache<NamespaceBundle, OwnedBundle> ownedBundlesCache;

/**
* The <code>NamespaceBundleFactory</code> to construct <code>NamespaceBundles</code>.
*/
private final NamespaceBundleFactory bundleFactory;

/**
* The <code>NamespaceService</code> which using <code>OwnershipCache</code>.
*/
Expand Down Expand Up @@ -131,7 +126,6 @@ public OwnershipCache(PulsarService pulsar, NamespaceBundleFactory bundleFactory
this.selfOwnerInfoDisabled = new NamespaceEphemeralData(ownerBrokerUrl, ownerBrokerUrlTls,
pulsar.getSafeWebServiceAddress(), pulsar.getWebServiceAddressTls(),
true, pulsar.getAdvertisedListeners());
this.bundleFactory = bundleFactory;
this.lockManager = pulsar.getCoordinationService().getLockManager(NamespaceEphemeralData.class);
this.locallyAcquiredLocks = new ConcurrentHashMap<>();
// ownedBundlesCache contains all namespaces that are owned by the local broker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.apache.pulsar.common.policies.data.BundlesData;
import org.apache.pulsar.common.policies.data.LocalPolicies;
import org.apache.pulsar.common.policies.data.Policies;
import org.apache.pulsar.metadata.api.MetadataCache;
import org.apache.pulsar.metadata.api.Notification;
import org.apache.pulsar.policies.data.loadbalancer.BundleData;
import org.apache.pulsar.stats.CacheMetricsCollector;
Expand All @@ -69,7 +68,6 @@ public class NamespaceBundleFactory {
private final AsyncLoadingCache<NamespaceName, NamespaceBundles> bundlesCache;

private final PulsarService pulsar;
private final MetadataCache<Policies> policiesCache;
private final Duration maxRetryDuration = Duration.ofSeconds(10);

public NamespaceBundleFactory(PulsarService pulsar, HashFunction hashFunc) {
Expand All @@ -84,7 +82,6 @@ public NamespaceBundleFactory(PulsarService pulsar, HashFunction hashFunc) {
pulsar.getLocalMetadataStore().registerListener(this::handleMetadataStoreNotification);

this.pulsar = pulsar;
this.policiesCache = pulsar.getConfigurationMetadataStore().getMetadataCache(Policies.class);
}

private CompletableFuture<NamespaceBundles> loadBundles(NamespaceName namespace, Executor executor) {
Expand Down

0 comments on commit cb7ac2f

Please sign in to comment.