* if the file is not found.
*/
private FSDataInputStream openSourceFile(Context context, final SnapshotFileInfo fileInfo)
throws IOException {
try {
FileLink link = null;
switch (fileInfo.getType()) {
case HFILE:
Path inputPath = new Path(fileInfo.getHfile());
link = new HFileLink(inputRoot, inputArchive, inputPath);
break;
case WAL:
String serverName = fileInfo.getWalServer();
String logName = fileInfo.getWalName();
link = new HLogLink(inputRoot, serverName, logName);
break;
default:
throw new IOException("Invalid File Type: " + fileInfo.getType().toString());
}
return link.open(inputFs);
} catch (IOException e) {
context.getCounter(Counter.MISSING_FILES).increment(1);
LOG.error("Unable to open source file=" + fileInfo.toString(), e);
throw e;
}