// Create a source file.
String src = "/testInterFileSystemFastCopy MultipleSrc" + hardlink;
generateRandomFile(fs, src, FILESIZE);
String destination = "/testInterFileSystemFastCopy MultipleDestination"
+ hardlink;
FastCopy fastCopy = new FastCopy(conf);
List<FastFileCopyRequest> requests = new ArrayList<FastFileCopyRequest>();
for (int i = 0; i < COPIES; i++) {
requests.add(new FastFileCopyRequest(src, destination + i, fs, remoteFs));
}
NameNode srcNameNode = cluster.getNameNode();
NameNode dstNameNode = remoteCluster.getNameNode();
try {
fastCopy.copy(requests);
for (FastFileCopyRequest r : requests) {
assertTrue(verifyCopiedFile(r.getSrc(), r.getDestination(),
srcNameNode, dstNameNode, fs, remoteFs, hardlink));
verifyFileStatus(r.getDestination(), dstNameNode, fastCopy);
}
} catch (Exception e) {
LOG.error("Fast Copy failed with exception : ", e);
fail("Fast Copy failed");
} finally {
fastCopy.shutdown();
}
assertTrue(pass);
}