public void removeOwnedServiceUnit(NamespaceBundle nsBundle) throws Exception { ownershipCache.removeOwnership(nsBundle).get(cacheTimeOutInSec, SECONDS); bundleFactory.invalidateBundleCache(nsBundle.getNamespaceObject()); }
public Map<String, NamespaceOwnershipStatus> getOwnedNameSpacesStatus() throws Exception { NamespaceIsolationPolicies nsIsolationPolicies = this.getLocalNamespaceIsolationPolicies(); Map<String, NamespaceOwnershipStatus> ownedNsStatus = new HashMap<String, NamespaceOwnershipStatus>(); for (OwnedBundle nsObj : this.ownershipCache.getOwnedBundles().values()) { NamespaceOwnershipStatus nsStatus = this.getNamespaceOwnershipStatus(nsObj, nsIsolationPolicies.getPolicyByNamespace(nsObj.getNamespaceBundle().getNamespaceObject())); ownedNsStatus.put(nsObj.getNamespaceBundle().toString(), nsStatus); } return ownedNsStatus; }
public void refreshTopicToStatsMaps(NamespaceBundle oldBundle) { checkNotNull(oldBundle); try { // retrieve all topics under existing old bundle List<PersistentTopic> topics = getAllTopicsFromNamespaceBundle(oldBundle.getNamespaceObject().toString(), oldBundle.toString()); if (!isEmpty(topics)) { // add topic under new split bundles which already updated into NamespaceBundleFactory.bundleCache topics.stream().forEach(t -> { addTopicToStatsMaps(DestinationName.get(t.getName()), t); }); // remove old bundle from the map synchronized (multiLayerTopicsMap) { multiLayerTopicsMap.get(oldBundle.getNamespaceObject().toString()).remove(oldBundle.toString()); } } } catch (Exception e) { log.warn("Got exception while refreshing topicStats map", e); } }
throws Exception { checkNotNull(targetBundle, "can't split null bundle"); checkNotNull(targetBundle.getNamespaceObject(), "namespace must be present"); NamespaceName nsname = targetBundle.getNamespaceObject(); NamespaceBundles sourceBundle = bundlesCache.synchronous().get(nsname);
LOG.info("Loading all topics on bundle: {}", bundle); NamespaceName nsName = bundle.getNamespaceObject(); List<CompletableFuture<Topic>> persistentTopics = Lists.newArrayList(); long topicLoadStart = System.nanoTime();
checkNotNull(splittedBundles.getRight()); checkArgument(splittedBundles.getRight().size() == 2, "bundle has to be split in two bundles"); NamespaceName nsname = bundle.getNamespaceObject(); try {