59
59
import org .apache .hadoop .hbase .util .HFileArchiveUtil ;
60
60
import org .apache .hadoop .hbase .util .Pair ;
61
61
import org .apache .hadoop .io .BytesWritable ;
62
- import org .apache .hadoop .io .IOUtils ;
63
62
import org .apache .hadoop .io .NullWritable ;
64
63
import org .apache .hadoop .io .Writable ;
65
64
import org .apache .hadoop .mapreduce .InputFormat ;
@@ -209,14 +208,12 @@ public void setup(Context context) throws IOException {
209
208
outputArchive = new Path (outputRoot , HConstants .HFILE_ARCHIVE_DIRECTORY );
210
209
211
210
try {
212
- srcConf .setBoolean ("fs." + inputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
213
211
inputFs = FileSystem .get (inputRoot .toUri (), srcConf );
214
212
} catch (IOException e ) {
215
213
throw new IOException ("Could not get the input FileSystem with root=" + inputRoot , e );
216
214
}
217
215
218
216
try {
219
- destConf .setBoolean ("fs." + outputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
220
217
outputFs = FileSystem .get (outputRoot .toUri (), destConf );
221
218
} catch (IOException e ) {
222
219
throw new IOException ("Could not get the output FileSystem with root=" + outputRoot , e );
@@ -238,12 +235,6 @@ public void setup(Context context) throws IOException {
238
235
}
239
236
}
240
237
241
- @ Override
242
- protected void cleanup (Context context ) {
243
- IOUtils .closeStream (inputFs );
244
- IOUtils .closeStream (outputFs );
245
- }
246
-
247
238
@ Override
248
239
public void map (BytesWritable key , NullWritable value , Context context )
249
240
throws InterruptedException , IOException {
@@ -987,10 +978,8 @@ public int doWork() throws IOException {
987
978
}
988
979
989
980
Configuration srcConf = HBaseConfiguration .createClusterConf (conf , null , CONF_SOURCE_PREFIX );
990
- srcConf .setBoolean ("fs." + inputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
991
981
FileSystem inputFs = FileSystem .get (inputRoot .toUri (), srcConf );
992
982
Configuration destConf = HBaseConfiguration .createClusterConf (conf , null , CONF_DEST_PREFIX );
993
- destConf .setBoolean ("fs." + outputRoot .toUri ().getScheme () + ".impl.disable.cache" , true );
994
983
FileSystem outputFs = FileSystem .get (outputRoot .toUri (), destConf );
995
984
boolean skipTmp = conf .getBoolean (CONF_SKIP_TMP , false )
996
985
|| conf .get (SnapshotDescriptionUtils .SNAPSHOT_WORKING_DIR ) != null ;
@@ -1146,9 +1135,6 @@ public int doWork() throws IOException {
1146
1135
}
1147
1136
outputFs .delete (outputSnapshotDir , true );
1148
1137
return 1 ;
1149
- } finally {
1150
- IOUtils .closeStream (inputFs );
1151
- IOUtils .closeStream (outputFs );
1152
1138
}
1153
1139
}
1154
1140
0 commit comments