cku328 commented on a change in pull request #1986:
URL: https://github.com/apache/ozone/pull/1986#discussion_r587475642
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/DownloadAndImportReplicator.java
##########
@@ -109,23 +109,26 @@ public void replicate(ReplicationTask task) {
CompletableFuture<Path> tempTarFile = downloader
.getContainerDataFromReplicas(containerID,
sourceDatanodes);
-
- try {
- //wait for the download. This thread pool is limiting the paralell
- //downloads, so it's ok to block here and wait for the full download.
- Path path = tempTarFile.get();
- long bytes = Files.size(path);
-
- LOG.info("Container {} is downloaded with size {}, starting to import.",
- containerID, bytes);
- task.setTransferredBytes(bytes);
-
- importContainer(containerID, path);
- LOG.info("Container {} is replicated successfully", containerID);
- task.setStatus(Status.DONE);
- } catch (Exception e) {
- LOG.error("Container {} replication was unsuccessful.", containerID, e);
+ if (tempTarFile == null) {
task.setStatus(Status.FAILED);
+ } else {
+ try {
+ //wait for the download. This thread pool is limiting the parallel
+ //downloads, so it's ok to block here and wait for the full download.
Review comment:
```suggestion
// Wait for the download. This thread pool is limiting the parallel
// downloads, so it's ok to block here and wait for the full
download.
```
The comments in code should begin with a whitespace after the leading
forward slashes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]