code: private void checkAttempt(TaskAttemptID attemptId) throws IOException {
      if (!attemptId.equals(currentAttemptId)) {
        throw new IOException("Attempt " + attemptId
            + " does not match current attempt " + currentAttemptId);
      }
    }
docs: Checks whether provided attempt id of remote JT matches currently set,
  throws if not
  @param attempt attempt id to check
  @throws IOException