This is an automated email from the ASF dual-hosted git repository.
joerghoh 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 8677db8d98 OAK-10331 add caller information to different warnings
(#1010)
8677db8d98 is described below
commit 8677db8d98dad5ebe30576d7b56d0f95707ec2fa
Author: Jörg Hoh <[email protected]>
AuthorDate: Wed Jul 5 09:47:02 2023 +0200
OAK-10331 add caller information to different warnings (#1010)
When other warnings are written, the caller is also logged to easier find
the code responsible for it.
---
.../src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
index 51e6ead798..eee7a71dfa 100644
--- a/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
+++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java
@@ -36,6 +36,7 @@ import org.apache.jackrabbit.oak.api.Result.SizePrecision;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.namepath.JcrPathParser;
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
+import org.apache.jackrabbit.oak.plugins.index.IndexUtils;
import org.apache.jackrabbit.oak.plugins.index.counter.jmx.NodeCounter;
import org.apache.jackrabbit.oak.plugins.memory.PropertyValues;
import org.apache.jackrabbit.oak.query.QueryOptions.Traversal;
@@ -587,8 +588,9 @@ public class QueryImpl implements Query {
prepare();
String warn = getWarningForPathFilterMismatch();
if (warn != null) {
+ String caller =
IndexUtils.getCaller(settings.getIgnoredClassNamesInCallTrace());
LOG.warn("Index definition of index used have path restrictions
and query won't return nodes from " +
- "those restricted paths; query={}, plan={}", statement, warn);
+ "those restricted paths; query={}, called by={}, plan={}",
statement, caller, warn);
}
logAdditionalMessages();
if (explain) {
@@ -1276,7 +1278,8 @@ public class QueryImpl implements Query {
// explicitly set in the query
traversal = queryOptions.traversal;
}
- String message = "Traversal query (query without index): " +
statement + "; consider creating an index";
+ String caller =
IndexUtils.getCaller(settings.getIgnoredClassNamesInCallTrace());
+ String message = "Traversal query (query without index): " +
statement + "; called by " + caller + "; consider creating an index";
switch (traversal) {
case DEFAULT:
// not possible (changed to either FAIL or WARN above)