Skip to content

Commit 6b6949a

Browse files
committed
Revert "OAK-11769 : replaced DoubleMath.fuzzyCompare with commons-math3 Precision (#2345)"
This reverts commit b9c3070.
1 parent b9c3070 commit 6b6949a

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

oak-it-osgi/test-bundles.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
<include>commons-logging:commons-logging</include>
4040
<include>com.fasterxml.jackson.core:jackson-core</include>
4141
<include>org.apache.commons:commons-lang3</include>
42-
<include>org.apache.commons:commons-math3</include>
4342
<include>org.apache.commons:commons-text</include>
4443
<include>org.apache.commons:commons-collections4</include>
4544
<include>org.apache.jackrabbit:jackrabbit-jcr-commons</include>

oak-run-elastic/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
105 MB: Azure updates
4343
107 MB: RDB/Tomcat (OAK-10752)
4444
-->
45-
<max.jar.size>119000000</max.jar.size>
45+
<max.jar.size>117000000</max.jar.size>
4646

4747
</properties>
4848

oak-store-document/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@
152152
<groupId>commons-io</groupId>
153153
<artifactId>commons-io</artifactId>
154154
</dependency>
155-
<dependency>
156-
<groupId>org.apache.commons</groupId>
157-
<artifactId>commons-math3</artifactId>
158-
</dependency>
159155
<dependency>
160156
<groupId>org.quartz-scheduler</groupId>
161157
<artifactId>quartz</artifactId>

oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoThrottlerFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
*/
1919
package org.apache.jackrabbit.oak.plugins.document.mongo;
2020

21-
import org.apache.commons.math3.util.Precision;
2221
import org.apache.jackrabbit.guava.common.util.concurrent.AtomicDouble;
2322
import org.apache.jackrabbit.oak.plugins.document.Throttler;
2423
import org.jetbrains.annotations.NotNull;
2524

25+
import static org.apache.jackrabbit.guava.common.math.DoubleMath.fuzzyCompare;
2626
import static java.util.Objects.requireNonNull;
2727
import static org.apache.jackrabbit.oak.plugins.document.Throttler.NO_THROTTLING;
2828

@@ -78,13 +78,13 @@ public long throttlingTime() {
7878
final double oplogWindow = this.oplogWindow.doubleValue();
7979
long throttleTime = throttlingTime;
8080

81-
if (Precision.compareTo(oplogWindow,threshold/8, 0.001) <= 0) {
81+
if (fuzzyCompare(oplogWindow,threshold/8, 0.001) <= 0) {
8282
throttleTime = throttleTime * 8;
83-
} else if (Precision.compareTo(oplogWindow,threshold/4, 0.001) <= 0) {
83+
} else if (fuzzyCompare(oplogWindow,threshold/4, 0.001) <= 0) {
8484
throttleTime = throttleTime * 4;
85-
} else if (Precision.compareTo(oplogWindow, threshold/2, 0.001) <= 0) {
85+
} else if (fuzzyCompare(oplogWindow, threshold/2, 0.001) <= 0) {
8686
throttleTime = throttleTime * 2;
87-
} else if (Precision.compareTo(oplogWindow, threshold,0.001) <= 0) {
87+
} else if (fuzzyCompare(oplogWindow, threshold,0.001) <= 0) {
8888
throttleTime = throttlingTime;
8989
} else {
9090
throttleTime = 0;

0 commit comments

Comments
 (0)