public LocalResultCollector<?, ?> getLocalResultCollector(Function function,
      final ResultCollector<?, ?> rc) {
    if (rc instanceof LocalResultCollector) {
      return (LocalResultCollector) rc;
    } else {
      return new LocalResultCollectorImpl(function, rc, this);
    }
  }
validates whether a function should execute in presence of transaction and HeapCritical
members. If the function is the first operation in a transaction, bootstraps the function.

@param function the function
@param targetMembers 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
geode-core/src/main/java/org/apache/geode/internal/cache/execute/AbstractExecution.java