[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [collector/master] Parallelize two more processing steps.
commit 15db1e2a793ac7e67a1e7aa87c2ea857825a98a2
Author: iwakeh <iwakeh@xxxxxxxxxxxxxx>
Date: Wed Jan 31 13:31:25 2018 +0000
Parallelize two more processing steps.
---
src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java b/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java
index a3d2a7e..4496861 100644
--- a/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java
+++ b/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java
@@ -113,7 +113,7 @@ public class SanitizeWeblogs extends CollecTorMain {
LocalDate[] interval = determineInterval(linesByDate.keySet());
linesByDate.entrySet().stream()
.filter((entry) -> entry.getKey().isAfter(interval[0])
- && entry.getKey().isBefore(interval[1]))
+ && entry.getKey().isBefore(interval[1])).parallel()
.forEach((entry) -> storeSanitized(virtualHost, physicalHost,
entry.getKey(), entry.getValue()));
}
@@ -128,7 +128,7 @@ public class SanitizeWeblogs extends CollecTorMain {
.add(date.format(DateTimeFormatter.BASIC_ISO_DATE)).toString();
log.debug("Sanitizing {}.", name);
List<String> retainedLines = lines
- .stream().map((line) -> sanitize(line, date))
+ .stream().parallel().map((line) -> sanitize(line, date))
.filter((line) -> line.isPresent()).map((line) -> line.get())
.collect(Collectors.toList());
retainedLines.sort(null);
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits