Execute a procedure on each partition.
The partition is indicated by its bounds on the backend array.

@param p the procedure to execute
10949
public boolean forEachPartition(IterateProcedure<E> p) {
        int curIdx = index.get(values.get(0).id());
        int from;
        int to;
        for (from = 0, to = 0; to < values.size(); to++) {
            int cIdx = index.get(values.get(to).id());
            if (curIdx != cIdx) {
                if (!p.extract(this, curIdx, from, to)) {
                    return false;
                }
                from = to;
                curIdx = cIdx;
            }
        }
        return p.extract(this, curIdx, from, to);
    }
59490
public static void setCatalogProcedurePartitionInfo(VoltCompiler compiler, Database db,
            Procedure procedure, ProcedurePartitionData partitionData) throws VoltCompilerException {
        ParititonDataReturnType partitionClauseData = resolvePartitionData(compiler, db, procedure,
                partitionData.m_tableName, partitionData.m_columnName, partitionData.m_paramIndex);
        procedure.setPartitionparameter(partitionClauseData.partitionParamIndex);
        procedure.setPartitioncolumn(partitionClauseData.partitionColumn);
        procedure.setPartitiontable(partitionClauseData.partitionTable);
        procedure.setSinglepartition(true);

        // handle a two partition procedure
        if (partitionData.isTwoPartitionProcedure()) {
            partitionClauseData = resolvePartitionData(compiler, db, procedure,
                    partitionData.m_tableName2, partitionData.m_columnName2, partitionData.m_paramIndex2);
            procedure.setPartitionparameter2(partitionClauseData.partitionParamIndex);
            procedure.setPartitioncolumn2(partitionClauseData.partitionColumn);
            procedure.setPartitiontable2(partitionClauseData.partitionTable);
            procedure.setSinglepartition(false);
        }
    }
690471
private void run_implementation_(PushProcessor p) throws Exception {
        final Map<GroupName, Alert> alerts = registry_.getCollectionAlerts();
        final TimeSeriesCollection tsdata = registry_.getCollectionData();
        p.accept(tsdata, unmodifiableMap(alerts), registry_.getFailedCollections());
    }
377499
public void callExecuteTaskAsync(SimpleClientResponseAdapter.Callback cb, byte[] params) throws IOException {
        final String procedureName = "@ExecuteTask";
        Config procedureConfig = SystemProcedureCatalog.listing.get(procedureName);
        Procedure proc = procedureConfig.asCatalogProcedure();
        StoredProcedureInvocation spi = new StoredProcedureInvocation();
        spi.setProcName(procedureName);
        spi.setParams(params);
        spi.setClientHandle(m_executeTaskAdpater.registerCallback(cb));
        if (spi.getSerializedParams() == null) {
            spi = MiscUtils.roundTripForCL(spi);
        }
        synchronized (m_executeTaskAdpater) {
            m_dispatcher.createTransaction(m_executeTaskAdpater.connectionId(), spi,
                    proc.getReadonly(), proc.getSinglepartition(), proc.getEverysite(),
                    new int[] { 0 } /* Can provide anything for multi-part */,
                    spi.getSerializedSize(), System.nanoTime());
        }
    }
429851
@Override
    @Deprecated
    public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception {
        throw new UnsupportedOperationException("Use `execute(parameters, body, output)`");
    }
115880
public static <T> void forEach(Iterator<T> iterator, Procedure1<? super T> procedure) {
		if (procedure == null)
			throw new NullPointerException("procedure");
		while(iterator.hasNext()) {
			procedure.apply(iterator.next());
		}
	}
642841
protected synchronized void execute() {
    ListParameterization config = new ListParameterization();
    parameterTable.appendParameters(config);
    runButton.setEnabled(false);
    try {
      configureStep(config);
      if(config.hasUnusedParameters()) {
        // List<Pair<OptionID, Object>> remainingParameters =
        // config.getRemainingParameters();
        LOG.warning("Unused parameters: " + "FIXME");
      }
      if(config.getErrors().size() > 0) {
        reportErrors(config);
      }
      else {
        executeStep();
      }
    }
    catch(Exception e) {
      LOG.exception(e);
    }
    updateStatus();
    firePanelUpdated();
  }
309993
private void execute(MultiPolygon multiPolygon) {
		Polygon polygon = execute((Polygon) multiPolygon.getGeometryN(index.getGeometryIndex()));
		setPolygonN(multiPolygon, polygon, index.getGeometryIndex());
	}
813449
public static JobExecutionResult execute(Program pa, String... args) throws Exception {
		return execute(pa.getPlan(args));
	}
1169143
private void runMultigetSliceQuery(final List<K> param) {
		MultigetSliceQuery<K, N, V> multigetSliceQuery = HFactory
				.createMultigetSliceQuery(keyspace, keySerializer,
						nameSerializer, valueSerializer);

		multigetSliceQuery.setColumnFamily(columnFamily);

		multigetSliceQuery.setKeys(param);

		multigetSliceQuery.setRange(start, finish, reversed, maxColumnCount);

		QueryResult<Rows<K, N, V>> result = multigetSliceQuery.execute();

		queryResult.add(result.get());

		// Add current query execution time to internal variable
		// totalExecutionTimeMicro. When parallelism is enabled, this value might not be correct 
		// always due to available system resources and thread implementation
		totalExecutionTimeMicro.addAndGet(result.getExecutionTimeMicro());
		// Add current query execution time to internal variable
		// totalExecutionTimeNano. When parallelism is enabled, this value might not be correct 
		// always due to available system resources and thread implementation
		totalExecutionTimeNano.addAndGet(result.getExecutionTimeNano());
		
		//Add host used to the list
		m_hostsUsed.put(result.getHostUsed().getIp(), result.getHostUsed());

	}
916080
public boolean callProcedure(InternalConnectionContext caller,
                                 Function<Integer, Boolean> backPressurePredicate,
                                 InternalConnectionStatsCollector statsCollector,
                                 ProcedureCallback procCallback, String proc, Object... fieldList) {
        Procedure catProc = InvocationDispatcher.getProcedureFromName(proc, getCatalogContext());
        if (catProc == null) {
            String fmt = "Cannot invoke procedure %s from streaming interface %s. Procedure not found.";
            m_logger.rateLimitedLog(SUPPRESS_INTERVAL, Level.ERROR, null, fmt, proc, caller);
            m_failedCount.incrementAndGet();
            return false;
        }

        StoredProcedureInvocation task = new StoredProcedureInvocation();

        task.setProcName(proc);
        task.setParams(fieldList);
        try {
            task = MiscUtils.roundTripForCL(task);
        } catch (Exception e) {
            String fmt = "Cannot invoke procedure %s from streaming interface %s. failed to create task.";
            m_logger.rateLimitedLog(SUPPRESS_INTERVAL, Level.ERROR, null, fmt, proc, caller);
            m_failedCount.incrementAndGet();
            return false;
        }
        int[] partitions = null;
        try {
            partitions = InvocationDispatcher.getPartitionsForProcedure(catProc, task);
        } catch (Exception e) {
            String fmt = "Can not invoke procedure %s from streaming interface %s. Partition not found.";
            m_logger.rateLimitedLog(SUPPRESS_INTERVAL, Level.ERROR, e, fmt, proc, caller);
            m_failedCount.incrementAndGet();
            return false;
        }

        boolean mp = (partitions[0] == MpInitiator.MP_INIT_PID) || (partitions.length > 1);
        final InternalClientResponseAdapter adapter = mp ? m_adapters.get(MpInitiator.MP_INIT_PID) : m_adapters.get(partitions[0]);
        InternalAdapterTaskAttributes kattrs = new InternalAdapterTaskAttributes(caller,  adapter.connectionId());

        final AuthUser user = getCatalogContext().authSystem.getImporterUser();

        if (!adapter.createTransaction(kattrs, proc, catProc, procCallback, statsCollector, task, user, partitions, false, backPressurePredicate)) {
            m_failedCount.incrementAndGet();
            return false;
        }
        m_submitSuccessCount.incrementAndGet();
        return true;
    }
572153
@Pure
	public static <P1, P2, P3, P4, P5> Procedure4<P2, P3, P4, P5> curry(final Procedure5<? super P1, ? super P2, ? super P3, ? super P4, ? super P5> procedure,
			final P1 argument) {
		if (procedure == null)
			throw new NullPointerException("procedure");
		return new Procedure4<P2, P3, P4, P5>() {
			@Override
			public void apply(P2 p2, P3 p3, P4 p4, P5 p5) {
				procedure.apply(argument, p2, p3, p4, p5);
			}
		};
	}
837922
public static void executeCommand(String[] args) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        args = AdminToolUtils.copyArrayCutFirst(args);
        if(subCmd.equals("add")) {
            SubCommandStoreAdd.executeCommand(args);
        } else if(subCmd.equals("update")) {
            SubCommandStoreUpdate.executeCommand(args);
        } else if(subCmd.equals("delete")) {
            SubCommandStoreDelete.executeCommand(args);
        } else if(subCmd.equals("rollback-ro")) {
            SubCommandStoreRollbackReadOnly.executeCommand(args);
        } else if(subCmd.equals("truncate-partition")) {
            SubCommandStoreTruncatePartition.executeCommand(args);
        } else if(subCmd.equals("truncate-store")) {
            SubCommandStoreTruncateStore.executeCommand(args);
        } else {
            printHelp(System.out);
        }
    }
626708
public void execute(DelegateExecution execution) {
    boolean isSkipExpressionEnabled = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression);
    if (!isSkipExpressionEnabled || (isSkipExpressionEnabled && !SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression))) {

      if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
        ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(serviceTaskId, execution.getProcessDefinitionId());
        if (taskElementProperties != null && taskElementProperties.has(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME)) {
          String overrideClassName = taskElementProperties.get(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME).asText();
          if (StringUtils.isNotEmpty(overrideClassName) && !overrideClassName.equals(className)) {
            className = overrideClassName;
            activityBehaviorInstance = null;
          }
        }
      }
      
      if (activityBehaviorInstance == null) {
        activityBehaviorInstance = getActivityBehaviorInstance();
      }

      try {
        activityBehaviorInstance.execute(execution);
      } catch (BpmnError error) {
        ErrorPropagation.propagateError(error, execution);
      } catch (RuntimeException e) {
        if (!ErrorPropagation.mapException(e, (ExecutionEntity) execution, mapExceptions))
          throw e;
      }
    }
  }
1300806
public static void forEachCodePoint(String string, CodePointProcedure procedure)
    {
        int size = string.length();
        for (int i = 0; i < size; )
        {
            int codePoint = string.codePointAt(i);
            procedure.value(codePoint);
            i += Character.charCount(codePoint);
        }
    }
541939
final public function execute($bound_input_params = null)
	{
		if (!is_array($bound_input_params) or empty($bound_input_params)) {
			$success = parent::execute();
		} else {
			$success = parent::execute($this->bindConversion($bound_input_params));
		}

		// Accumulative success of statement execution
		if (is_null($this->_success)) {
			// Success is not set, so it is the result of this execution
			$this->_success = $success;
		} else {
			// Success is already set, so it is `&=`d to `$success`
			// false &= true -> false
			// true &= false -> false
			// true &= true -> true
			$this->_success &= $this->_success;
		}
		return $this;
	}
264704
public final void execute()
  {
    _log.debug( _sqlString );

    PreparedStatement lPreparedStatement = null;

    try
    {
      lPreparedStatement = _callableStatementProvider.createPreparedStatement( _sqlString );

      usePreparedStatement( lPreparedStatement );
    }
    catch( SQLException e )
    {
      if( !handleSQLException( e ) )
      {
        throw ExceptionManager.createException( e, _sqlString );
      }
    }
    finally
    {
      if( lPreparedStatement != null )
      {
        try
        {
          lPreparedStatement.close();
        }
        catch( SQLException eSQLException )
        {
          throw ExceptionManager.createException( eSQLException, _sqlString );
        }
      }
    }
  }