Author: nzamosenchuk
Date: 2009-12-29 07:18:42 -0500 (Tue, 29 Dec 2009)
New Revision: 1231
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexInfos.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
Log:
EXOJCR-327: MultiIndex is set to IndexInfos on the end of constructor and indexNames saved
to local variable before creating PersistedIndexes
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexInfos.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexInfos.java 2009-12-29
12:16:11 UTC (rev 1230)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexInfos.java 2009-12-29
12:18:42 UTC (rev 1231)
@@ -20,6 +20,7 @@
import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos;
+import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.jboss.cache.Cache;
@@ -104,7 +105,6 @@
// Currently READ_ONLY is set, so new lists should be fired to multiIndex.
cache.addCacheListener(this);
}
- log.info("/!\\ created jboss cache index infos");
}
/**
@@ -201,7 +201,11 @@
// callback multiIndex to refresh lists
try
{
- getMultiIndex().refreshIndexList();
+ MultiIndex multiIndex = getMultiIndex();
+ if (multiIndex != null)
+ {
+ multiIndex.refreshIndexList();
+ }
}
catch (IOException e)
{
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2009-12-29
12:16:11 UTC (rev 1230)
+++
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2009-12-29
12:18:42 UTC (rev 1231)
@@ -241,7 +241,6 @@
this.flushTask = null;
this.indexNames = indexInfos;
this.indexNames.setDirectory(indexDir);
- this.indexNames.setMultiIndex(this);
this.indexNames.read();
// as of 1.5 deletable file is not used anymore
@@ -257,11 +256,12 @@
// initialize indexing queue
this.indexingQueue = new IndexingQueue(store);
-
+ // copy current index names
+ Set<String> currentNames = new HashSet<String>(indexNames.getNames());
+
// open persistent indexes
- for (int i = 0; i < indexNames.size(); i++)
+ for (String name:currentNames)
{
- String name = indexNames.getName(i);
// only open if it still exists
// it is possible that indexNames still contains a name for
// an index that has been deleted, but indexNames has not been
@@ -301,6 +301,7 @@
{
setReadWrite();
}
+ this.indexNames.setMultiIndex(this);
}
/**
Show replies by date