@Override
	public void run() {
		System.out.println("Slave monitor ran");
		while (true) {
			try {
				for (Iterator<ConcurrentHashMap.Entry<Integer, Integer>> it = slaveList
						.entrySet().iterator(); it.hasNext();) {
					Entry<Integer, Integer> slave = it.next();
					int curRetry = slave.getValue();
					// if the retry count exceeds the limit, define the slave as
					// unreachable
					if (curRetry > retryNum * 2) {
						System.out.println("Slave #" + slave.getKey()
								+ " has left");
						// report to job tracker that the slave is unreachable
						tracker.loseContact(slave.getKey());
						// remove the slave from the job tracker
						it.remove();
					} else {
						slaveList.put(slave.getKey(), ++curRetry);
					}
				}
				Thread.sleep(interval);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}