Author: reschke
Date: Wed Oct 11 15:01:01 2017
New Revision: 1811835

URL: http://svn.apache.org/viewvc?rev=1811835&view=rev
Log:
OAK-6789: RDB: RevisionGC performance on Oracle

Part 1: restrict existing conditional delete implementation to exactly one 
single MODIFIED= condition per ID

Modified:
    
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBC.java

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBC.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBC.java?rev=1811835&r1=1811834&r2=1811835&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBC.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreJDBC.java
 Wed Oct 11 15:01:01 2017
@@ -205,17 +205,18 @@ public class RDBDocumentStoreJDBC {
             whereClause.append(or);
             or = " or ";
             whereClause.append("ID=?");
-            for (Entry<Key, Condition> c : entry.getValue().entrySet()) {
+            if (entry.getValue().entrySet().size() != 1) {
+                throw new DocumentStoreException("Unsupported number of 
conditions in : " + entry.getValue().entrySet());
+            } else {
+                Entry<Key, Condition> c = 
entry.getValue().entrySet().iterator().next();
                 if (!c.getKey().getName().equals(MODIFIED)) {
                     throw new DocumentStoreException("Unsupported condition: " 
+ c);
-                }
-                whereClause.append(" and MODIFIED");
-                if (c.getValue().type == Condition.Type.EQUALS && 
c.getValue().value instanceof Long) {
-                    whereClause.append("=?");
-                } else if (c.getValue().type == Condition.Type.EXISTS) {
-                    whereClause.append(" is not null");
                 } else {
-                    throw new DocumentStoreException("Unsupported condition: " 
+ c);
+                    if (c.getValue().type == Condition.Type.EQUALS && 
c.getValue().value instanceof Long) {
+                        whereClause.append(" and MODIFIED=?");
+                    } else {
+                        throw new DocumentStoreException("Unsupported 
condition: " + c);
+                    }
                 }
             }
         }


Reply via email to