code: public static BlockPlacementPolicy getInstance(Configuration conf, 
                                                   FSClusterStats stats,
                                                   NetworkTopology clusterMap,
                                                   HostsFileReader hostsReader,
                                                   DNSToSwitchMapping dnsToSwitchMapping,
                                                   FSNamesystem namesystem) {
      Class<? extends BlockPlacementPolicy> replicatorClass =
                        conf.getClass("dfs.block.replicator.classname",
                                      BlockPlacementPolicyDefault.class,
                                      BlockPlacementPolicy.class);
      BlockPlacementPolicy replicator = (BlockPlacementPolicy) ReflectionUtils.newInstance(
                                                               replicatorClass, conf);
      replicator.initialize(conf, stats, clusterMap, hostsReader, 
                            dnsToSwitchMapping, namesystem);
      return replicator;
    }
docs: Get an instance of the configured Block Placement Policy based on the
  value of the configuration paramater dfs.block.replicator.classname.
  
  @param conf the configuration to be used
  @param stats an object thatis used to retrieve the load on the cluster
  @param clusterMap the network topology of the cluster
  @param namesystem the FSNamesystem
  @return an instance of BlockPlacementPolicy