HADOOP-13700. Remove unthrown IOException from TrashPolicy#initialize and #getInstance signatures.

(cherry picked from commit 12d739a34b)
This commit is contained in:
Andrew Wang 2016-10-12 15:19:52 -07:00
parent 5305a392c3
commit f131d61ff8
1 changed files with 2 additions and 4 deletions

View File

@ -53,9 +53,8 @@ public abstract class TrashPolicy extends Configured {
* not assume trash always under /user/$USER due to HDFS encryption zone. * not assume trash always under /user/$USER due to HDFS encryption zone.
* @param conf the configuration to be used * @param conf the configuration to be used
* @param fs the filesystem to be used * @param fs the filesystem to be used
* @throws IOException
*/ */
public void initialize(Configuration conf, FileSystem fs) throws IOException{ public void initialize(Configuration conf, FileSystem fs) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -137,8 +136,7 @@ public abstract class TrashPolicy extends Configured {
* @param fs the file system to be used * @param fs the file system to be used
* @return an instance of TrashPolicy * @return an instance of TrashPolicy
*/ */
public static TrashPolicy getInstance(Configuration conf, FileSystem fs) public static TrashPolicy getInstance(Configuration conf, FileSystem fs) {
throws IOException {
Class<? extends TrashPolicy> trashClass = conf.getClass( Class<? extends TrashPolicy> trashClass = conf.getClass(
"fs.trash.classname", TrashPolicyDefault.class, TrashPolicy.class); "fs.trash.classname", TrashPolicyDefault.class, TrashPolicy.class);
TrashPolicy trash = ReflectionUtils.newInstance(trashClass, conf); TrashPolicy trash = ReflectionUtils.newInstance(trashClass, conf);