// send edits
TransferFsImage.getFileServer(response.getOutputStream(),
nnImage.getFsEditName(), getThrottler(conf));
} else if (ff.putImage()) {
synchronized (fsImageTransferLock) {
final MD5Hash expectedChecksum = ff.getNewChecksum();
// issue a HTTP get request to download the new fsimage
nnImage.validateCheckpointUpload(ff.getToken());
reloginIfNecessary().doAs(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() throws Exception {
MD5Hash actualChecksum = TransferFsImage.getFileClient(ff.getInfoServer(),
"getimage=1", nnImage.getFsImageNameCheckpoint(), true);
LOG.info("Downloaded new fsimage with checksum: " + actualChecksum);
if (!actualChecksum.equals(expectedChecksum)) {
throw new IOException("Actual checksum of transferred fsimage: "
+ actualChecksum + " does not match expected checksum: "
+ expectedChecksum);
}
return null;