Tabnine Logo
Task.taskInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
taskInfo
method
in
org.elasticsearch.tasks.Task

Best Java code snippets using org.elasticsearch.tasks.Task.taskInfo (Showing top 20 results out of 315)

origin: org.elasticsearch/elasticsearch

  public TaskResult result(DiscoveryNode node, ActionResponse response) throws IOException {
    if (response instanceof ToXContent) {
      return new TaskResult(taskInfo(node.getId(), true), (ToXContent) response);
    } else {
      throw new IllegalStateException("response has to implement ToXContent to be able to store the results");
    }
  }
}
origin: org.elasticsearch/elasticsearch

public TaskResult result(DiscoveryNode node, Exception error) throws IOException {
  return new TaskResult(taskInfo(node.getId(), true), error);
}
origin: org.elasticsearch/elasticsearch

/**
 * Build a version of the task status you can throw over the wire and back
 * to the user.
 *
 * @param localNodeId
 *            the id of the node this task is running on
 * @param detailed
 *            should the information include detailed, potentially slow to
 *            generate data?
 */
public final TaskInfo taskInfo(String localNodeId, boolean detailed) {
  String description = null;
  Task.Status status = null;
  if (detailed) {
    description = getDescription();
    status = getStatus();
  }
  return taskInfo(localNodeId, description, status);
}
origin: org.elasticsearch/elasticsearch

@Override
protected void taskOperation(ListTasksRequest request, Task task, ActionListener<TaskInfo> listener) {
  listener.onResponse(task.taskInfo(clusterService.localNode().getId(), request.getDetailed()));
}
origin: org.elasticsearch/elasticsearch

@Override
protected void doRun() throws Exception {
  taskManager.waitForTaskCompletion(runningTask, waitForCompletionTimeout(request.getTimeout()));
  waitedForCompletion(thisTask, request, runningTask.taskInfo(clusterService.localNode().getId(), true), listener);
}
origin: org.elasticsearch/elasticsearch

/**
 * Executed on the node that should be running the task to find and return the running task. Falls back to
 * {@link #getFinishedTaskFromIndex(Task, GetTaskRequest, ActionListener)} if the task isn't still running.
 */
void getRunningTaskFromNode(Task thisTask, GetTaskRequest request, ActionListener<GetTaskResponse> listener) {
  Task runningTask = taskManager.getTask(request.getTaskId().getId());
  if (runningTask == null) {
    // Task isn't running, go look in the task index
    getFinishedTaskFromIndex(thisTask, request, listener);
  } else {
    if (request.getWaitForCompletion()) {
      // Shift to the generic thread pool and let it wait for the task to complete so we don't block any important threads.
      threadPool.generic().execute(new AbstractRunnable() {
        @Override
        protected void doRun() throws Exception {
          taskManager.waitForTaskCompletion(runningTask, waitForCompletionTimeout(request.getTimeout()));
          waitedForCompletion(thisTask, request, runningTask.taskInfo(clusterService.localNode().getId(), true), listener);
        }
        @Override
        public void onFailure(Exception e) {
          listener.onFailure(e);
        }
      });
    } else {
      TaskInfo info = runningTask.taskInfo(clusterService.localNode().getId(), true);
      listener.onResponse(new GetTaskResponse(new TaskResult(false, info)));
    }
  }
}
origin: com.strapdata.elasticsearch/elasticsearch

  public TaskResult result(DiscoveryNode node, ActionResponse response) throws IOException {
    if (response instanceof ToXContent) {
      return new TaskResult(taskInfo(node.getId(), true), (ToXContent) response);
    } else {
      throw new IllegalStateException("response has to implement ToXContent to be able to store the results");
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  public TaskResult result(DiscoveryNode node, ActionResponse response) throws IOException {
    if (response instanceof ToXContent) {
      return new TaskResult(taskInfo(node.getId(), true), (ToXContent) response);
    } else {
      throw new IllegalStateException("response has to implement ToXContent to be able to store the results");
    }
  }
}
origin: apache/servicemix-bundles

  public TaskResult result(DiscoveryNode node, ActionResponse response) throws IOException {
    if (response instanceof ToXContent) {
      return new TaskResult(taskInfo(node.getId(), true), (ToXContent) response);
    } else {
      throw new IllegalStateException("response has to implement ToXContent to be able to store the results");
    }
  }
}
origin: harbby/presto-connectors

@Override
protected TaskInfo taskOperation(ListTasksRequest request, Task task) {
  return task.taskInfo(clusterService.localNode(), request.getDetailed());
}
origin: com.strapdata.elasticsearch/elasticsearch

public TaskResult result(DiscoveryNode node, Exception error) throws IOException {
  return new TaskResult(taskInfo(node.getId(), true), error);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public TaskResult result(DiscoveryNode node, Exception error) throws IOException {
  return new TaskResult(taskInfo(node.getId(), true), error);
}
origin: apache/servicemix-bundles

/**
 * Build a version of the task status you can throw over the wire and back
 * to the user.
 *
 * @param localNodeId
 *            the id of the node this task is running on
 * @param detailed
 *            should the information include detailed, potentially slow to
 *            generate data?
 */
public final TaskInfo taskInfo(String localNodeId, boolean detailed) {
  String description = null;
  Task.Status status = null;
  if (detailed) {
    description = getDescription();
    status = getStatus();
  }
  return taskInfo(localNodeId, description, status);
}
origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Build a version of the task status you can throw over the wire and back
 * to the user.
 *
 * @param localNodeId
 *            the id of the node this task is running on
 * @param detailed
 *            should the information include detailed, potentially slow to
 *            generate data?
 */
public final TaskInfo taskInfo(String localNodeId, boolean detailed) {
  String description = null;
  Task.Status status = null;
  if (detailed) {
    description = getDescription();
    status = getStatus();
  }
  return taskInfo(localNodeId, description, status);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
protected void taskOperation(ListTasksRequest request, Task task, ActionListener<TaskInfo> listener) {
  listener.onResponse(task.taskInfo(clusterService.localNode().getId(), request.getDetailed()));
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
protected void taskOperation(ListTasksRequest request, Task task, ActionListener<TaskInfo> listener) {
  listener.onResponse(task.taskInfo(clusterService.localNode().getId(), request.getDetailed()));
}
origin: apache/servicemix-bundles

@Override
protected void taskOperation(ListTasksRequest request, Task task, ActionListener<TaskInfo> listener) {
  listener.onResponse(task.taskInfo(clusterService.localNode().getId(), request.getDetailed()));
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
protected void doRun() throws Exception {
  taskManager.waitForTaskCompletion(runningTask, waitForCompletionTimeout(request.getTimeout()));
  waitedForCompletion(thisTask, request, runningTask.taskInfo(clusterService.localNode().getId(), true), listener);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
protected void doRun() throws Exception {
  taskManager.waitForTaskCompletion(runningTask, waitForCompletionTimeout(request.getTimeout()));
  waitedForCompletion(thisTask, request, runningTask.taskInfo(clusterService.localNode().getId(), true), listener);
}
origin: apache/servicemix-bundles

@Override
protected void doRun() throws Exception {
  taskManager.waitForTaskCompletion(runningTask, waitForCompletionTimeout(request.getTimeout()));
  waitedForCompletion(thisTask, request, runningTask.taskInfo(clusterService.localNode().getId(), true), listener);
}
org.elasticsearch.tasksTasktaskInfo

Javadoc

Build a proper TaskInfo for this task.

Popular methods of Task

  • getId
    Returns task id
  • getAction
    Returns task action
  • <init>
  • getDescription
    Generates task description
  • getParentTaskId
    Returns id of the parent task or NO_PARENT_ID if the task doesn't have any parent tasks
  • getStatus
    Build a status for this task or null if this task doesn't have status. Since most tasks don't have s
  • getType
    Returns task channel type (netty, transport, direct)
  • result

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ImageIO (javax.imageio)
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now