protected synchronized int addScanner(ResultScanner scanner, boolean sortColumns) {
    int id = nextScannerId++;
    ResultScannerWrapper resultScannerWrapper = new ResultScannerWrapper(scanner, sortColumns);
    scannerMap.put(id, resultScannerWrapper);
    return id;
  }
Assigns a unique ID to the scanner and adds the mapping to an internal hash-map.
@param scanner the {@link ResultScanner} to add
@return integer scanner id
hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftHBaseServiceHandler.java