Skip to content

Commit

Permalink
[ADH-5196] Fix CopyFileAction logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrulya-exe committed Oct 25, 2024
1 parent 89bb14d commit bed3d4a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private void copySingleFile(String src, String dest) throws IOException {
}

private void copyWithOffset(String src, String dest, int bufferSize,
long offset, long length) throws IOException {
long offset, long length) throws IOException {
appendLog(
String.format("Copy with offset %s and length %s", offset, length));

Expand Down Expand Up @@ -222,9 +222,11 @@ private OutputStream getLocalClusterOutputStream(String dest, long offset) throw

private FileStatus validateDestFile(FileStatus destFileStatus) {
if (destFileStatus.getLen() < offset) {
throw new IllegalStateException("Destination file " + destFileStatus.getPath()
+ " is shorter than it should be - expected min length: "
+ offset + ", actual length: " + destFileStatus.getLen());
String errorMessage = String.format(
"Destination file %s is shorter than it should be "
+ "- expected min length: %d, actual length: %d",
destFileStatus.getPath(), offset, destFileStatus.getLen());
throw new IllegalStateException(errorMessage);
}

return destFileStatus;
Expand Down

0 comments on commit bed3d4a

Please sign in to comment.