Set<String> tableName = Stream.of(table).collect(Collectors.toSet());
Set<String> tablesNames = kits.stream().map(FileUnloadingKit::getLongTableName).collect(Collectors.toSet());
if(reports.stream().findFirst().isPresent())
report = reports.stream().findFirst().get();
recordsNumbers.entrySet().stream().sorted(Map.Entry.comparingByValue()).forEach(System.out::println);
Map<String, Integer> tablesStatuses = tables.stream().collect(Collectors.toMap(t1 -> t1, t1 -> 0));
int unloadingTotalDuration = resultData.stream()
.filter(result -> result.uploadDuration != null)
.mapToInt(result -> result.uploadDuration)
.sum();
DeltaResultReport totalDeltaResultReport = (DeltaResultReport) deltaStagesResults.stream()
.filter(report -> report.tableName.equals("TOTAL"))
.distinct()
.toArray()[0];
ResultReport report2 = (ResultReport) stage2Reports.stream()
.filter(report -> report.tableName.equals(report1.tableName))
.distinct()
.toArray()[0];
int consolidatedDuration = results.stream().mapToInt(r -> r.uploadDuration).sum();
deltaStagesResults.forEach(report -> {
if (report.tableName.equals(report1.getTableName())) {
report.setRecordsNumbers(report2.recordsNumbers - report1.recordsNumbers);
}
});
return tables.stream()
.filter(str -> str.startsWith(namePrefix))
.filter(str -> str.endsWith(namePostfix))
.collect(Collectors.toCollection(TreeSet::new));
/**
* Инвертирует словарь.
* При дублях значений во входящем словаре возьмёт первое значение.
* @param inputMap Входящий словарь
* @return Инвертированный словарь
*/
private static Map invertMap(Map inputMap) {
return inputMap.entrySet()
.stream()
.collect(
Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey, (a, b) -> a));
}
Set<String> fastTables = recordsNumbers.entrySet().stream()
.filter(e -> e.getValue() <= config.fastTableRecordsQuantity())
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
Stream<String> lines = Files.lines(Paths.get("my_file.txt"));
Stream<Path> list = Files.list(Paths.get("./"));
Stream<Path> list = Files.walk(Paths.get("./"), 5);