jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1182824 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java
Date Thu, 13 Oct 2011 13:00:31 GMT
Author: alexparvulescu
Date: Thu Oct 13 13:00:30 2011
New Revision: 1182824

URL: http://svn.apache.org/viewvc?rev=1182824&view=rev
Log:
JCR-3107 Speed up hierarchy cache initialization
 - added logs

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java?rev=1182824&r1=1182823&r2=1182824&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/CachingIndexReader.java
Thu Oct 13 13:00:30 2011
@@ -406,6 +406,7 @@ class CachingIndexReader extends FilterI
                 if (!initCacheFromFile) {
                     // file-based cache is not available, load from the
                     // repository
+                    log.debug("persisted cache is not available, will load directly from
the repository.");
                     initializeParents(reader);
                 }
             } catch (Exception e) {
@@ -644,10 +645,15 @@ class CachingIndexReader extends FilterI
         private boolean loadCacheFromFile() throws IOException {
             IndexInput ii = null;
             try {
+                long time = System.currentTimeMillis();
                 ii = reader.directory().openInput(FILE_CACHE_NAME_ARRAY);
                 for (int i = 0; i < inSegmentParents.length; i++) {
                     inSegmentParents[i] = ii.readInt();
                 }
+                log.debug(
+                        "persisted cache initialized {} DocIds in {} ms",
+                        new Object[] { inSegmentParents.length,
+                                System.currentTimeMillis() - time });
                 return true;
             } catch (FileNotFoundException ignore) {
                 // expected in the case where the file-based cache has not been



Mime
View raw message