public Set adviseAllPRNodes() { return adviseFilter(new Filter() { public boolean include(Profile profile) { CacheProfile prof = (CacheProfile)profile; return prof.isPartitioned; } }); }
public Set adviseAllPRNodes() { return adviseFilter(new Filter() { public boolean include(Profile profile) { CacheProfile prof = (CacheProfile)profile; return prof.isPartitioned; } }); }
/** * Returns the set of data stores that have finished initialization. */ public Set<InternalDistributedMember> adviseInitializedDataStore() { Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; return p.isDataStore && (!p.dataPolicy.withPersistence() || p.regionInitialized); } return false; } }); return s; }
/** * Returns the set of members that are not arrived at specified shutDownAll status */ public Set<InternalDistributedMember> adviseNotAtShutDownAllStatus(final int status) { Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; return p.isDataStore && p.shutDownAllStatus < status; } return false; } }); return s; }
/** * Returns the set of data stores that have finished initialization. */ public Set<InternalDistributedMember> adviseInitializedDataStore() { Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; return p.isDataStore && (!p.dataPolicy.withPersistence() || p.regionInitialized); } return false; } }); return s; }
/** * Returns the set of members that are not arrived at specified shutDownAll status */ public Set<InternalDistributedMember> adviseNotAtShutDownAllStatus(final int status) { Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; return p.isDataStore && p.shutDownAllStatus < status; } return false; } }); return s; }
/** * return the set of all members who must receive operation notifications * @since 5.1 * */ public Set adviseRequiresNotification(final EntryEventImpl event) { return adviseFilter(new Filter() { public boolean include(Profile profile) { if (profile instanceof PartitionProfile) { PartitionProfile prof = (PartitionProfile)profile; if (prof.isPartitioned) { if (prof.hasCacheListener) { InterestPolicy pol = prof.subscriptionAttributes.getInterestPolicy(); if (pol == InterestPolicy.ALL) { return true; } } if (prof.requiresNotification) { return true; } return false; } } return false; } }); }
return adviseFilter(new Filter() { public boolean include(Profile profile) { if (profile instanceof PartitionProfile) {
public long adviseTotalMemoryAllocation() { final AtomicInteger total = new AtomicInteger(); adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; total.addAndGet(p.localMaxMemory); } return false; } }); return total.get(); }
public long adviseTotalMemoryAllocation() { final AtomicLong total = new AtomicLong(); adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; total.addAndGet(p.localMaxMemory); } return false; } }); return total.get(); }
public long adviseTotalMemoryAllocationForFPR() { final AtomicLong total = new AtomicLong(); adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; if (p.fixedPAttrs != null) { total.addAndGet(p.localMaxMemory); } } return false; } }); return total.get(); }
/** * TODO remove this when Primary Bucket impl. is permanently in place * @param limitNodeList * @return the node?? */ public Node adviseSmallestDataStore(final List limitNodeList) { final HashMap filtSet = new HashMap(limitNodeList.size()); Node n = null; for(Iterator filtI = limitNodeList.iterator(); filtI.hasNext(); ) { n = (Node) filtI.next(); filtSet.put(n.getMemberId(), n); } final Object[] smallest = new Object[1]; adviseFilter(new Filter() { short numBucks = Short.MAX_VALUE; public boolean include(Profile profile) { if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; if (filtSet.containsKey(p.getDistributedMember()) && p.numBuckets < this.numBucks) { smallest[0] = p.getDistributedMember(); this.numBucks = p.numBuckets; } } return false; } }); return (Node) filtSet.get(smallest[0]); }
/** * TODO remove this when Primary Bucket impl. is permanently in place * @param limitNodeList * @return the node?? */ public Node adviseSmallestDataStore(final List limitNodeList) { final HashMap filtSet = new HashMap(limitNodeList.size()); Node n = null; for(Iterator filtI = limitNodeList.iterator(); filtI.hasNext(); ) { n = (Node) filtI.next(); filtSet.put(n.getMemberId(), n); } final Object[] smallest = new Object[1]; adviseFilter(new Filter() { short numBucks = Short.MAX_VALUE; public boolean include(Profile profile) { if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; if (filtSet.containsKey(p.getDistributedMember()) && p.numBuckets < this.numBucks) { smallest[0] = p.getDistributedMember(); this.numBucks = p.numBuckets; } } return false; } }); return (Node) filtSet.get(smallest[0]); }
/** * Return a real Set if set to true, which can be modified * @param realHashSet true if a real set is needed * @return depending on the realHashSet value may be a HashSet */ public Set<InternalDistributedMember> adviseDataStore(boolean realHashSet) { Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; return p.isDataStore; } return false; } }); if (realHashSet) { if (s == Collections.EMPTY_SET) { s = new HashSet<InternalDistributedMember>(); } } if (logger.isTraceEnabled(LogMarker.DA)) { logger.trace(LogMarker.DA, "adviseDataStore returning {} from {}", s, toStringWithProfiles()); } return s; }
Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) {
public List<DistributedMember> orderDataStoresUsingBucketCount(final Set nodes) { final Set<NodeBucketSize> orderedSet = new TreeSet<NodeBucketSize>(); final List<DistributedMember> orderedList = new ArrayList<DistributedMember>(); final DistributedMember self = getDistributionManager().getDistributionManagerId(); adviseFilter(new Filter() { public boolean include(Profile profile) { if (profile instanceof PartitionProfile && nodes.contains(profile.getDistributedMember())) { PartitionProfile p = (PartitionProfile)profile; orderedSet.add(new NodeBucketSize(p.numBuckets, p .getDistributedMember())); return true; } else if (profile instanceof PartitionProfile && nodes.contains(self)) { orderedSet.add(new NodeBucketSize(getBucketSet().size(), self)); return true; } return false; } }); if (nodes.contains(self) && !orderedSet.contains(new NodeBucketSize(getBucketSet().size(), self))){ orderedSet.add(new NodeBucketSize(getBucketSet().size(),self)); } for (NodeBucketSize node : orderedSet) { orderedList.add(node.member); } return orderedList; }
public List<DistributedMember> orderDataStoresUsingBucketCount(final Set nodes) { final Set<NodeBucketSize> orderedSet = new TreeSet<NodeBucketSize>(); final List<DistributedMember> orderedList = new ArrayList<DistributedMember>(); final DistributedMember self = getDistributionManager().getDistributionManagerId(); adviseFilter(new Filter() { public boolean include(Profile profile) { if (profile instanceof PartitionProfile && nodes.contains(profile.getDistributedMember())) { PartitionProfile p = (PartitionProfile)profile; orderedSet.add(new NodeBucketSize(p.numBuckets, p .getDistributedMember())); return true; } else if (profile instanceof PartitionProfile && nodes.contains(self)) { orderedSet.add(new NodeBucketSize(getBucketSet().size(), self)); return true; } return false; } }); if (nodes.contains(self) && !orderedSet.contains(new NodeBucketSize(getBucketSet().size(), self))){ orderedSet.add(new NodeBucketSize(getBucketSet().size(),self)); } for (NodeBucketSize node : orderedSet) { orderedList.add(node.member); } return orderedList; }
adviseFilter(new Filter() { public boolean include(Profile profile) { if (profile instanceof PartitionProfile) {
/** * Return a real Set if set to true, which can be modified * @param realHashSet true if a real set is needed * @return depending on the realHashSet value may be a HashSet */ public Set<InternalDistributedMember> adviseDataStore(boolean realHashSet) { Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile)profile; return p.isDataStore; } return false; } }); if (realHashSet) { if (s == Collections.EMPTY_SET) { s = new THashSet(); } } if (VERBOSE) { getLogWriter().info( LocalizedStrings.ONE_ARG, "adviseDataStore returning " + s + " from " + toStringWithProfiles()); } return s; }
Set<InternalDistributedMember> s = adviseFilter(new Filter() { public boolean include(Profile profile) {