This is an automated email from the ASF dual-hosted git repository.
vinoyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 3a926aa [HUDI-1773] HoodieFileGroup code optimize (#2781)
3a926aa is described below
commit 3a926aacf6552fc06005db4a7880a233db904330
Author: hiscat <[email protected]>
AuthorDate: Wed Apr 7 18:16:03 2021 +0800
[HUDI-1773] HoodieFileGroup code optimize (#2781)
---
.../main/java/org/apache/hudi/common/model/HoodieFileGroup.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git
a/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileGroup.java
b/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileGroup.java
index 849f08e..6979c30 100644
---
a/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileGroup.java
+++
b/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileGroup.java
@@ -26,7 +26,6 @@ import org.apache.hudi.common.util.collection.Pair;
import java.io.Serializable;
import java.util.Comparator;
import java.util.List;
-import java.util.Map;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -133,7 +132,7 @@ public class HoodieFileGroup implements Serializable {
* Get all the the file slices including in-flight ones as seen in
underlying file-system.
*/
public Stream<FileSlice> getAllFileSlicesIncludingInflight() {
- return fileSlices.entrySet().stream().map(Map.Entry::getValue);
+ return fileSlices.values().stream();
}
/**
@@ -148,7 +147,7 @@ public class HoodieFileGroup implements Serializable {
*/
public Stream<FileSlice> getAllFileSlices() {
if (!timeline.empty()) {
- return
fileSlices.entrySet().stream().map(Map.Entry::getValue).filter(this::isFileSliceCommitted);
+ return fileSlices.values().stream().filter(this::isFileSliceCommitted);
}
return Stream.empty();
}
@@ -182,7 +181,7 @@ public class HoodieFileGroup implements Serializable {
* Obtain the latest file slice, upto an instantTime i.e < maxInstantTime.
*
* @param maxInstantTime Max Instant Time
- * @return
+ * @return the latest file slice
*/
public Option<FileSlice> getLatestFileSliceBefore(String maxInstantTime) {
return Option.fromJavaOptional(getAllFileSlices().filter(