|
@@ -41,7 +41,8 @@ public class RetriableFileCopyCommand extends RetriableCommand {
|
|
|
|
|
|
private static Log LOG = LogFactory.getLog(RetriableFileCopyCommand.class);
|
|
|
private static int BUFFER_SIZE = 8 * 1024;
|
|
|
-
|
|
|
+ private boolean skipCrc = false;
|
|
|
+
|
|
|
/**
|
|
|
* Constructor, taking a description of the action.
|
|
|
* @param description Verbose description of the copy operation.
|
|
@@ -49,6 +50,17 @@ public class RetriableFileCopyCommand extends RetriableCommand {
|
|
|
public RetriableFileCopyCommand(String description) {
|
|
|
super(description);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Create a RetriableFileCopyCommand.
|
|
|
+ *
|
|
|
+ * @param skipCrc Whether to skip the crc check.
|
|
|
+ * @param description A verbose description of the copy operation.
|
|
|
+ */
|
|
|
+ public RetriableFileCopyCommand(boolean skipCrc, String description) {
|
|
|
+ this(description);
|
|
|
+ this.skipCrc = skipCrc;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* Implementation of RetriableCommand::doExecute().
|
|
@@ -92,7 +104,7 @@ public class RetriableFileCopyCommand extends RetriableCommand {
|
|
|
|
|
|
compareFileLengths(sourceFileStatus, tmpTargetPath, configuration, bytesRead);
|
|
|
//At this point, src&dest lengths are same. if length==0, we skip checksum
|
|
|
- if (bytesRead != 0) {
|
|
|
+ if ((bytesRead != 0) && (!skipCrc)) {
|
|
|
compareCheckSums(sourceFS, sourceFileStatus.getPath(), targetFS, tmpTargetPath);
|
|
|
}
|
|
|
promoteTmpToTarget(tmpTargetPath, target, targetFS);
|