You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2014/08/06 16:01:53 UTC
svn commit: r1616237 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/FilterIterators.java
Author: thomasm
Date: Wed Aug 6 14:01:52 2014
New Revision: 1616237
URL: http://svn.apache.org/r1616237
Log:
OAK-2018 Query: before throwing "traversed more than x nodes" exception, log it
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/FilterIterators.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/FilterIterators.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/FilterIterators.java?rev=1616237&r1=1616236&r2=1616237&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/FilterIterators.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/FilterIterators.java Wed Aug 6 14:01:52 2014
@@ -20,11 +20,16 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.NoSuchElementException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Filtering iterators that are useful for queries with limit, offset, order by,
* or distinct.
*/
public class FilterIterators {
+
+ private static final Logger LOG = LoggerFactory.getLogger(FilterIterators.class);
/**
* Verify the number of in-memory nodes is below the limit.
@@ -35,10 +40,13 @@ public class FilterIterators {
*/
public static void checkMemoryLimit(long count, long maxMemoryEntries) {
if (count > maxMemoryEntries) {
- throw new UnsupportedOperationException(
- "The query read more than " +
- maxMemoryEntries + " nodes in memory. " +
- "To avoid running out of memory, processing was stopped.");
+ String message = "The query read more than " +
+ maxMemoryEntries + " nodes in memory.";
+ UnsupportedOperationException e = new UnsupportedOperationException(
+ message +
+ " To avoid running out of memory, processing was stopped.");
+ LOG.warn(message, e);
+ throw e;
}
}
@@ -50,10 +58,13 @@ public class FilterIterators {
*/
public static void checkReadLimit(long count, long maxReadEntries) {
if (count > maxReadEntries) {
- throw new UnsupportedOperationException(
- "The query read or traversed more than " +
- maxReadEntries + " nodes. " +
- "To avoid affecting other tasks, processing was stopped.");
+ String message = "The query read or traversed more than " +
+ maxReadEntries + " nodes.";
+ UnsupportedOperationException e = new UnsupportedOperationException(
+ message +
+ " To avoid affecting other tasks, processing was stopped.");
+ LOG.warn(message, e);
+ throw e;
}
}