dlmarion commented on code in PR #4440:
URL: https://github.com/apache/accumulo/pull/4440#discussion_r1555795715
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java:
##########
@@ -283,23 +293,25 @@ long finish() {
results.values().stream().allMatch(result -> result.getStatus() ==
Status.ACCEPTED)
&& skipped == 0;
+ results.forEach((extent, condResult) -> {
+ if (condResult.getStatus() == Status.ACCEPTED) {
+ loadingFiles.get(extent).forEach(file ->
TabletLogger.bulkImported(extent, file));
+ } else {
+ var metadata = condResult.readMetadata();
+ if (metadata == null) {
+ log.debug("Tablet update failed, tablet is gone {} {} {}", fateId,
extent,
+ condResult.getStatus());
+ } else {
+ log.debug("Tablet update failed {} {} {} {} {} {}", fateId, extent,
+ condResult.getStatus(), metadata.getOperationId(),
metadata.getLocation(),
+ metadata.getLoaded());
+ }
+ }
+ });
+
Review Comment:
I think you could probably get rid of the `allDone` variable and associated
stream operation by just setting an AtomicBoolean to `true` in the `else`
clause of the conditional below. Then after checking all results, you could
return 1000 if skipped != 0 or this new boolean is true.
Something like:
```suggestion
AtomicBoolean seenFailure = new AtomicBoolean(false);
results.forEach((extent, condResult) -> {
if (condResult.getStatus() == Status.ACCEPTED) {
loadingFiles.get(extent).forEach(file ->
TabletLogger.bulkImported(extent, file));
} else {
seenFailure.set(true);
var metadata = condResult.readMetadata();
if (metadata == null) {
log.debug("Tablet update failed, tablet is gone {} {} {}",
fateId, extent,
condResult.getStatus());
} else {
log.debug("Tablet update failed {} {} {} {} {} {}", fateId,
extent,
condResult.getStatus(), metadata.getOperationId(),
metadata.getLocation(),
metadata.getLoaded());
}
}
});
if (seenFailure.get() || skipped != 0) {
return 1000;
} else {
return 0;
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]