Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import org.apache.hadoop.hbase.util.HFileArchiveUtil;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.InputFormat;
Expand Down Expand Up @@ -211,14 +210,12 @@ public void setup(Context context) throws IOException {
outputArchive = new Path(outputRoot, HConstants.HFILE_ARCHIVE_DIRECTORY);

try {
srcConf.setBoolean("fs." + inputRoot.toUri().getScheme() + ".impl.disable.cache", true);
inputFs = FileSystem.get(inputRoot.toUri(), srcConf);
} catch (IOException e) {
throw new IOException("Could not get the input FileSystem with root=" + inputRoot, e);
}

try {
destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
outputFs = FileSystem.get(outputRoot.toUri(), destConf);
} catch (IOException e) {
throw new IOException("Could not get the output FileSystem with root=" + outputRoot, e);
Expand All @@ -241,12 +238,6 @@ public void setup(Context context) throws IOException {
}
}

@Override
protected void cleanup(Context context) {
IOUtils.closeStream(inputFs);
IOUtils.closeStream(outputFs);
}

@Override
public void map(BytesWritable key, NullWritable value, Context context)
throws InterruptedException, IOException {
Expand Down Expand Up @@ -990,10 +981,8 @@ public int doWork() throws IOException {
}

Configuration srcConf = HBaseConfiguration.createClusterConf(conf, null, CONF_SOURCE_PREFIX);
srcConf.setBoolean("fs." + inputRoot.toUri().getScheme() + ".impl.disable.cache", true);
FileSystem inputFs = FileSystem.get(inputRoot.toUri(), srcConf);
Configuration destConf = HBaseConfiguration.createClusterConf(conf, null, CONF_DEST_PREFIX);
destConf.setBoolean("fs." + outputRoot.toUri().getScheme() + ".impl.disable.cache", true);
FileSystem outputFs = FileSystem.get(outputRoot.toUri(), destConf);
boolean skipTmp = conf.getBoolean(CONF_SKIP_TMP, false)
|| conf.get(SnapshotDescriptionUtils.SNAPSHOT_WORKING_DIR) != null;
Expand Down Expand Up @@ -1149,9 +1138,6 @@ public int doWork() throws IOException {
}
outputFs.delete(outputSnapshotDir, true);
return 1;
} finally {
IOUtils.closeStream(inputFs);
IOUtils.closeStream(outputFs);
}
}

Expand Down