public void setDFSCluster(MiniDFSCluster cluster, boolean requireDown)
    throws IllegalStateException, IOException {
    if (dfsCluster != null && requireDown && dfsCluster.isClusterUp()) {
      throw new IllegalStateException("DFSCluster is already running! Shut it down first.");
    }
    this.dfsCluster = cluster;
    this.setFs();
  }
Set the MiniDFSCluster
@param cluster     cluster to use
@param requireDown require the that cluster not be "up" (MiniDFSCluster#isClusterUp) before it
                   is set.
@throws IllegalStateException if the passed cluster is up when it is required to be down
@throws IOException           if the FileSystem could not be set from the passed dfs cluster
hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java