@Override
	public JobTrackerACK heartBeat(TaskTrackerReport report) {

		report.printReport();
		
		JobTrackerACK rst = new JobTrackerACK(null, null);
		rst.newAddedTasks = new ArrayList<Task>();
		rst.rcvTasks = new ArrayList<TaskStatus>();
		
		while (this.taskList.size() > 0) {
			synchronized (this.taskList) {
				rst.newAddedTasks.add(this.taskList.get(0));
				this.taskList.remove(0);
			}
		}
			
		if (report != null && report.taskStatus != null && report.taskStatus.size() > 0 ) {
			for (TaskStatus rcvTask : report.taskStatus) {
				if (rcvTask.status == WorkStatus.FAILED || rcvTask.status == WorkStatus.SUCCESS) {
					rst.rcvTasks.add(rcvTask);
				}
			}
		}
			
		for (Task task : rst.newAddedTasks) {
			System.out.format("new task: <jid = %s, tid = %s>\n", task.getJobId(), task.getTaskId());
		}
		
		return rst;
	}