Ejemplo n.º 1
0
        /// <summary>
        /// Get an instance of the configured Block Placement Policy based on the
        /// the configuration property
        /// <see cref="Org.Apache.Hadoop.Hdfs.DFSConfigKeys.DfsBlockReplicatorClassnameKey"/>
        /// .
        /// </summary>
        /// <param name="conf">the configuration to be used</param>
        /// <param name="stats">an object that is used to retrieve the load on the cluster</param>
        /// <param name="clusterMap">the network topology of the cluster</param>
        /// <returns>an instance of BlockPlacementPolicy</returns>
        public static BlockPlacementPolicy GetInstance(Configuration conf, FSClusterStats
                                                       stats, NetworkTopology clusterMap, Host2NodesMap host2datanodeMap)
        {
            Type replicatorClass = conf.GetClass <BlockPlacementPolicy>(DFSConfigKeys.DfsBlockReplicatorClassnameKey
                                                                        , DFSConfigKeys.DfsBlockReplicatorClassnameDefault);
            BlockPlacementPolicy replicator = ReflectionUtils.NewInstance(replicatorClass, conf
                                                                          );

            replicator.Initialize(conf, stats, clusterMap, host2datanodeMap);
            return(replicator);
        }
Ejemplo n.º 2
0
 protected internal override void Initialize(Configuration conf, FSClusterStats stats
                                             , NetworkTopology clusterMap, Host2NodesMap host2datanodeMap)
 {
     base.Initialize(conf, stats, clusterMap, host2datanodeMap);
 }
Ejemplo n.º 3
0
 protected internal BlockPlacementPolicyWithNodeGroup(Configuration conf, FSClusterStats
                                                      stats, NetworkTopology clusterMap, DatanodeManager datanodeManager)
 {
     Initialize(conf, stats, clusterMap, host2datanodeMap);
 }
Ejemplo n.º 4
0
 /// <summary>Used to setup a BlockPlacementPolicy object.</summary>
 /// <remarks>
 /// Used to setup a BlockPlacementPolicy object. This should be defined by
 /// all implementations of a BlockPlacementPolicy.
 /// </remarks>
 /// <param name="conf">the configuration object</param>
 /// <param name="stats">retrieve cluster status from here</param>
 /// <param name="clusterMap">cluster topology</param>
 protected internal abstract void Initialize(Configuration conf, FSClusterStats stats
                                             , NetworkTopology clusterMap, Host2NodesMap host2datanodeMap);