1
0

[HUDI-1913] Using streams instead of loops for input/output (#2962)

This commit is contained in:
zhangminglei
2021-05-19 09:13:38 +08:00
committed by GitHub
parent 5d1f592395
commit fe3f5c2d56
4 changed files with 12 additions and 25 deletions

View File

@@ -100,10 +100,9 @@ public class DFSPropertiesConfiguration {
*/
public void addProperties(BufferedReader reader) throws IOException {
try {
String line;
while ((line = reader.readLine()) != null) {
reader.lines().forEach(line -> {
if (line.startsWith("#") || line.equals("") || !line.contains("=")) {
continue;
return;
}
String[] split = splitProperty(line);
if (line.startsWith("include=") || line.startsWith("include =")) {
@@ -111,7 +110,8 @@ public class DFSPropertiesConfiguration {
} else {
props.setProperty(split[0], split[1]);
}
}
});
} finally {
reader.close();
}