public static Scan getScanForTableName(Configuration conf, TableName tableName) {
    // Start key is just the table name with delimiters
    byte[] startKey = ClientMetaTableAccessor.getTableStartRowForMeta(tableName, QueryType.REGION);
    // Stop key appends the smallest possible char to the table name
    byte[] stopKey = ClientMetaTableAccessor.getTableStopRowForMeta(tableName, QueryType.REGION);

    Scan scan = getMetaScan(conf, -1);
    scan.withStartRow(startKey);
    scan.withStopRow(stopKey);
    return scan;
  }
This method creates a Scan object that will only scan catalog rows that belong to the specified
table. It doesn't specify any columns. This is a better alternative to just using a start row
and scan until it hits a new table since that requires parsing the HRI to get the table name.
@param tableName bytes of table's name
@return configured Scan object
hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java