Not an exact soution what you are looking but near by to solve your usecase. Configure limits using the system properties “oak.queryLimitInMemory” and “oak.queryLimitReads”. Queries that exceed one of the limits are cancelled with an UnsupportedOperationException saying that “The query read more tha...