public boolean next(ImmutableBytesWritable key, Result value) throws IOException {
    Result result;
    try {
      try {
        result = this.scanner.next();
        if (logScannerActivity) {
          rowcount++;
          if (rowcount >= logPerRowCount) {
            long now = EnvironmentEdgeManager.currentTime();
            LOG.info("Mapper took " + (now - timestamp) + "ms to process " + rowcount + " rows");
            timestamp = now;
            rowcount = 0;
          }
        }
      } catch (IOException e) {
        // do not retry if the exception tells us not to do so
        if (e instanceof DoNotRetryIOException) {
          throw e;
        }
        // try to handle all other IOExceptions by restarting
        // the scanner, if the second call fails, it will be rethrown
        LOG.debug("recovered from " + StringUtils.stringifyException(e));
        if (lastSuccessfulRow == null) {
          LOG.warn("We are restarting the first next() invocation,"
            + " if your mapper has restarted a few other times like this"
            + " then you should consider killing this job and investigate"
            + " why it's taking so long.");
        }
        if (lastSuccessfulRow == null) {
          restart(startRow);
        } else {
          restart(lastSuccessfulRow);
          this.scanner.next(); // skip presumed already mapped row
        }
        result = this.scanner.next();
      }

      if (result != null && result.size() > 0) {
        key.set(result.getRow());
        lastSuccessfulRow = key.get();
        value.copyFrom(result);
        return true;
      }
      return false;
    } catch (IOException ioe) {
      if (logScannerActivity) {
        long now = EnvironmentEdgeManager.currentTime();
        LOG.info("Mapper took " + (now - timestamp) + "ms to process " + rowcount + " rows");
        LOG.info(ioe.toString(), ioe);
        String lastRow =
          lastSuccessfulRow == null ? "null" : Bytes.toStringBinary(lastSuccessfulRow);
        LOG.info("lastSuccessfulRow=" + lastRow);
      }
      throw ioe;
    }
  }
@param key   HStoreKey as input key.
@param value MapWritable as input value
@return true if there was more data
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapred/TableRecordReaderImpl.java