Executes a state machine query.
170818
private void executeQuery(ServerCommit commit, ServerSessionContext session, CompletableFuture<Result> future, ThreadContext context) {
    if (!log.isOpen()) {
      context.executor().execute(() -> future.completeExceptionally(new IllegalStateException("log closed")));
      return;
    }

    // If the session is already in an inactive state, complete the future exceptionally.
    if (!session.state().active()) {
      context.executor().execute(() -> future.completeExceptionally(new UnknownSessionException("inactive session: " + session.id())));
      return;
    }

    long index = commit.index();
    long eventIndex = session.getEventIndex();

    // Update the state machine context with the query entry's index. We set a null consistency
    // level to indicate that events cannot be published in this context. Publishing events in
    // response to state machine queries is non-deterministic as queries are not replicated.
    executor.init(index, commit.time(), ServerStateMachineContext.Type.QUERY);

    try {
      Object result = executor.executeOperation(commit);
      context.executor().execute(() -> future.complete(new Result(index, eventIndex, result)));
    } catch (Exception e) {
      context.executor().execute(() -> future.complete(new Result(index, eventIndex, e)));
    }
  }
1113876
public ExecutionResult execute(String query) {
        ExecutionInput executionInput = ExecutionInput.newExecutionInput()
                .query(query)
                .build();
        return execute(executionInput);
    }
714201
public ResultSet executeQuery(ReadContext context, Options.QueryOption... options) {
    return context.executeQuery(this, options);
  }
84584
private void executeBatch(BatchStatement batchState) {
        if (batchState.size() > 0) {
            m_logger.debug("Executing synchronous batch with {} statements", batchState.size());
            m_dbservice.getSession().execute(batchState);
        }
    }
55523
def execute(query, **args)
      args = args
             .merge(with_giraph_root(args))
             .merge(with_giraph_resolvers(args))

      super(query, **args)
    end
1223426
public void runQueries(final List<Query> queries) throws Exception {
    final long start_time = System.currentTimeMillis() / 1000;

    // TODO - threadify it. We *could* have hundreds of queries and we don't
    // want to create that many threads. For now we'll just execute each one
    // serially
    final Thread reporter = new ProgressReporter();
    reporter.start();

    for (final Query query : queries) {
      final List<Scanner> scanners = Internal.getScanners(query);
      final List<Thread> threads = new ArrayList<Thread>(scanners.size());
      int i = 0;
      for (final Scanner scanner : scanners) {
        final FsckWorker worker = new FsckWorker(scanner, i++, this.options);
        worker.setName("Fsck #" + i);
        worker.start();
        threads.add(worker);
      }

      for (final Thread thread : threads) {
        thread.join();
        LOG.info("Thread [" + thread + "] Finished");
      }
    }
    reporter.interrupt();

    logResults();
    final long duration = (System.currentTimeMillis() / 1000) - start_time;
    LOG.info("Completed fsck in [" + duration + "] seconds");
  }
1050810
def execute(self, query, args=None):
        
        self._ensure_conn()
        cur = self._conn.cursor()
        yield cur.execute(query, args)
        raise Return(cur)
487617
def transition_to_execute_complete(self):
        """"""
        assert self.state in [AQStateMachineStates.execute]
        self.state = AQStateMachineStates.execute_complete
534817
def excute_query(query, db=None, flags=None, use_sudo=False, **kwargs):
    """"""

    flags = flags or u''
    if db:
        flags = u"%s -d %s" % (flags, db)
    command = u'psql %s -c "%s"' % (flags, query)
    if use_sudo:
        sudo(command, user='postgres', **kwargs)
    else:
        run(command, **kwargs)
948817
void afterExecution() {
        for (;;) {
            State currentState = state.get();
            switch (currentState) {
                case REQUESTED:
                    state.set(State.RUNNING);
                    scheduleExecution();
                    return;
                case RUNNING:
                    if (state.compareAndSet(State.RUNNING, State.INACTIVE)) {
                        return;
                    }
                    break;
                default:
                    throw new IllegalStateException("Inactive state is illegal here.");
            }
        }
    }
1316803
public void executeQuery(String query, Optional<String> proxy)
      throws SQLException {
    executeQueries(Collections.singletonList(query), proxy);
  }
640458
def execute(self, input_data):
        '''  '''

        # Grab the Bro log handles from the input
        bro_logs = input_data['pcap_bro']

        # Weird log
        if 'weird_log' in bro_logs:
            stream = self.workbench.stream_sample(bro_logs['weird_log'])
            self.weird_log_graph(stream)

        # HTTP log
        gsleep()
        stream = self.workbench.stream_sample(bro_logs['http_log'])
        self.http_log_graph(stream)

        # Files log
        gsleep()
        stream = self.workbench.stream_sample(bro_logs['files_log'])
        self.files_log_graph(stream)

        return {'output':'go to http://localhost:7474/browser and execute this query "match (s:origin), (t:file), p=allShortestPaths((s)--(t)) return p"'}
809519
def state(self, state):
        """"""
        with self._lock:
            self._value = self._states.index(state)
211144
private void invokeQuery(PrimitiveOperation operation, CompletableFuture<byte[]> future) {
    QueryRequest request = QueryRequest.builder()
        .withSession(state.getSessionId().id())
        .withSequence(state.getCommandRequest())
        .withOperation(operation)
        .withIndex(Math.max(state.getResponseIndex(), state.getEventIndex()))
        .build();
    invokeQuery(request, future);
  }
1151060
def execute(self, context):
        """"""
        for ware in self.middleware:
            ware.premessage(context)
            context = ware.bind(context)
            ware.postmessage(context)
        return context
668025
def execute(self, operation, parameters=None, is_response=True):
        
        if parameters is None or not parameters:
            sql = operation
        else:
            sql = operation % _escaper.escape_args(parameters)

        self._reset_state()

        self._state = self._STATE_RUNNING
        self._uuid = uuid.uuid1()

        if is_response:
            response = self._db.select(sql, settings={'query_id': self._uuid})
            self._process_response(response)
        else:
            self._db.raw(sql)
971045
public void executeQueryAsync(String query, CallbackHandler callbackHandler) throws FMSException {
        IntuitMessage intuitMessage = prepareQuery(query);

        //set callback handler
        intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);

        //execute async interceptors
        executeAsyncInterceptors(intuitMessage);
    }