public void writeTaskContainerMapping(String taskName,Integer containerId){
  Integer existingContainerId=taskNameToContainerId.get(taskName);
  if (existingContainerId != null && !existingContainerId.equals(containerId)) {
    log.info("Task \"{}\" moved from container {} to container {}",new Object[]{taskName,existingContainerId,containerId});
  }
 else {
    log.debug("Task \"{}\" assigned to container {}",taskName,containerId);
  }
  if (containerId == null) {
    send(new Delete(getSource(),taskName,SetTaskContainerMapping.TYPE));
    taskNameToContainerId.remove(taskName);
  }
 else {
    send(new SetTaskContainerMapping(getSource(),taskName,String.valueOf(containerId)));
    taskNameToContainerId.put(taskName,containerId);
  }
}

public void writeTaskContainerMapping ( String taskName , Integer containerId ) { Integer existingContainerId = taskNameToContainerId . get ( taskName ) ; if ( existingContainerId != null && ! existingContainerId . equals ( containerId ) ) { log . info ( "Task \"{}\" moved from container {} to container {}" , new Object [ ] { taskName , existingContainerId , containerId } ) ; } else { log . debug ( "Task \"{}\" assigned to container {}" , taskName , containerId ) ; } if ( containerId == null ) { send ( new Delete ( getSource ( ) , taskName , SetTaskContainerMapping . TYPE ) ) ; taskNameToContainerId . remove ( taskName ) ; } else { send ( new SetTaskContainerMapping ( getSource ( ) , taskName , String . valueOf ( containerId ) ) ) ; taskNameToContainerId . put ( taskName , containerId ) ; } }
method to write task container info to coordinator stream .
