コード例 #1
0
ファイル: TrashPolicy.cs プロジェクト: orf53975/hadoop.net
        /// <summary>
        /// Get an instance of the configured TrashPolicy based on the value
        /// of the configuration parameter fs.trash.classname.
        /// </summary>
        /// <param name="conf">the configuration to be used</param>
        /// <param name="fs">the file system to be used</param>
        /// <param name="home">the home directory</param>
        /// <returns>an instance of TrashPolicy</returns>
        public static TrashPolicy GetInstance(Configuration conf, FileSystem fs, Path home
                                              )
        {
            Type trashClass = conf.GetClass <TrashPolicy>("fs.trash.classname", typeof(TrashPolicyDefault
                                                                                       ));
            TrashPolicy trash = ReflectionUtils.NewInstance(trashClass, conf);

            trash.Initialize(conf, fs, home);
            // initialize TrashPolicy
            return(trash);
        }
コード例 #2
0
ファイル: Trash.cs プロジェクト: orf53975/hadoop.net
 /// <summary>Construct a trash can accessor for the FileSystem provided.</summary>
 /// <param name="fs">the FileSystem</param>
 /// <param name="conf">a Configuration</param>
 /// <exception cref="System.IO.IOException"/>
 public Trash(FileSystem fs, Configuration conf)
     : base(conf)
 {
     // configured trash policy instance
     trashPolicy = TrashPolicy.GetInstance(conf, fs, fs.GetHomeDirectory());
 }