/** * Return true if some other member of the distributed system, not including * self, has a CacheLoader defined on the region. */ public final boolean hasNetLoader(CacheDistributionAdvisor distAdvisor) { return !distAdvisor.accept(netLoaderVisitor, null); }
/** * Return true if some other member of the distributed system, not including * self, has a CacheLoader defined on the region. */ public final boolean hasNetLoader(CacheDistributionAdvisor distAdvisor) { return !distAdvisor.accept(netLoaderVisitor, null); }
/** * Return true if some other member of the distributed system, not including * self, has a CacheWriter defined on the region. */ public final boolean hasNetWriter(CacheDistributionAdvisor distAdvisor) { return !distAdvisor.accept(netWriterVisitor, null); }
/** * Return true if some other member of the distributed system, not including * self, has a CacheWriter defined on the region. */ public final boolean hasNetWriter(CacheDistributionAdvisor distAdvisor) { return !distAdvisor.accept(netWriterVisitor, null); }
public boolean hasUninitializedReplicate() { return !accept(hasUninitializedReplicateVisitor, null); }
/** * Returns true if there does not exist an initialized replicate for this * region not considering this node itself. */ public final boolean noInitializedReplicate() { return getCacheDistributionAdvisor().accept(hasReplicate, null); }
/** * @return a random persistent replicate, null if there is none */ public InternalDistributedMember getRandomPersistentReplicate() { final GetRandomReplicate getPersistentReplicate = new GetRandomReplicate(true); this.getCacheDistributionAdvisor().accept(getPersistentReplicate, null); return getPersistentReplicate.member; }
/** * @return a random replicate, null if there are none */ public InternalDistributedMember getRandomReplicate() { /* [sumedh] The old code causes creation of a unnecessary HashSet * and population with all replicates (which may be large), then * copy into an array and then selection of a random one from that. * The new approach uses a much more efficient visitor instead. Set replicates = this.getCacheDistributionAdvisor().adviseReplicates(); if (replicates.isEmpty()) { return null; } return (InternalDistributedMember)(replicates .toArray()[new Random().nextInt(replicates.size())]); */ final GetRandomReplicate getReplicate = new GetRandomReplicate(); this.getCacheDistributionAdvisor().accept(getReplicate, null); return getReplicate.member; }
/** * @return a random persistent replicate, null if there is none */ public InternalDistributedMember getRandomPersistentReplicate() { final GetRandomReplicate getPersistentReplicate = new GetRandomReplicate(true); this.getCacheDistributionAdvisor().accept(getPersistentReplicate, null); return getPersistentReplicate.getMember(); }
/** * @return a random replicate preferring loader node, if any; null if there * are none */ public InternalDistributedMember getRandomReplicate() { /* [sumedh] The old code causes creation of a unnecessary HashSet * and population with all replicates (which may be large), then * copy into an array and then selection of a random one from that. * The new approach uses a much more efficient visitor instead. Set replicates = this.getCacheDistributionAdvisor().adviseReplicates(); if (replicates.isEmpty()) { return null; } return (InternalDistributedMember)(replicates .toArray()[new Random().nextInt(replicates.size())]); */ final GetRandomReplicate getReplicate = new GetRandomReplicate(); this.getCacheDistributionAdvisor().accept(getReplicate, null); return getReplicate.getMember(); }
final PreferredNodeSelector selectNode = new PreferredNodeSelector( recipients, preferDistribution); if (!dataRegion.getCacheDistributionAdvisor().accept(selectNode, null) || (selectNode.prefNode != null)) { if (!dataRegion.getCacheDistributionAdvisor().accept(selectNode, null) || (selectNode.prefNode != null)) { return selectNode; final PreferredNodeSelector selectNode = new PreferredNodeSelector( recipients, true); if (!dataRegion.getCacheDistributionAdvisor().accept(selectNode, null) || (selectNode.prefNode != null)) { recipients.remove(selectNode.prefNode);
/** * Returns true if there are no data stores available for this region. */ public boolean hasDataStores() { boolean hasStore = true; if (getScope() != Scope.LOCAL) { if (!getDataPolicy().withStorage()) { hasStore = !((DistributedRegion)this).getDistributionAdvisor() .accept(initDataStoreChecker, null); } } else { hasStore = getDataPolicy().withStorage(); } if (!hasStore) { // check if VM is going down before throwing no data store found getCancelCriterion().checkCancelInProgress(null); } final LogWriterI18n logger = getLogWriterI18n(); if (logger.fineEnabled()) { logger.fine("hasStore=" + hasStore + " for " + getFullPath()); } return hasStore; }
.accept(regionVisitor, null)) {