Remove a DropPasteWorker from the helper.
@param worker the worker that should be removed
347248
public void removeDropPasteWorker(DropPasteWorkerInterface worker)
    {
        this.dropPasteWorkerSet.remove(worker);
        java.util.Iterator it = this.dropPasteWorkerSet.iterator();
        int newDefaultActions = 0;
        while (it.hasNext())
            newDefaultActions |= ((DropPasteWorkerInterface)it.next()).getAcceptableActions(defaultDropTarget.getComponent());
        defaultDropTarget.setDefaultActions(newDefaultActions);
    }
1312392
public static synchronized void removeLogger(@NonNull JobLogger logger) {
        for (int i = 0; i < loggers.length; i++) {
            if (logger.equals(loggers[i])) {
                loggers[i] = null;
                // continue, maybe for some reason the logger is twice in the array
            }
        }
    }
80651
@Deprecated
    public void deleteWatcherFromIssue(Watcher watcher, Issue issue) throws RedmineException {
        transport.deleteChildId(Issue.class, Integer.toString(issue.getId()), watcher, watcher.getId());
    }
466120
@CommandArgument
  public void stop() {
    System.out.println("Stopping worker");
    worker.shutdown();
    workerThread.interrupt();
    try {
      workerThread.join();
    } catch (InterruptedException e) {
      logger.warn("Joining to worker thread interrupted", e);
    }
    worker = null;
    workerThread = null;
    taskProgressStates = null;
  }
645711
public void removeCollaborator(String appName, String collaborator) {
        connection.execute(new SharingRemove(appName, collaborator), apiKey);
    }
772830
public void removeCollider(GVRCollider collider)
    {
        mGroup.removeChild(collider);
        NativeComponent.removeChildComponent(getNative(), collider.getNative());
    }
705804
Optional<Collection<Tasklet>> removeWorker(final String id) {
    lock.lock();
    try {
      if (!terminated) {
        final VortexWorkerManager vortexWorkerManager = this.runningWorkers.remove(id);
        if (vortexWorkerManager != null) {
          this.schedulingPolicy.workerRemoved(vortexWorkerManager);
          return Optional.ofNullable(vortexWorkerManager.removed());
        } else {
          // Called before addWorker (e.g. RM preempted the resource before the Evaluator started)
          removedBeforeAddedWorkers.add(id);
          return Optional.empty();
        }
      } else {
        // No need to return anything since it is terminated
        return Optional.empty();
      }
    } finally {
      try {
        workerAggregateFunctionMap.remove(id);
      } finally {
        lock.unlock();
      }
    }
  }
205810
private void removeTaskFromBomFile(File buildGradleTmp) {
        FileReader fileReader;
        BufferedReader bufferedReader = null;
        try {
            fileReader = new FileReader(buildGradleTmp);
            bufferedReader = new BufferedReader(fileReader);
            String currLine;
            String originalLines = "";
            while ((currLine = bufferedReader.readLine()) != null) {
                if (currLine.equals(TASK_COPY_DEPENDENCIES_HEADER)) {
                    break;
                } else {
                    originalLines = originalLines.concat(currLine + Constants.NEW_LINE);
                }
            }
            if (!originalLines.isEmpty()) {
                byte[] bytes = originalLines.getBytes();
                Files.write(Paths.get(buildGradleTmp.getPath()), bytes, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
            }
        } catch (IOException e) {
            logger.warn("Couldn't remove 'copyDependencies' task from {}, error: {}", buildGradleTmp.getPath(), e.getMessage());
            logger.debug("Error: {}", e.getStackTrace());
        } finally {
            try {
                if (bufferedReader != null) {
                    bufferedReader.close();
                }
            } catch (IOException e) {
                logger.error("Could close the file, cause", e.getMessage());
            }
        }
    }
1174523
public function unregisterWorker()
    {
        if (is_object($this->currentJob)) {
            $this->currentJob->fail(new ResqueJobForceExitException());
        }

        $this->resqueInstance->redis->srem($this->workerName() . 's', $this->id);
        $this->resqueInstance->redis->del($this->workerName() . ':' . $this->id);
        $this->resqueInstance->redis->del($this->workerName() . ':' . $this->id . ':started');
        $this->resqueInstance->stats->clear('processed:' . $this->id);
        $this->resqueInstance->stats->clear('failed:' . $this->id);
    }
302491
public synchronized void failTasksForWorker(long workerId) {
    Integer taskId = mWorkerIdToTaskId.get(workerId);
    if (taskId == null) {
      return;
    }
    TaskInfo taskInfo = mJobInfo.getTaskInfo(taskId);
    if (taskInfo.getStatus().isFinished()) {
      return;
    }
    taskInfo.setStatus(Status.FAILED);
    taskInfo.setErrorMessage("Job worker was lost before the task could complete");
    updateStatus();
  }
432101
public void remove(final Task task)
  {
    giant.lock();
    try {
      try {
        log.info("Removing task[%s] from activeTasks", task.getId());
        for (final TaskLockPosse taskLockPosse : findLockPossesForTask(task)) {
          unlock(task, taskLockPosse.getTaskLock().getInterval());
        }
      }
      finally {
        activeTasks.remove(task.getId());
      }
    }
    finally {
      giant.unlock();
    }
  }
109649
def worker_stop(obj, worker_ids):
    
    if len(worker_ids) == 0:
        msg = 'Would you like to stop all workers?'
    else:
        msg = '\n{}\n\n{}'.format('\n'.join(worker_ids),
                                  'Would you like to stop these workers?')

    if click.confirm(msg, default=True, abort=True):
        stop_worker(obj['config'],
                    worker_ids=list(worker_ids) if len(worker_ids) > 0 else None)
545120
public function unregisterWorker()
    {
        if(is_object($this->currentJob)) {
            $this->currentJob->fail(new DirtyExitException);
        }

        $id = (string)$this;
        Resque::redis()->srem('workers', $id);
        Resque::redis()->del('worker:' . $id);
        Resque::redis()->del('worker:' . $id . ':started');
        Stat::clear('processed:' . $id);
        Stat::clear('failed:' . $id);
    }
831505
private void cleanup(final String taskId)
  {
    if (!lifecycleLock.awaitStarted(1, TimeUnit.SECONDS)) {
      return;
    }
    final RemoteTaskRunnerWorkItem removed = completeTasks.remove(taskId);
    final Worker worker = removed.getWorker();
    if (removed == null || worker == null) {
      log.makeAlert("WTF?! Asked to cleanup nonexistent task")
         .addData("taskId", taskId)
         .emit();
    } else {
      final String workerId = worker.getHost();
      log.info("Cleaning up task[%s] on worker[%s]", taskId, workerId);
      final String statusPath = JOINER.join(indexerZkConfig.getStatusPath(), workerId, taskId);
      try {
        cf.delete().guaranteed().forPath(statusPath);
      }
      catch (KeeperException.NoNodeException e) {
        log.info("Tried to delete status path[%s] that didn't exist! Must've gone away already?", statusPath);
      }
      catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }
64687
private void purgeTask(TaskInProgress tip, boolean wasFailure)
  throws IOException {
    if (tip != null) {
      LOG.info("About to purge task: " + tip.getTask().getTaskID());

      // Remove the task from running jobs,
      // removing the job if it's the last task
      removeTaskFromJob(tip.getTask().getJobID(), tip);
      tip.jobHasFinished(wasFailure);
      if (tip.getTask().isMapTask()) {
        indexCache.removeMap(tip.getTask().getTaskID().toString());
      }
    }
  }
1279071
public void removePainter(Painter<T> painter)
    {
        Collection<Painter<T>> old = new ArrayList<Painter<T>>(getPainters());
        
        this.painters.remove(painter);
        
        if (painter instanceof AbstractPainter)
        {
            ((AbstractPainter<?>) painter).removePropertyChangeListener(handler);
        }

        setDirty(true);
        firePropertyChange("painters", old, getPainters());
    }
769159
public void manage(int workersCount)
   {
      this.workers.clear();
      
      WorkerThread worker = null;
      for (int i = 0; i <workersCount; i++)
      {
         worker = new WorkerThread(this); //TODO expensive use thread pool
         this.manage(worker);         
      }
      
   }