private List<String> readFile(final String filename) {
    if (null == filename) {
      return null;
    }
    try {
      if (filename.startsWith("file:")) {
        return readFileFromLocalFS(filename);
      }
      return readFileFromHDFS(filename);
    } catch (IOException e) {
      LOG.error("cannot read rules file located at ' " + filename + " ':" + e.getMessage());
      return null;
    }
  }
used to read the rule files from either HDFS or local FS
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/HeterogeneousRegionCountCostFunction.java