Package com.hubspot.singularity.executor.task

Examples of com.hubspot.singularity.executor.task.SingularityExecutorTask


    if (!maybeTask.isPresent()) {
      return KillState.DIDNT_EXIST;
    }

    final SingularityExecutorTask task = maybeTask.get();

    ListenableFuture<ProcessBuilder> processBuilderFuture = null;
    SingularityExecutorTaskProcessCallable runningProcess = null;

    task.getLock().lock();

    try {
      if (task.wasKilled()) {
        return KillState.ALREADY_REQUESTED;
      }

      task.markKilled();

      processBuilderFuture = processBuildingTasks.get(task.getTaskId());
      runningProcess = processRunningTasks.get(task.getTaskId());
    } finally {
      task.getLock().unlock();
    }

    if (processBuilderFuture != null) {
      processBuilderFuture.cancel(true);

      task.getProcessBuilder().cancel();

      return KillState.INTERRUPTING_PRE_PROCESS;
    }

    if (runningProcess != null) {
View Full Code Here


    LOG.info("Asked to launch task {}", taskId);

    try {
      final ch.qos.logback.classic.Logger taskLog = taskBuilder.buildTaskLogger(taskId);
      final SingularityExecutorTask task = taskBuilder.buildTask(taskId, executorDriver, taskInfo, taskLog);

      SubmitState submitState = monitor.submit(task);

      switch (submitState) {
      case REJECTED:
View Full Code Here

    SingularityExecutorTaskDefinition taskDefinition = new SingularityExecutorTaskDefinition(taskId, executorData, configuration.getTaskDirectoryPath(taskId).toString(), configuration.getServiceLog(),
        configuration.getTaskAppDirectory(), configuration.getExecutorBashLog(), configuration.getLogrotateStateFile());

    jsonObjectFileHelper.writeObject(taskDefinition, configuration.getTaskDefinitionPath(taskId), log);

    return new SingularityExecutorTask(driver, executorUtils, configuration, taskDefinition, executorPid, artifactFetcher, taskInfo, templateManager, jsonObjectMapper, log, jsonObjectFileHelper);
  }
View Full Code Here

TOP

Related Classes of com.hubspot.singularity.executor.task.SingularityExecutorTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.