public void killWorkers ( Set < ContainerPlan > containers ) { for ( ContainerPlan container : containers ) { LOG . log ( Level . INFO , "Find and kill container for worker {0}" , container . getId ( ) ) ; Optional < HeronWorker > worker = multiKeyWorkerMap . lookupByWorkerId ( container . getId ( ) ) ; if ( worker . isPresent ( ) ) { LOG . log ( Level . INFO , "Killing container {0} for worker {1}" , new Object [ ] { worker . get ( ) . evaluator . getId ( ) , worker . get ( ) . workerId } ) ; AllocatedEvaluator evaluator = multiKeyWorkerMap . detachEvaluatorAndRemove ( worker . get ( ) ) ; evaluator . close ( ) ; } else { LOG . log ( Level . WARNING , "Did not find worker for {0}" , container . getId ( ) ) ; } containerPlans . remove ( container . getId ( ) ) ; } }
Terminates any yarn containers associated with the given containers .