5959import org .apache .hadoop .hbase .util .HFileArchiveUtil ;
6060import org .apache .hadoop .hbase .util .Pair ;
6161import org .apache .hadoop .io .BytesWritable ;
62- import org .apache .hadoop .io .IOUtils ;
6362import org .apache .hadoop .io .NullWritable ;
6463import org .apache .hadoop .io .Writable ;
6564import org .apache .hadoop .mapreduce .InputFormat ;
@@ -211,14 +210,12 @@ public void setup(Context context) throws IOException {
211210 outputArchive = new Path (outputRoot , HConstants .HFILE_ARCHIVE_DIRECTORY );
212211
213212 try {
214- srcConf .setBoolean ("fs." + inputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
215213 inputFs = FileSystem .get (inputRoot .toUri (), srcConf );
216214 } catch (IOException e ) {
217215 throw new IOException ("Could not get the input FileSystem with root=" + inputRoot , e );
218216 }
219217
220218 try {
221- destConf .setBoolean ("fs." + outputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
222219 outputFs = FileSystem .get (outputRoot .toUri (), destConf );
223220 } catch (IOException e ) {
224221 throw new IOException ("Could not get the output FileSystem with root=" + outputRoot , e );
@@ -241,12 +238,6 @@ public void setup(Context context) throws IOException {
241238 }
242239 }
243240
244- @ Override
245- protected void cleanup (Context context ) {
246- IOUtils .closeStream (inputFs );
247- IOUtils .closeStream (outputFs );
248- }
249-
250241 @ Override
251242 public void map (BytesWritable key , NullWritable value , Context context )
252243 throws InterruptedException , IOException {
@@ -990,10 +981,8 @@ public int doWork() throws IOException {
990981 }
991982
992983 Configuration srcConf = HBaseConfiguration .createClusterConf (conf , null , CONF_SOURCE_PREFIX );
993- srcConf .setBoolean ("fs." + inputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
994984 FileSystem inputFs = FileSystem .get (inputRoot .toUri (), srcConf );
995985 Configuration destConf = HBaseConfiguration .createClusterConf (conf , null , CONF_DEST_PREFIX );
996- destConf .setBoolean ("fs." + outputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
997986 FileSystem outputFs = FileSystem .get (outputRoot .toUri (), destConf );
998987 boolean skipTmp = conf .getBoolean (CONF_SKIP_TMP , false )
999988 || conf .get (SnapshotDescriptionUtils .SNAPSHOT_WORKING_DIR ) != null ;
@@ -1149,9 +1138,6 @@ public int doWork() throws IOException {
11491138 }
11501139 outputFs .delete (outputSnapshotDir , true );
11511140 return 1 ;
1152- } finally {
1153- IOUtils .closeStream (inputFs );
1154- IOUtils .closeStream (outputFs );
11551141 }
11561142 }
11571143
0 commit comments