@Path("{scanspec: .*[*]$}")
  public TableScanResource getScanResource(final @PathParam("scanspec") String scanSpec,
    @DefaultValue(Integer.MAX_VALUE + "") @QueryParam(Constants.SCAN_LIMIT) int userRequestedLimit,
    @DefaultValue("") @QueryParam(Constants.SCAN_START_ROW) String startRow,
    @DefaultValue("") @QueryParam(Constants.SCAN_END_ROW) String endRow,
    @QueryParam(Constants.SCAN_COLUMN) List<String> column,
    @DefaultValue("1") @QueryParam(Constants.SCAN_MAX_VERSIONS) int maxVersions,
    @DefaultValue("-1") @QueryParam(Constants.SCAN_BATCH_SIZE) int batchSize,
    @DefaultValue("0") @QueryParam(Constants.SCAN_START_TIME) long startTime,
    @DefaultValue(Long.MAX_VALUE + "") @QueryParam(Constants.SCAN_END_TIME) long endTime,
    @DefaultValue("true") @QueryParam(Constants.SCAN_CACHE_BLOCKS) boolean cacheBlocks,
    @DefaultValue("false") @QueryParam(Constants.SCAN_REVERSED) boolean reversed,
    @QueryParam(Constants.FILTER) String paramFilter,
    @QueryParam(Constants.FILTER_B64) @Encoded String paramFilterB64,
    @DefaultValue("true") @QueryParam(Constants.SCAN_INCLUDE_START_ROW) boolean includeStartRow,
    @DefaultValue("false") @QueryParam(Constants.SCAN_INCLUDE_STOP_ROW) boolean includeStopRow) {
    try {
      Filter prefixFilter = null;
      Scan tableScan = new Scan();
      if (scanSpec.indexOf('*') > 0) {
        String prefix = scanSpec.substring(0, scanSpec.indexOf('*'));
        byte[] prefixBytes = Bytes.toBytes(prefix);
        prefixFilter = new PrefixFilter(Bytes.toBytes(prefix));
        if (startRow.isEmpty()) {
          tableScan.withStartRow(prefixBytes, includeStartRow);
        }
      }
      if (LOG.isTraceEnabled()) {
        LOG.trace("Query parameters  : Table Name = > " + this.table + " Start Row => " + startRow
          + " End Row => " + endRow + " Columns => " + column + " Start Time => " + startTime
          + " End Time => " + endTime + " Cache Blocks => " + cacheBlocks + " Max Versions => "
          + maxVersions + " Batch Size => " + batchSize);
      }
      Table hTable = RESTServlet.getInstance().getTable(this.table);
      tableScan.setBatch(batchSize);
      tableScan.readVersions(maxVersions);
      tableScan.setTimeRange(startTime, endTime);
      if (!startRow.isEmpty()) {
        tableScan.withStartRow(Bytes.toBytes(startRow), includeStartRow);
      }
      tableScan.withStopRow(Bytes.toBytes(endRow), includeStopRow);
      for (String col : column) {
        byte[][] parts = CellUtil.parseColumn(Bytes.toBytes(col.trim()));
        if (parts.length == 1) {
          if (LOG.isTraceEnabled()) {
            LOG.trace("Scan family : " + Bytes.toStringBinary(parts[0]));
          }
          tableScan.addFamily(parts[0]);
        } else if (parts.length == 2) {
          if (LOG.isTraceEnabled()) {
            LOG.trace("Scan family and column : " + Bytes.toStringBinary(parts[0]) + "  "
              + Bytes.toStringBinary(parts[1]));
          }
          tableScan.addColumn(parts[0], parts[1]);
        } else {
          throw new IllegalArgumentException("Invalid column specifier.");
        }
      }
      FilterList filterList = new FilterList();
      byte[] filterBytes = null;
      if (paramFilterB64 != null) {
        filterBytes = base64Urldecoder.decode(paramFilterB64);
      } else if (paramFilter != null) {
        filterBytes = paramFilter.getBytes();
      }
      if (filterBytes != null) {
        // Note that this is a completely different representation of the filters
        // than the JSON one used in the /table/scanner endpoint
        ParseFilter pf = new ParseFilter();
        Filter parsedParamFilter = pf.parseFilterString(filterBytes);
        if (parsedParamFilter != null) {
          filterList.addFilter(parsedParamFilter);
        }
      }
      if (prefixFilter != null) {
        filterList.addFilter(prefixFilter);
      }
      if (filterList.size() > 0) {
        tableScan.setFilter(filterList);
      }

      int fetchSize = this.servlet.getConfiguration().getInt(Constants.SCAN_FETCH_SIZE, 10);
      tableScan.setCaching(fetchSize);
      tableScan.setReversed(reversed);
      tableScan.setCacheBlocks(cacheBlocks);
      return new TableScanResource(hTable.getScanner(tableScan), userRequestedLimit);
    } catch (IOException exp) {
      servlet.getMetrics().incrementFailedScanRequests(1);
      processException(exp);
      LOG.warn(exp.toString(), exp);
      return null;
    }
  }
Returns true if the table exists n
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java