code: @SuppressWarnings("deprecation")
      private void cancelRequestAndWorkerOnHost(List<String> targetHosts) {
  
          List<String> validTargetHosts = new ArrayList<String>(workers.keySet());
          validTargetHosts.retainAll(targetHosts);
          logger.info("targetHosts for cancel: Total: {}"
                  + " Valid in current manager with worker threads: {}",
                  targetHosts.size(), validTargetHosts.size());
  
          for (String targetHost : validTargetHosts) {
  
              ActorRef worker = workers.get(targetHost);
  
              if (worker != null && !worker.isTerminated()) {
                  worker.tell(OperationWorkerMsgType.CANCEL, getSelf());
                  logger.info("Submitted CANCEL request on Host {}", targetHost);
              } else {
                  logger.info(
                          "Did NOT Submitted "
                                  + "CANCEL request on Host {} as worker on this host is null or already killed",
                          targetHost);
              }
  
          }
  
      }
docs: Cancel request and worker on host.
  
  @param targetHosts
  the target hosts