code: public int blockReplication(String[] argv, int idx) throws IOException {
      DistributedFileSystem dfs = getDFS();
      if (dfs == null) {
        System.out.println("FileSystem is " + getFS().getUri());
        return -1;
      }
      String option = argv[idx];
      boolean isEnable = true;
      if (option.equals("enable")) {
        isEnable = true;
      } else if (option.equals("disable")) {
        isEnable = false;
      } else {
        printUsage("-blockReplication");
        return -1;
      }
      dfs.blockReplication(isEnable);
      System.out.println("Block Replication is "  + (isEnable? "enabled" : "disabled")
          + " on server " + dfs.getUri());
      return 0;
    }
docs: Enable/Disable Block Replication.
  Usage: java DFSAdmin -blockReplication enable/disable