Commits a command.

@param request the command request
@param future  the command response future
438319
private void commitCommand(CommandRequest request, CompletableFuture<CommandResponse> future) {
    final long term = raft.getTerm();
    final long timestamp = System.currentTimeMillis();

    CommandEntry command = new CommandEntry(term, timestamp, request.session(), request.sequenceNumber(), request.operation());
    appendAndCompact(command)
        .whenCompleteAsync((entry, error) -> {
          if (error != null) {
            Throwable cause = Throwables.getRootCause(error);
            if (Throwables.getRootCause(error) instanceof StorageException.TooLarge) {
              log.warn("Failed to append command {}", command, cause);
              future.complete(CommandResponse.builder()
                  .withStatus(RaftResponse.Status.ERROR)
                  .withError(RaftError.Type.PROTOCOL_ERROR)
                  .build());
            } else {
              future.complete(CommandResponse.builder()
                  .withStatus(RaftResponse.Status.ERROR)
                  .withError(RaftError.Type.COMMAND_FAILURE)
                  .build());
            }
            return;
          }

          // Replicate the command to followers.
          appender.appendEntries(entry.index()).whenComplete((commitIndex, commitError) -> {
            raft.checkThread();
            if (isRunning()) {
              // If the command was successfully committed, apply it to the state machine.
              if (commitError == null) {
                raft.getServiceManager().<OperationResult>apply(entry.index()).whenComplete((r, e) -> {
                  completeOperation(r, CommandResponse.builder(), e, future);
                });
              } else {
                future.complete(CommandResponse.builder()
                    .withStatus(RaftResponse.Status.ERROR)
                    .withError(RaftError.Type.COMMAND_FAILURE)
                    .build());
              }
            } else {
              future.complete(CommandResponse.builder()
                  .withStatus(RaftResponse.Status.ERROR)
                  .withError(RaftError.Type.COMMAND_FAILURE)
                  .build());
            }
          });
        }, raft.getThreadContext());
  }
643985
@Override
    public Future<?> submit(Runnable task) {
        try {
            if (this.concurrentExecutor instanceof ExecutorService) {
                return ((ExecutorService) this.concurrentExecutor).submit(task);
            } else {
                FutureTask<Object> future = new FutureTask<Object>(task, null);
                this.concurrentExecutor.execute(future);
                return future;
            }
        } catch (RejectedExecutionException ex) {
            throw new TaskRejectedException("Executor [" + this.concurrentExecutor + "] did not accept task: " + task,
                    ex);
        }
    }
157906
@Override
	protected void preparePaintComponent(final Request request) {
		StringBuffer text = new StringBuffer("Options: ");

		for (Object option : shuffler.getOptions()) {
			text.append(option).append(", ");
		}

		order.setText(text.toString());
	}
566445
@Override
	protected void preparePaintComponent(final Request request) {
		if (!isInitialised()) {
			// Default some values.
			tf3.setDisabled(true);

			tf1.setText("blah blah");
			tf2.setText("abc");
			tf3.setText("abc");

			setInitialised(true);
		}
	}
61365
private CompletableFuture<RestoreResponse> restore(RestoreRequest request) {
    return getService(request).thenCompose(service -> service.restore(request));
  }
1329721
private <T> void submitQuery(QueryRequest request, CompletableFuture<T> future) {
    submit(new QueryAttempt<>(sequencer.nextRequest(), request, future));
  }
554080
public void handleRequest(String request) {
        if (messageListener != null) {
            log.debug("Received Http request");
            messageListener.onInboundMessage(new RawMessage(request), null);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Received Http request:" + NEWLINE + request);
            }
        }
    }
898682
@Override
	public void handleRequest(final Request request) {
		// Check if this link was the AJAX Trigger
		AjaxOperation operation = AjaxHelper.getCurrentOperation();
		boolean pressed = (operation != null && getId().equals(operation.getTriggerId()));

		// Protect against client-side tampering of disabled/read-only fields.
		if (isDisabled() && pressed) {
			LOG.warn("A disabled link has been triggered. " + getText() + ". " + getId());
			return;
		}

		// If an action has been supplied then execute it, but only after
		// handle request has been performed on the entire component tree.
		final Action action = getAction();

		if (pressed && action != null) {
			final ActionEvent event = new ActionEvent(this, getActionCommand(), getActionObject());

			Runnable later = new Runnable() {
				@Override
				public void run() {
					action.execute(event);
				}
			};

			invokeLater(later);
		}
	}
1302904
private CompletableFuture<CloseResponse> close(CloseRequest request) {
    return getService(request).thenCompose(service -> service.close(request));
  }
1298722
public void releaseRequest(HttpRequestMessageImpl request) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "releaseRequest: " + request);
        }
        this.reqPool.put(request);
    }
1316291
public RequestFuture<T> setRequest(Request<T> request) {
        this.request = request;
        this.request.addErrorListener(this);
        this.request.addResponseListener(this);
        return this;
    }
462441
public static boolean isStepOnRequest(final Request request) {
		String val = request.getParameter(Environment.STEP_VARIABLE);
		return val != null;
	}
507013
public void execute(final AwsRequest request) {
    service.callFunction(
        Fields.EXECUTE_ACTION_NAME,
        Collections.singletonList(getRequestArgs(request)));
  }
263619
def do_commit(self, line):
        

        def f(p, args):
            print(p.commit())

        self._request(line, f)
578460
private void addPostParams(final Request request) {
        if (status != null) {
            request.addPostParam("Status", status.toString());
        }

        if (pauseBehavior != null) {
            request.addPostParam("PauseBehavior", pauseBehavior);
        }
    }
1226573
@Override
	protected void preparePaintComponent(final Request request) {
		super.preparePaintComponent(request);

		if (!isInitialised()) {
			textArea.setFocussed();

			setInitialised(true);
		}
	}
1204723
private void addPostParams(final Request request) {
        if (fallbackActions != null) {
            request.addPostParam("FallbackActions", Converter.mapToJson(fallbackActions));
        }
    }