Search in sources :

Example 56 with Execution

use of org.apache.geode.cache.execute.Execution in project geode by apache.

the class PRClientServerRegionFunctionExecutionNoSingleHopDUnitTest method serverMultiKeyExecutionNoResult.

public static void serverMultiKeyExecutionNoResult(Boolean isByName) {
    Region region = cache.getRegion(PartitionedRegionName);
    assertNotNull(region);
    final HashSet testKeysSet = new HashSet();
    for (int i = (totalNumBuckets.intValue() * 2); i > 0; i--) {
        testKeysSet.add("execKey-" + i);
    }
    DistributedSystem.setThreadsSocketPolicy(false);
    Function function = new TestFunction(false, TEST_FUNCTION7);
    FunctionService.registerFunction(function);
    Execution dataSet = FunctionService.onRegion(region);
    try {
        String msg = "<ExpectedException action=add>" + "FunctionException" + "</ExpectedException>";
        cache.getLogger().info(msg);
        int j = 0;
        HashSet origVals = new HashSet();
        for (Iterator i = testKeysSet.iterator(); i.hasNext(); ) {
            Integer val = new Integer(j++);
            origVals.add(val);
            region.put(i.next(), val);
        }
        ResultCollector rc1 = execute(dataSet, testKeysSet, Boolean.TRUE, function, isByName);
        rc1.getResult();
        Thread.sleep(20000);
        fail("Test failed after the put operation");
    } catch (FunctionException expected) {
        expected.printStackTrace();
        LogWriterUtils.getLogWriter().info("Exception : " + expected.getMessage());
        assertTrue(expected.getMessage().startsWith((LocalizedStrings.ExecuteFunction_CANNOT_0_RESULTS_HASRESULT_FALSE.toLocalizedString("return any"))));
    } catch (Exception notexpected) {
        Assert.fail("Test failed during execute or sleeping", notexpected);
    } finally {
        cache.getLogger().info("<ExpectedException action=remove>" + "FunctionException" + "</ExpectedException>");
    }
}
Also used : Function(org.apache.geode.cache.execute.Function) TestFunction(org.apache.geode.internal.cache.functions.TestFunction) Execution(org.apache.geode.cache.execute.Execution) TestFunction(org.apache.geode.internal.cache.functions.TestFunction) Iterator(java.util.Iterator) FunctionException(org.apache.geode.cache.execute.FunctionException) Region(org.apache.geode.cache.Region) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) ResultCollector(org.apache.geode.cache.execute.ResultCollector) FunctionInvocationTargetException(org.apache.geode.cache.execute.FunctionInvocationTargetException) ServerException(java.rmi.ServerException) FunctionException(org.apache.geode.cache.execute.FunctionException) SocketException(java.net.SocketException) CacheClosedException(org.apache.geode.cache.CacheClosedException) SocketTimeoutException(java.net.SocketTimeoutException) IOException(java.io.IOException) EOFException(java.io.EOFException) IgnoredException(org.apache.geode.test.dunit.IgnoredException) HashSet(java.util.HashSet)

Example 57 with Execution

use of org.apache.geode.cache.execute.Execution in project geode by apache.

the class SecurityTestUtils method doFunctionExecuteP.

private static void doFunctionExecuteP(final int multiUserIndex, final Function function, int expectedResult, final String method) {
    Region region = null;
    try {
        if (multiUserAuthMode) {
            region = proxyCaches[multiUserIndex].getRegion(REGION_NAME);
        } else {
            region = getCache().getRegion(REGION_NAME);
        }
        assertNotNull(region);
    } catch (Exception ex) {
        if (expectedResult == OTHER_EXCEPTION) {
            getLogWriter().info("Got expected exception when executing function: " + ex);
        } else {
            fail("Got unexpected exception when executing function", ex);
        }
    }
    try {
        FunctionService.registerFunction(function);
        Execution execution = null;
        if ("region".equals(method)) {
            execution = FunctionService.onRegion(region);
        } else if ("server".equals(method)) {
            if (multiUserAuthMode) {
                execution = FunctionService.onServer(proxyCaches[multiUserIndex]);
            } else {
                execution = FunctionService.onServer(pool);
            }
        } else {
            // if ("servers".equals(method)) {
            if (multiUserAuthMode) {
                execution = FunctionService.onServers(proxyCaches[multiUserIndex]);
            } else {
                execution = FunctionService.onServers(pool);
            }
        }
        execution.execute(function.getId());
        if (expectedResult != NO_EXCEPTION) {
            fail("Expected a NotAuthorizedException while executing function");
        }
    } catch (NoAvailableServersException ex) {
        if (expectedResult == NO_AVAILABLE_SERVERS) {
            getLogWriter().info("Got expected NoAvailableServers when executing function: " + ex.getCause());
        } else {
            fail("Got unexpected exception when executing function", ex);
        }
    } catch (ServerConnectivityException ex) {
        if ((expectedResult == NOTAUTHZ_EXCEPTION) && (ex.getCause() instanceof NotAuthorizedException)) {
            getLogWriter().info("Got expected NotAuthorizedException when executing function: " + ex.getCause());
        } else if (expectedResult == OTHER_EXCEPTION) {
            getLogWriter().info("Got expected exception when executing function: " + ex);
        } else {
            fail("Got unexpected exception when executing function", ex);
        }
    } catch (FunctionException ex) {
        // ServerOperationException AND cause.cause is NotAuthorizedException))
        if (expectedResult == NOTAUTHZ_EXCEPTION && (ex.getCause() instanceof NotAuthorizedException || (ex.getCause() instanceof ServerOperationException && ex.getCause().getCause() instanceof NotAuthorizedException))) {
            getLogWriter().info("Got expected NotAuthorizedException when executing function: " + ex.getCause());
        } else if (expectedResult == OTHER_EXCEPTION) {
            getLogWriter().info("Got expected exception when executing function: " + ex);
        } else {
            fail("Got unexpected exception when executing function", ex);
        }
    } catch (Exception ex) {
        if (expectedResult == OTHER_EXCEPTION) {
            getLogWriter().info("Got expected exception when executing function: " + ex);
        } else {
            fail("Got unexpected exception when executing function", ex);
        }
    }
}
Also used : ServerConnectivityException(org.apache.geode.cache.client.ServerConnectivityException) Execution(org.apache.geode.cache.execute.Execution) NoAvailableServersException(org.apache.geode.cache.client.NoAvailableServersException) FunctionException(org.apache.geode.cache.execute.FunctionException) Region(org.apache.geode.cache.Region) ServerOperationException(org.apache.geode.cache.client.ServerOperationException) ServerRefusedConnectionException(org.apache.geode.cache.client.ServerRefusedConnectionException) NoAvailableServersException(org.apache.geode.cache.client.NoAvailableServersException) QueryInvocationTargetException(org.apache.geode.cache.query.QueryInvocationTargetException) FunctionException(org.apache.geode.cache.execute.FunctionException) ServerConnectivityException(org.apache.geode.cache.client.ServerConnectivityException) ServerOperationException(org.apache.geode.cache.client.ServerOperationException) IOException(java.io.IOException)

Example 58 with Execution

use of org.apache.geode.cache.execute.Execution in project geode by apache.

the class DiskStoreCommands method getMissingDiskStoresList.

protected List<Object> getMissingDiskStoresList(Set<DistributedMember> members) {
    final Execution membersFunctionExecutor = getMembersFunctionExecutor(members);
    if (membersFunctionExecutor instanceof AbstractExecution) {
        ((AbstractExecution) membersFunctionExecutor).setIgnoreDepartedMembers(true);
    }
    final ResultCollector<?, ?> resultCollector = membersFunctionExecutor.execute(new ShowMissingDiskStoresFunction());
    final List<?> results = (List<?>) resultCollector.getResult();
    final List<Object> distributedPersistentRecoveryDetails = new ArrayList<Object>(results.size());
    for (final Object result : results) {
        if (result instanceof Set) {
            // ignore FunctionInvocationTargetExceptions and other
            // Exceptions...
            distributedPersistentRecoveryDetails.addAll((Set<Object>) result);
        }
    }
    return distributedPersistentRecoveryDetails;
}
Also used : AbstractExecution(org.apache.geode.internal.cache.execute.AbstractExecution) Execution(org.apache.geode.cache.execute.Execution) AbstractExecution(org.apache.geode.internal.cache.execute.AbstractExecution) Set(java.util.Set) HashSet(java.util.HashSet) ShowMissingDiskStoresFunction(org.apache.geode.management.internal.cli.functions.ShowMissingDiskStoresFunction) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Example 59 with Execution

use of org.apache.geode.cache.execute.Execution in project geode by apache.

the class FunctionCommands method executeFunction.

@CliCommand(value = CliStrings.EXECUTE_FUNCTION, help = CliStrings.EXECUTE_FUNCTION__HELP)
@CliMetaData(relatedTopic = { CliStrings.TOPIC_GEODE_FUNCTION })
@ResourceOperation(resource = Resource.DATA, operation = Operation.WRITE)
public Result executeFunction(// TODO: Add optioncontext for functionID
@CliOption(key = CliStrings.EXECUTE_FUNCTION__ID, mandatory = true, help = CliStrings.EXECUTE_FUNCTION__ID__HELP) String functionId, @CliOption(key = CliStrings.EXECUTE_FUNCTION__ONGROUPS, unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, optionContext = ConverterHint.MEMBERGROUP, help = CliStrings.EXECUTE_FUNCTION__ONGROUPS__HELP) String[] onGroups, @CliOption(key = CliStrings.EXECUTE_FUNCTION__ONMEMBER, unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, optionContext = ConverterHint.MEMBERIDNAME, help = CliStrings.EXECUTE_FUNCTION__ONMEMBER__HELP) String onMember, @CliOption(key = CliStrings.EXECUTE_FUNCTION__ONREGION, unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, optionContext = ConverterHint.REGION_PATH, help = CliStrings.EXECUTE_FUNCTION__ONREGION__HELP) String onRegion, @CliOption(key = CliStrings.EXECUTE_FUNCTION__ARGUMENTS, unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, help = CliStrings.EXECUTE_FUNCTION__ARGUMENTS__HELP) String[] arguments, @CliOption(key = CliStrings.EXECUTE_FUNCTION__RESULTCOLLECTOR, unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, help = CliStrings.EXECUTE_FUNCTION__RESULTCOLLECTOR__HELP) String resultCollector, @CliOption(key = CliStrings.EXECUTE_FUNCTION__FILTER, unspecifiedDefaultValue = CliMetaData.ANNOTATION_NULL_VALUE, help = CliStrings.EXECUTE_FUNCTION__FILTER__HELP) String filterString) {
    Result result = null;
    CompositeResultData executeFunctionResultTable = ResultBuilder.createCompositeResultData();
    TabularResultData resultTable = executeFunctionResultTable.addSection().addTable("Table1");
    String headerText = "Execution summary";
    resultTable.setHeader(headerText);
    ResultCollector resultCollectorInstance = null;
    Function function;
    Set<String> filters = new HashSet<String>();
    Execution execution = null;
    if (functionId != null) {
        functionId = functionId.trim();
    }
    if (onRegion != null) {
        onRegion = onRegion.trim();
    }
    if (onMember != null) {
        onMember = onMember.trim();
    }
    if (filterString != null) {
        filterString = filterString.trim();
    }
    try {
        // validate otherwise return right away. no need to process anything
        if (functionId == null || functionId.length() == 0) {
            ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(CliStrings.EXECUTE_FUNCTION__MSG__MISSING_FUNCTIONID);
            result = ResultBuilder.buildResult(errorResultData);
            return result;
        }
        if (onRegion != null && onMember != null && onGroups != null) {
            ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(CliStrings.EXECUTE_FUNCTION__MSG__OPTIONS);
            result = ResultBuilder.buildResult(errorResultData);
            return result;
        } else if (onRegion != null && onMember != null) {
            ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(CliStrings.EXECUTE_FUNCTION__MSG__OPTIONS);
            result = ResultBuilder.buildResult(errorResultData);
            return result;
        } else if (onMember != null && onGroups != null) {
            ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(CliStrings.EXECUTE_FUNCTION__MSG__OPTIONS);
            result = ResultBuilder.buildResult(errorResultData);
            return result;
        } else if (onRegion != null && onGroups != null) {
            ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(CliStrings.EXECUTE_FUNCTION__MSG__OPTIONS);
            result = ResultBuilder.buildResult(errorResultData);
            return result;
        } else if (onRegion != null && onMember != null && onGroups != null) {
            ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(CliStrings.EXECUTE_FUNCTION__MSG__OPTIONS);
            result = ResultBuilder.buildResult(errorResultData);
            return result;
        } else if ((onRegion == null || onRegion.length() == 0) && (filterString != null)) {
            ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(CliStrings.EXECUTE_FUNCTION__MSG__MEMBER_SHOULD_NOT_HAVE_FILTER_FOR_EXECUTION);
            result = ResultBuilder.buildResult(errorResultData);
            return result;
        }
        InternalCache cache = getCache();
        if (resultCollector != null) {
            resultCollectorInstance = (ResultCollector) ClassPathLoader.getLatest().forName(resultCollector).newInstance();
        }
        if (filterString != null && filterString.length() > 0) {
            filters.add(filterString);
        }
        if (onRegion == null && onMember == null && onGroups == null) {
            // run function on all the members excluding locators bug#46113
            // if user wish to execute on locator then he can choose --member or --group option
            Set<DistributedMember> dsMembers = CliUtil.getAllNormalMembers(cache);
            if (dsMembers.size() > 0) {
                function = new UserFunctionExecution();
                LogWrapper.getInstance().info(CliStrings.format(CliStrings.EXECUTE_FUNCTION__MSG__EXECUTING_0_ON_ENTIRE_DS, functionId));
                for (DistributedMember member : dsMembers) {
                    executeAndGetResults(functionId, filterString, resultCollector, arguments, cache, member, resultTable, onRegion);
                }
                return ResultBuilder.buildResult(resultTable);
            } else {
                return ResultBuilder.createUserErrorResult(CliStrings.EXECUTE_FUNCTION__MSG__DS_HAS_NO_MEMBERS);
            }
        } else if (onRegion != null && onRegion.length() > 0) {
            if (cache.getRegion(onRegion) == null) {
                // find a member where region is present
                DistributedRegionMXBean bean = ManagementService.getManagementService(getCache()).getDistributedRegionMXBean(onRegion);
                if (bean == null) {
                    bean = ManagementService.getManagementService(getCache()).getDistributedRegionMXBean(Region.SEPARATOR + onRegion);
                    if (bean == null) {
                        return ResultBuilder.createGemFireErrorResult(CliStrings.format(CliStrings.EXECUTE_FUNCTION__MSG__MXBEAN_0_FOR_NOT_FOUND, onRegion));
                    }
                }
                DistributedMember member = null;
                String[] membersName = bean.getMembers();
                Set<DistributedMember> dsMembers = CliUtil.getAllMembers(cache);
                Iterator it = dsMembers.iterator();
                boolean matchFound = false;
                if (membersName.length > 0) {
                    while (it.hasNext() && matchFound == false) {
                        DistributedMember dsmember = (DistributedMember) it.next();
                        for (String memberName : membersName) {
                            if (MBeanJMXAdapter.getMemberNameOrId(dsmember).equals(memberName)) {
                                member = dsmember;
                                matchFound = true;
                                break;
                            }
                        }
                    }
                }
                if (matchFound == true) {
                    executeAndGetResults(functionId, filterString, resultCollector, arguments, cache, member, resultTable, onRegion);
                    return ResultBuilder.buildResult(resultTable);
                } else {
                    return ResultBuilder.createGemFireErrorResult(CliStrings.format(CliStrings.EXECUTE_FUNCTION__MSG__NO_ASSOCIATED_MEMBER_REGION, " " + onRegion));
                }
            } else {
                execution = FunctionService.onRegion(cache.getRegion(onRegion));
                if (execution != null) {
                    if (resultCollectorInstance != null) {
                        execution = execution.withCollector(resultCollectorInstance);
                    }
                    if (filters != null && filters.size() > 0) {
                        execution = execution.withFilter(filters);
                    }
                    if (arguments != null && arguments.length > 0) {
                        execution = execution.setArguments(arguments);
                    }
                    try {
                        List<Object> results = (List<Object>) execution.execute(functionId).getResult();
                        if (results.size() > 0) {
                            StringBuilder strResult = new StringBuilder();
                            for (Object obj : results) {
                                strResult.append(obj);
                            }
                            toTabularResultData(resultTable, cache.getDistributedSystem().getDistributedMember().getId(), strResult.toString());
                        }
                        return ResultBuilder.buildResult(resultTable);
                    } catch (FunctionException e) {
                        return ResultBuilder.createGemFireErrorResult(CliStrings.format(CliStrings.EXECUTE_FUNCTION__MSG__ERROR_IN_EXECUTING_0_ON_REGION_1_DETAILS_2, functionId, onRegion, e.getMessage()));
                    }
                } else {
                    return ResultBuilder.createGemFireErrorResult(CliStrings.format(CliStrings.EXECUTE_FUNCTION__MSG__ERROR_IN_EXECUTING_0_ON_REGION_1_DETAILS_2, functionId, onRegion, CliStrings.EXECUTE_FUNCTION__MSG__ERROR_IN_RETRIEVING_EXECUTOR));
                }
            }
        } else if (onGroups != null) {
            // execute on group members
            Set<DistributedMember> dsMembers = new HashSet<DistributedMember>();
            for (String grp : onGroups) {
                dsMembers.addAll(cache.getDistributedSystem().getGroupMembers(grp));
            }
            StringBuilder successMessage = new StringBuilder();
            if (dsMembers.size() > 0) {
                for (DistributedMember member : dsMembers) {
                    executeAndGetResults(functionId, filterString, resultCollector, arguments, cache, member, resultTable, onRegion);
                }
                return ResultBuilder.buildResult(resultTable);
            } else {
                StringBuilder grps = new StringBuilder();
                for (String grp : onGroups) {
                    grps.append(grp);
                    grps.append(", ");
                }
                return ResultBuilder.createUserErrorResult(CliStrings.format(CliStrings.EXECUTE_FUNCTION__MSG__GROUPS_0_HAS_NO_MEMBERS, grps.toString().substring(0, grps.toString().length() - 1)));
            }
        } else if (onMember != null && onMember.length() > 0) {
            // fix for bug
            DistributedMember member = CliUtil.getDistributedMemberByNameOrId(onMember);
            // 45658
            if (member != null) {
                executeAndGetResults(functionId, filterString, resultCollector, arguments, cache, member, resultTable, onRegion);
            } else {
                toTabularResultData(resultTable, onMember, CliStrings.format(CliStrings.EXECUTE_FUNCTION__MSG__NO_ASSOCIATED_MEMBER + " " + onMember));
            }
            return ResultBuilder.buildResult(resultTable);
        }
    } catch (InstantiationException e) {
        ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(e.getMessage());
        result = ResultBuilder.buildResult(errorResultData);
        return result;
    } catch (IllegalAccessException e) {
        ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(e.getMessage());
        result = ResultBuilder.buildResult(errorResultData);
        return result;
    } catch (IllegalArgumentException e) {
        ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(e.getMessage());
        result = ResultBuilder.buildResult(errorResultData);
        return result;
    } catch (SecurityException e) {
        ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(e.getMessage());
        result = ResultBuilder.buildResult(errorResultData);
        return result;
    } catch (Exception e) {
        ErrorResultData errorResultData = ResultBuilder.createErrorResultData().setErrorCode(ResultBuilder.ERRORCODE_DEFAULT).addLine(e.getMessage());
        result = ResultBuilder.buildResult(errorResultData);
        return result;
    }
    return result;
}
Also used : UserFunctionExecution(org.apache.geode.management.internal.cli.functions.UserFunctionExecution) CompositeResultData(org.apache.geode.management.internal.cli.result.CompositeResultData) HashSet(java.util.HashSet) Set(java.util.Set) TabularResultData(org.apache.geode.management.internal.cli.result.TabularResultData) InternalCache(org.apache.geode.internal.cache.InternalCache) GfshParseResult(org.apache.geode.management.internal.cli.GfshParseResult) Result(org.apache.geode.management.cli.Result) CliFunctionResult(org.apache.geode.management.internal.cli.functions.CliFunctionResult) Function(org.apache.geode.cache.execute.Function) ListFunctionFunction(org.apache.geode.management.internal.cli.functions.ListFunctionFunction) UnregisterFunction(org.apache.geode.management.internal.cli.functions.UnregisterFunction) UserFunctionExecution(org.apache.geode.management.internal.cli.functions.UserFunctionExecution) Execution(org.apache.geode.cache.execute.Execution) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) ResultCollector(org.apache.geode.cache.execute.ResultCollector) HashSet(java.util.HashSet) FunctionException(org.apache.geode.cache.execute.FunctionException) DistributedRegionMXBean(org.apache.geode.management.DistributedRegionMXBean) FunctionException(org.apache.geode.cache.execute.FunctionException) CommandResultException(org.apache.geode.management.internal.cli.result.CommandResultException) DistributedMember(org.apache.geode.distributed.DistributedMember) ErrorResultData(org.apache.geode.management.internal.cli.result.ErrorResultData) CliCommand(org.springframework.shell.core.annotation.CliCommand) CliMetaData(org.apache.geode.management.cli.CliMetaData) ResourceOperation(org.apache.geode.management.internal.security.ResourceOperation)

Example 60 with Execution

use of org.apache.geode.cache.execute.Execution in project geode by apache.

the class MiscellaneousCommands method shutdownNode.

public void shutdownNode(final long timeout, final Set<DistributedMember> includeMembers) throws TimeoutException, InterruptedException, ExecutionException {
    ExecutorService exec = Executors.newSingleThreadExecutor();
    try {
        final Function shutDownFunction = new ShutDownFunction();
        logger.info("Gfsh executing shutdown on members " + includeMembers);
        Callable<String> shutdownNodes = new Callable<String>() {

            @Override
            public String call() {
                try {
                    Execution execution = FunctionService.onMembers(includeMembers);
                    execution.execute(shutDownFunction);
                } catch (FunctionException functionEx) {
                // Expected Exception as the function is shutting down the target members and the result
                // collector will get member departed exception
                }
                return "SUCCESS";
            }
        };
        Future<String> result = exec.submit(shutdownNodes);
        result.get(timeout, TimeUnit.MILLISECONDS);
    } catch (TimeoutException te) {
        logger.error("TimeoutException in shutting down members." + includeMembers);
        throw te;
    } catch (InterruptedException e) {
        logger.error("InterruptedException in shutting down members." + includeMembers);
        throw e;
    } catch (ExecutionException e) {
        logger.error("ExecutionException in shutting down members." + includeMembers);
        throw e;
    } finally {
        exec.shutdownNow();
    }
}
Also used : ChangeLogLevelFunction(org.apache.geode.management.internal.cli.functions.ChangeLogLevelFunction) Function(org.apache.geode.cache.execute.Function) NetstatFunction(org.apache.geode.management.internal.cli.functions.NetstatFunction) ShutDownFunction(org.apache.geode.management.internal.cli.functions.ShutDownFunction) GarbageCollectionFunction(org.apache.geode.management.internal.cli.functions.GarbageCollectionFunction) GetStackTracesFunction(org.apache.geode.management.internal.cli.functions.GetStackTracesFunction) Execution(org.apache.geode.cache.execute.Execution) ShutDownFunction(org.apache.geode.management.internal.cli.functions.ShutDownFunction) ExecutorService(java.util.concurrent.ExecutorService) FunctionException(org.apache.geode.cache.execute.FunctionException) ExecutionException(java.util.concurrent.ExecutionException) Callable(java.util.concurrent.Callable) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

Execution (org.apache.geode.cache.execute.Execution)217 ResultCollector (org.apache.geode.cache.execute.ResultCollector)163 HashSet (java.util.HashSet)144 ArrayList (java.util.ArrayList)139 FunctionException (org.apache.geode.cache.execute.FunctionException)131 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)127 Function (org.apache.geode.cache.execute.Function)121 TestFunction (org.apache.geode.internal.cache.functions.TestFunction)108 IgnoredException (org.apache.geode.test.dunit.IgnoredException)108 List (java.util.List)106 Test (org.junit.Test)85 Iterator (java.util.Iterator)79 Region (org.apache.geode.cache.Region)79 SerializableCallable (org.apache.geode.test.dunit.SerializableCallable)74 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)74 VM (org.apache.geode.test.dunit.VM)70 FunctionInvocationTargetException (org.apache.geode.cache.execute.FunctionInvocationTargetException)69 Host (org.apache.geode.test.dunit.Host)69 Set (java.util.Set)65 CacheClosedException (org.apache.geode.cache.CacheClosedException)59