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 ; }
Get an instance of the configured Block Placement Policy based on the value of the configuration paramater dfs . block . replicator . classname .