jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r566167 - in /jackrabbit/trunk/jackrabbit-core/src/main: config/repository.xml java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Date Wed, 15 Aug 2007 14:05:55 GMT
Author: mreutegg
Date: Wed Aug 15 07:05:54 2007
New Revision: 566167

URL: http://svn.apache.org/viewvc?view=rev&rev=566167
Log:
JCR-1063: Disable consistency check per default

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml?view=diff&rev=566167&r1=566166&r2=566167
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml Wed Aug 15 07:05:54 2007
@@ -91,7 +91,12 @@
               uuids to lucene document numbers
             - forceConsistencyCheck: runs a consistency check on every startup. If
               false, a consistency check is only performed when the search index
-              detects a prior forced shutdown.
+              detects a prior forced shutdown. This parameter only has an effect
+              if 'enableConsistencyCheck' is set to 'true'.
+            - enableConsistencyCheck: if set to 'true' a consistency check is
+              performed depending on the parameter 'forceConsistencyCheck'. If
+              set to 'false' no consistency check is performed on startup, even
+              if a redo log had been applied.
             - autoRepair: errors detected by a consistency check are automatically
               repaired. If false, errors are only written to the log.
             - analyzer: class name of a lucene analyzer to use for fulltext indexing of text.
@@ -131,6 +136,7 @@
             <param name="bufferSize" value="10"/>
             <param name="cacheSize" value="1000"/>
             <param name="forceConsistencyCheck" value="false"/>
+            <param name="enableConsistencyCheck" value="false"/>
             <param name="autoRepair" value="true"/>
             <param name="analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
             <param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl"/>

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?view=diff&rev=566167&r1=566166&r2=566167
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Wed Aug 15 07:05:54 2007
@@ -219,6 +219,16 @@
     private boolean forceConsistencyCheck = false;
 
     /**
+     * If set <code>true</code> the index is checked for consistency depending
+     * on the {@link #forceConsistencyCheck} parameter. If set to
+     * <code>false</code>, no consistency check is performed, even if the redo
+     * log had been applied on startup.
+     * <p/>
+     * Default value is: <code>false</code>.
+     */
+    private boolean consistencyCheckEnabled = false;
+
+    /**
      * If set <code>true</code> errors detected by the consistency check are
      * repaired. If <code>false</code> the errors are only reported in the log.
      * <p/>
@@ -343,7 +353,8 @@
 
         index = new MultiIndex(indexDir, this, context.getItemStateManager(),
                 context.getRootId(), excludedIDs, nsMappings);
-        if (index.getRedoLogApplied() || forceConsistencyCheck) {
+        if (consistencyCheckEnabled
+                && (index.getRedoLogApplied() || forceConsistencyCheck)) {
             log.info("Running consistency check...");
             try {
                 ConsistencyCheck check = ConsistencyCheck.run(index,
@@ -1440,6 +1451,24 @@
     public String getSynonymProviderClass() {
         return synonymProviderClass != null ?
                 synonymProviderClass.getName() : null;
+    }
+
+    /**
+     * Enables or disables the consistency check on startup. Consistency checks
+     * are disabled per default.
+     *
+     * @param b <code>true</code> enables consistency checks.
+     * @see #setForceConsistencyCheck(boolean)
+     */
+    public void setEnableConsistencyCheck(boolean b) {
+        this.consistencyCheckEnabled = b;
+    }
+
+    /**
+     * @return <code>true</code> if consistency checks are enabled.
+     */
+    public boolean getEnableConsistencyCheck() {
+        return consistencyCheckEnabled;
     }
 
     //----------------------------< internal >----------------------------------



Mime
View raw message