/** * Validates whether this function message should execute in presence of * transaction and HeapCritical members. If the function is the first * operation in a transaction, bootstraps the function. * * @param m * the member the function will be executed on * @throws TransactionException * if more than one nodes are targeted within a transaction * @throws LowMemoryException * if the set contains a heap critical member */ protected final void validateExecution(InternalDistributedMember m) { HeapMemoryMonitor hmm = getGemFireCache().getResourceManager() .getHeapMonitor(); if (optimizeForWrite() && !MemoryThresholds.isLowMemoryExceptionDisabled() && hmm.isMemberHeapCritical(m)) { throw new LowMemoryException(LocalizedStrings .ResourceManager_LOW_MEMORY_FOR_0_FUNCEXEC_MEMBERS_1 .toLocalizedString(new Object[] {this.getClass().getName(), m }), Collections.<DistributedMember> singleton(m)); } }
/** * Validates whether this function message should execute in presence of * transaction and HeapCritical members. If the function is the first * operation in a transaction, bootstraps the function. * * @param m * the member the function will be executed on * @throws TransactionException * if more than one nodes are targeted within a transaction * @throws LowMemoryException * if the set contains a heap critical member */ protected final void validateExecution(InternalDistributedMember m) { HeapMemoryMonitor hmm = getGemFireCache().getResourceManager() .getHeapMonitor(); if (optimizeForWrite() && !MemoryThresholds.isLowMemoryExceptionDisabled() && abortOnLowMemory && hmm.isMemberHeapCritical(m)) { throw new LowMemoryException(LocalizedStrings .ResourceManager_LOW_MEMORY_FOR_0_FUNCEXEC_MEMBERS_1 .toLocalizedString(new Object[] {this.getClass().getName(), m }), Collections.<DistributedMember> singleton(m)); } }
/** * Validates whether this function message should execute in presence of * transaction and HeapCritical members. If the function is the first * operation in a transaction, bootstraps the function. * * @param m * the member the function will be executed on * @throws TransactionException * if more than one nodes are targeted within a transaction * @throws LowMemoryException * if the set contains a heap critical member */ protected final void validateExecution(InternalDistributedMember m) { HeapMemoryMonitor hmm = getGemFireCache().getResourceManager() .getHeapMonitor(); if (optimizeForWrite() && !MemoryThresholds.isLowMemoryExceptionDisabled() && hmm.isMemberHeapCritical(m)) { throw new LowMemoryException(LocalizedStrings .ResourceManager_LOW_MEMORY_FOR_0_FUNCEXEC_MEMBERS_1 .toLocalizedString(new Object[] {this.getClass().getName(), m }), Collections.<DistributedMember> singleton(m)); } }
final GemFireCacheImpl cache = getGemFireCache(); final HeapMemoryMonitor hmm = cache.getResourceManager().getHeapMonitor(); @SuppressWarnings({ "unchecked", "rawtypes" })
/** * Validates whether this function message should execute in presence of * transaction and HeapCritical members. If the function is the first * operation in a transaction, bootstraps the function. * * @param members * the set of members the function will be executed on * @throws TransactionException * if more than one nodes are targeted within a transaction * @throws LowMemoryException * if the set contains a heap critical member */ protected final void validateExecution(Set<DistributedMember> members) { final GemFireCacheImpl cache = getGemFireCache(); final HeapMemoryMonitor hmm = cache.getResourceManager().getHeapMonitor(); @SuppressWarnings({ "unchecked", "rawtypes" }) final Set<InternalDistributedMember> tgtMembers = (Set)members; if (optimizeForWrite() && hmm.containsHeapCriticalMembers(tgtMembers) && !MemoryThresholds.isLowMemoryExceptionDisabled()) { final Set<InternalDistributedMember> hcm = cache.getResourceAdvisor() .adviseCritialMembers(); @SuppressWarnings("unchecked") final Set<DistributedMember> sm = new THashSet(4); GemFireXDUtils.setIntersect(hcm, tgtMembers, sm); throw new LowMemoryException(LocalizedStrings .ResourceManager_LOW_MEMORY_FOR_0_FUNCEXEC_MEMBERS_1 .toLocalizedString(new Object[] { this.getClass().getName(), sm }), sm); } }
/** * Validates whether this function message should execute in presence of * transaction and HeapCritical members. If the function is the first * operation in a transaction, bootstraps the function. * * @param members * the set of members the function will be executed on * @throws TransactionException * if more than one nodes are targeted within a transaction * @throws LowMemoryException * if the set contains a heap critical member */ protected final void validateExecution(Set<DistributedMember> members) { final GemFireCacheImpl cache = getGemFireCache(); final HeapMemoryMonitor hmm = cache.getResourceManager().getHeapMonitor(); @SuppressWarnings({ "unchecked", "rawtypes" }) final Set<InternalDistributedMember> tgtMembers = (Set)members; if (optimizeForWrite() && hmm.containsHeapCriticalMembers(tgtMembers) && !MemoryThresholds.isLowMemoryExceptionDisabled()) { final Set<InternalDistributedMember> hcm = cache.getResourceAdvisor() .adviseCritialMembers(); @SuppressWarnings("unchecked") final Set<DistributedMember> sm = new THashSet(4); GemFireXDUtils.setIntersect(hcm, tgtMembers, sm); throw new LowMemoryException(LocalizedStrings .ResourceManager_LOW_MEMORY_FOR_0_FUNCEXEC_MEMBERS_1 .toLocalizedString(new Object[] { this.getClass().getName(), sm }), sm); } }