satishkotha commented on a change in pull request #3666:
URL: https://github.com/apache/hudi/pull/3666#discussion_r715172056
##########
File path:
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/HoodieSparkClusteringClient.java
##########
@@ -47,8 +52,11 @@ public HoodieSparkClusteringClient(
public void cluster(HoodieInstant instant) throws IOException {
LOG.info("Executing clustering instance " + instant);
SparkRDDWriteClient<T> writeClient = (SparkRDDWriteClient<T>)
clusteringClient;
- JavaRDD<WriteStatus> res = writeClient.cluster(instant.getTimestamp(),
true).getWriteStatuses();
- if (res != null &&
res.collect().stream().anyMatch(WriteStatus::hasErrors)) {
+ Option<HoodieCommitMetadata> commitMetadata =
writeClient.cluster(instant.getTimestamp(), true).getCommitMetadata();
+ List<HoodieWriteStat> writeStats =
commitMetadata.get().getPartitionToWriteStats().entrySet().stream().flatMap(e ->
+ e.getValue().stream()).collect(Collectors.toList());
Review comment:
minor: Can we just use Stream<HoodieWriteStat>? Do you really need to
collect all WriteStats to a list? We are converting it back to stream in next
line.
--
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]