This is an automated email from the ASF dual-hosted git repository.
daim pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8b3989806b OAK-11770 : replaced Doubles.fuzzyEquals with commons-math3
Precision (#2350)
8b3989806b is described below
commit 8b3989806bff5fa64ede24915b64431acde33e1e
Author: Rishabh Kumar <[email protected]>
AuthorDate: Wed Jun 25 11:31:50 2025 +0530
OAK-11770 : replaced Doubles.fuzzyEquals with commons-math3 Precision
(#2350)
Co-authored-by: Rishabh Kumar <[email protected]>
---
.../document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java
index 2e7aea8102..8729cb69f4 100644
---
a/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java
+++
b/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStoreThrottlingMetricsUpdater.java
@@ -18,6 +18,7 @@
*/
package org.apache.jackrabbit.oak.plugins.document.mongo;
+import org.apache.commons.math3.util.Precision;
import org.apache.jackrabbit.guava.common.util.concurrent.AtomicDouble;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
@@ -33,7 +34,6 @@ import java.io.IOException;
import java.util.Objects;
import java.util.concurrent.ScheduledExecutorService;
-import static org.apache.jackrabbit.guava.common.math.DoubleMath.fuzzyEquals;
import static java.lang.Integer.MAX_VALUE;
import static java.lang.Math.abs;
import static java.lang.Math.ceil;
@@ -100,7 +100,7 @@ public class MongoDocumentStoreThrottlingMetricsUpdater
implements Closeable {
final BsonTimestamp startTime = first.get(TS_TIME,
BsonTimestamp.class);
final BsonTimestamp lastTime = last.get(TS_TIME, BsonTimestamp.class);
- if (Objects.equals(startTime, lastTime) || fuzzyEquals(usedSize, 0,
0.00001)) {
+ if (Objects.equals(startTime, lastTime) || Precision.equals(usedSize,
0, 0.00001)) {
return MAX_VALUE;
}
long timeDiffSec = abs(lastTime.getTime() - startTime.getTime());