public static void execute(final PoolImpl pool,Function function,ServerFunctionExecutor executor,Object args,MemberMappedArgument memberMappedArg,boolean allServers,byte hasResult,ResultCollector rc,boolean isFnSerializationReqd,UserAttributes attributes,String[] groups){
  final AbstractOp op=new ExecuteFunctionOpImpl(function,args,memberMappedArg,hasResult,rc,isFnSerializationReqd,(byte)0,groups,allServers,executor.isIgnoreDepartedMembers());
  if (allServers && groups.length == 0) {
    if (logger.isDebugEnabled()) {
      logger.debug("ExecuteFunctionOp#execute : Sending Function Execution Message:{} to all servers using pool: {}",op.getMessage(),pool);
    }
    List callableTasks=constructAndGetFunctionTasks(pool,function,args,memberMappedArg,hasResult,rc,isFnSerializationReqd,attributes);
    SingleHopClientExecutor.submitAll(callableTasks);
  }
 else {
    boolean reexecuteForServ=false;
    AbstractOp reexecOp=null;
    int retryAttempts=0;
    boolean reexecute=false;
    int maxRetryAttempts=0;
    if (function.isHA())     maxRetryAttempts=pool.getRetryAttempts();
    final boolean isDebugEnabled=logger.isDebugEnabled();
    do {
      try {
        if (reexecuteForServ) {
          if (isDebugEnabled) {
            logger.debug("ExecuteFunctionOp#execute.reexecuteForServ : Sending Function Execution Message:{} to server using pool: {} with groups:{} all members:{} ignoreFailedMembers:{}",op.getMessage(),pool,Arrays.toString(groups),allServers,executor.isIgnoreDepartedMembers());
          }
          reexecOp=new ExecuteFunctionOpImpl(function,args,memberMappedArg,hasResult,rc,isFnSerializationReqd,(byte)1,groups,allServers,executor.isIgnoreDepartedMembers());
          pool.execute(reexecOp,0);
        }
 else {
          if (isDebugEnabled) {
            logger.debug("ExecuteFunctionOp#execute : Sending Function Execution Message:{} to server using pool: {} with groups:{} all members:{} ignoreFailedMembers:{}",op.getMessage(),pool,Arrays.toString(groups),allServers,executor.isIgnoreDepartedMembers());
          }
          pool.execute(op,0);
        }
        reexecute=false;
        reexecuteForServ=false;
      }
 catch (      InternalFunctionInvocationTargetException e) {
        if (isDebugEnabled) {
          logger.debug("ExecuteFunctionOp#execute : Received InternalFunctionInvocationTargetException. The failed node is {}",e.getFailedNodeSet());
        }
        reexecute=true;
        rc.clearResults();
      }
catch (      ServerConnectivityException se) {
        retryAttempts++;
        if (isDebugEnabled) {
          logger.debug("ExecuteFunctionOp#execute : Received ServerConnectivityException. The exception is {} The retryAttempt is : {} maxRetryAttempts  {}",se,retryAttempts,maxRetryAttempts);
        }
        if (se instanceof ServerOperationException) {
          throw se;
        }
        if ((retryAttempts > maxRetryAttempts && maxRetryAttempts != -1))         throw se;
        reexecuteForServ=true;
        rc.clearResults();
      }
    }
 while (reexecuteForServ);
    if (reexecute && function.isHA()) {
      ExecuteFunctionOp.reexecute(pool,function,executor,rc,hasResult,isFnSerializationReqd,maxRetryAttempts - 1,groups,allServers);
    }
  }
}

public static void execute ( final PoolImpl pool , Function function , ServerFunctionExecutor executor , Object args , MemberMappedArgument memberMappedArg , boolean allServers , byte hasResult , ResultCollector rc , boolean isFnSerializationReqd , UserAttributes attributes , String [ ] groups ) { final AbstractOp op = new ExecuteFunctionOpImpl ( function , args , memberMappedArg , hasResult , rc , isFnSerializationReqd , ( byte ) 0 , groups , allServers , executor . isIgnoreDepartedMembers ( ) ) ; if ( allServers && groups . length == 0 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "ExecuteFunctionOp#execute : Sending Function Execution Message:{} to all servers using pool: {}" , op . getMessage ( ) , pool ) ; } List callableTasks = constructAndGetFunctionTasks ( pool , function , args , memberMappedArg , hasResult , rc , isFnSerializationReqd , attributes ) ; SingleHopClientExecutor . submitAll ( callableTasks ) ; } else { boolean reexecuteForServ = false ; AbstractOp reexecOp = null ; int retryAttempts = 0 ; boolean reexecute = false ; int maxRetryAttempts = 0 ; if ( function . isHA ( ) ) maxRetryAttempts = pool . getRetryAttempts ( ) ; final boolean isDebugEnabled = logger . isDebugEnabled ( ) ; do { try { if ( reexecuteForServ ) { if ( isDebugEnabled ) { logger . debug ( "ExecuteFunctionOp#execute.reexecuteForServ : Sending Function Execution Message:{} to server using pool: {} with groups:{} all members:{} ignoreFailedMembers:{}" , op . getMessage ( ) , pool , Arrays . toString ( groups ) , allServers , executor . isIgnoreDepartedMembers ( ) ) ; } reexecOp = new ExecuteFunctionOpImpl ( function , args , memberMappedArg , hasResult , rc , isFnSerializationReqd , ( byte ) 1 , groups , allServers , executor . isIgnoreDepartedMembers ( ) ) ; pool . execute ( reexecOp , 0 ) ; } else { if ( isDebugEnabled ) { logger . debug ( "ExecuteFunctionOp#execute : Sending Function Execution Message:{} to server using pool: {} with groups:{} all members:{} ignoreFailedMembers:{}" , op . getMessage ( ) , pool , Arrays . toString ( groups ) , allServers , executor . isIgnoreDepartedMembers ( ) ) ; } pool . execute ( op , 0 ) ; } reexecute = false ; reexecuteForServ = false ; } catch ( InternalFunctionInvocationTargetException e ) { if ( isDebugEnabled ) { logger . debug ( "ExecuteFunctionOp#execute : Received InternalFunctionInvocationTargetException. The failed node is {}" , e . getFailedNodeSet ( ) ) ; } reexecute = true ; rc . clearResults ( ) ; } catch ( ServerConnectivityException se ) { retryAttempts ++ ; if ( isDebugEnabled ) { logger . debug ( "ExecuteFunctionOp#execute : Received ServerConnectivityException. The exception is {} The retryAttempt is : {} maxRetryAttempts  {}" , se , retryAttempts , maxRetryAttempts ) ; } if ( se instanceof ServerOperationException ) { throw se ; } if ( ( retryAttempts > maxRetryAttempts && maxRetryAttempts != - 1 ) ) throw se ; reexecuteForServ = true ; rc . clearResults ( ) ; } } while ( reexecuteForServ ) ; if ( reexecute && function . isHA ( ) ) { ExecuteFunctionOp . reexecute ( pool , function , executor , rc , hasResult , isFnSerializationReqd , maxRetryAttempts - 1 , groups , allServers ) ; } } }
does a execute function on a server using connections from the given pool to communicate with the server .
