diff --git a/build.gradle b/build.gradle index 3751ac2..99b5636 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ ext { lib_log4j2_core = "org.apache.logging.log4j:log4j-core:${version_log4j2}" lib_log4j2_slf4j_impl = "org.apache.logging.log4j:log4j-slf4j-impl:${version_log4j2}" - lib_primitive_collections='org.lucares:primitiveCollections:0.1.20201115124106' + lib_primitive_collections='org.lucares:primitiveCollections:0.2' lib_spring_boot_log4j2="org.springframework.boot:spring-boot-starter-log4j2:${version_spring}" lib_spring_boot_test="org.springframework.boot:spring-boot-starter-test:${version_spring}" @@ -60,6 +60,7 @@ subprojects { // the repositories for external depenencies repositories { + mavenLocal() maven { url 'https://repo.lucares.de/' content { includeGroup "org.lucares" } diff --git a/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/CumulativeDistributionCustomAggregator.java b/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/CumulativeDistributionCustomAggregator.java index ac15c40..23bbc7b 100644 --- a/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/CumulativeDistributionCustomAggregator.java +++ b/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/CumulativeDistributionCustomAggregator.java @@ -58,10 +58,6 @@ public class CumulativeDistributionCustomAggregator implements CustomAggregator } } - public long getMaxValue() { - return maxValue; - } - public Percentiles getPercentiles() { return percentiles; } @@ -86,18 +82,15 @@ public class CumulativeDistributionCustomAggregator implements CustomAggregator @Override public void addValue(final long epochMilli, final long value) { - map.compute(value, 0, l -> l + 1); + map.compute(value, 0, (__, l) -> l + 1); totalValues++; } public Percentiles getPercentiles() { - final long start = System.nanoTime(); - final ToPercentiles toPercentiles = new ToPercentiles(totalValues); toPercentiles.collect(map); final Percentiles result = toPercentiles.getPercentiles(); - System.out.println("getPercentiles took: " + (System.nanoTime() - start) / 1_000_000.0 + " ms"); return result; } @@ -107,10 +100,8 @@ public class CumulativeDistributionCustomAggregator implements CustomAggregator final char separator = ','; final char newline = '\n'; - final long start = System.nanoTime(); final ToPercentiles toPercentiles = new ToPercentiles(totalValues); toPercentiles.collect(map); - System.out.println("getAggregated took: " + (System.nanoTime() - start) / 1_000_000.0 + " ms"); final File dataFile = File.createTempFile("data", ".dat", tmpDir.toFile()); try (final Writer output = new BufferedWriter( diff --git a/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/HistogramAggregator.java b/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/HistogramAggregator.java index 02bb2c1..f0fca4a 100644 --- a/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/HistogramAggregator.java +++ b/pdb-plotting/src/main/java/org/lucares/pdb/plot/api/HistogramAggregator.java @@ -30,7 +30,7 @@ public class HistogramAggregator implements CustomAggregator { @Override public void accept(final long key, final long value) { final long bin = binWidth * (key / binWidth); - bins.compute(bin, 0, oldValue -> oldValue + value); + bins.compute(bin, 0, (__, oldValue) -> oldValue + value); } public LongLongHashMap getBins() { @@ -52,7 +52,7 @@ public class HistogramAggregator implements CustomAggregator { @Override public void addValue(final long epochMilli, final long value) { - map.compute(value, 0, l -> l + 1); + map.compute(value, 0, (__, l) -> l + 1); min = min < value ? min : value; max = max > value ? max : value; }