@Override public boolean includes(DestinationName dn) { return this.equals(dn.getNamespaceObject()); } }
public CompletableFuture<NamespaceBundle> getBundleAsync(DestinationName topic) { return bundleFactory.getBundlesAsync(topic.getNamespaceObject()) .thenApply(bundles -> bundles.findBundle(topic)); }
public NamespaceBundle getBundle(DestinationName destination) throws Exception { return bundleFactory.getBundles(destination.getNamespaceObject()).findBundle(destination); }
@Override public boolean includes(DestinationName dn) { if (!this.nsname.equals(dn.getNamespaceObject())) { return false; } return this.keyRange.contains(factory.getLongHashCode(dn.toString())); }
public NamespaceBundle findBundle(DestinationName dn) { checkArgument(this.nsname.equals(dn.getNamespaceObject())); long hashCode = factory.getLongHashCode(dn.toString()); return getBundle(hashCode); }
validateReplicationSettingsOnNamespaceAsync(pulsarService, fqdn.getNamespaceObject()) .thenAccept(success -> {
validateClusterOwnership(topic.getCluster()); checkConnect(topic); validateReplicationSettingsOnNamespace(pulsar(), topic.getNamespaceObject()); } catch (WebApplicationException we) {
public void removeTopicFromCache(String topic) { try { DestinationName destination = DestinationName.get(topic); NamespaceBundle namespaceBundle = pulsar.getNamespaceService().getBundle(destination); checkArgument(namespaceBundle instanceof NamespaceBundle); String bundleName = namespaceBundle.toString(); String namespaceName = destination.getNamespaceObject().toString(); synchronized (multiLayerTopicsMap) { ConcurrentOpenHashMap<String, ConcurrentOpenHashMap<String, PersistentTopic>> namespaceMap = multiLayerTopicsMap .get(namespaceName); ConcurrentOpenHashMap<String, PersistentTopic> bundleMap = namespaceMap.get(bundleName); bundleMap.remove(topic); if (bundleMap.isEmpty()) { namespaceMap.remove(bundleName); } if (namespaceMap.isEmpty()) { multiLayerTopicsMap.remove(namespaceName); final ClusterReplicationMetrics clusterReplicationMetrics = pulsarStats .getClusterReplicationMetrics(); replicationClients.forEach((cluster, client) -> { clusterReplicationMetrics.remove(clusterReplicationMetrics.getKeyName(namespaceName, cluster)); }); } } } catch (Exception e) { log.warn("Got exception when retrieving bundle name during removeTopicFromCache", e); } topics.remove(topic); }
NamespaceName namespace = topicName.getNamespaceObject(); ServiceConfiguration serviceConfig = pulsar.getConfiguration();