/** * Returns true if a flush for any pending transactional operations (when * batching is on) before execution of the function. Normally GemFireXD * distributed functions that do the updates will not require this flag since * local coordinator node will be preferred for any transaction updates for * which the node is a replica. * * TODO: TX: Ensure the above and use this flag to skip flush. Right now we * always go to primaries for updates. */ protected boolean requiresTXFlushBeforeExecution() { return optimizeForWrite(); }
/** * Returns true if a flush for any pending transactional operations (when * batching is on) after execution of the function on the execution node * before sending lastResult. */ protected boolean requiresTXFlushAfterExecution() { // normally we always require a flush if message is using transaction proxy // and thus has some operations that are batched return optimizeForWrite(); }
/** * @see TransactionMessage#useTransactionProxy() */ @Override public boolean useTransactionProxy() { return optimizeForWrite(); }
/** * Returns true if a flush for any pending transactional operations (when * batching is on) after execution of the function on the execution node * before sending lastResult. */ protected boolean requiresTXFlushAfterExecution() { // normally we always require a flush if message is using transaction proxy // and thus has some operations that are batched return optimizeForWrite(); }
/** * @see TransactionMessage#useTransactionProxy() */ @Override public boolean useTransactionProxy() { return optimizeForWrite(); }
/** * @see TransactionMessage#useTransactionProxy() */ @Override public boolean useTransactionProxy() { return optimizeForWrite(); }
/** * Returns true if a flush for any pending transactional operations (when * batching is on) after execution of the function on the execution node * before sending lastResult. */ protected boolean requiresTXFlushAfterExecution() { // normally we always require a flush if message is using transaction proxy // and thus has some operations that are batched return optimizeForWrite(); }
/** * Returns true if a flush for any pending transactional operations (when * batching is on) before execution of the function. Normally GemFireXD * distributed functions that do the updates will not require this flag since * local coordinator node will be preferred for any transaction updates for * which the node is a replica. * * TODO: TX: Ensure the above and use this flag to skip flush. Right now we * always go to primaries for updates. */ protected boolean requiresTXFlushBeforeExecution() { return optimizeForWrite(); }
/** * Returns true if a flush for any pending transactional operations (when * batching is on) before execution of the function. Normally GemFireXD * distributed functions that do the updates will not require this flag since * local coordinator node will be preferred for any transaction updates for * which the node is a replica. * * TODO: TX: Ensure the above and use this flag to skip flush. Right now we * always go to primaries for updates. */ protected boolean requiresTXFlushBeforeExecution() { return optimizeForWrite(); }
/** * 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)); } }
/** * 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)); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) final Set<InternalDistributedMember> tgtMembers = (Set)members; if (optimizeForWrite() && abortOnLowMemory && hmm.containsHeapCriticalMembers(tgtMembers) && !MemoryThresholds.isLowMemoryExceptionDisabled()) {
/** * 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); } }
primaryOnly = ((GfxdFunctionMessage<?>)fc).optimizeForWrite();
primaryOnly = ((GfxdFunctionMessage<?>)fc).optimizeForWrite();
if (msg.optimizeForWrite() && msg.isTransactional()) { throw StandardException.newException( SQLState.DATA_CONTAINER_CLOSED, e,
if (msg.optimizeForWrite() && msg.isTransactional()) { throw StandardException.newException( SQLState.DATA_CONTAINER_CLOSED, e,
if (msg.optimizeForWrite() && msg.isTransactional()) { throw StandardException.newException( SQLState.DATA_CONTAINER_CLOSED, e,