@Override
    public void onFileCopyFailure(Exception e) {
      logger.error("Error Copying File For Replica: " + replicaId.getPartitionId().toPathString());
      logger.error("[Error]: ", e);
      try{
        removeReplicaFromFileCopy(replicaId);
      } catch (Exception ex) {
        logger.error("Error Removing Replica From File Copy: " + replicaId.getPartitionId().toPathString(), ex);
      }
      //TODO: update Metrics For File Copy Failure.
      replicaSyncUpManager.onFileCopyError(replicaId);
    }
Use FileCopyTemporaryDirectoryName to create a temporary directory for file copy.
This will be used to write the files which are not yet written and can be cleaned
up without
ambry-file-transfer/src/main/java/com/github/ambry/filetransfer/FileCopyBasedReplicationSchedulerImpl.java