[exo-jcr-commits] exo-jcr SVN: r4215 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Apr 7 03:16:39 EDT 2011
Author: nzamosenchuk
Date: 2011-04-07 03:16:39 -0400 (Thu, 07 Apr 2011)
New Revision: 4215
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
Log:
EXOJCR-1275 : Fix closing issue in MultiIndex when node is in ReadOnly mode.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-04-06 13:56:58 UTC (rev 4214)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-04-07 07:16:39 UTC (rev 4215)
@@ -467,7 +467,7 @@
.info("Index can'b be retrieved from coordinator now, because it is offline. Possibly coordinator node performs reindexing now. Switching to local re-indexing.");
}
}
-
+
if (!indexCreated)
{
if (handler.getIndexRecoveryMode().equals(SearchIndex.INDEX_RECOVERY_MODE_FROM_COORDINATOR))
@@ -1289,60 +1289,60 @@
*/
void close()
{
- if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE))
- {
- // stop index merger
- // when calling this method we must not lock this MultiIndex, otherwise
- // a deadlock might occur
- merger.dispose();
+ // stop index merger
+ // when calling this method we must not lock this MultiIndex, otherwise
+ // a deadlock might occur
+ merger.dispose();
- synchronized (this)
+ synchronized (this)
+ {
+ // stop timer
+ if (flushTask != null)
{
- // stop timer
- if (flushTask != null)
- {
- flushTask.cancel();
- }
+ flushTask.cancel();
+ }
- // commit / close indexes
+ // commit / close indexes
+ try
+ {
+ releaseMultiReader();
+ }
+ catch (IOException e)
+ {
+ log.error("Exception while closing search index.", e);
+ }
+ if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE))
+ {
try
{
- releaseMultiReader();
- }
- catch (IOException e)
- {
- log.error("Exception while closing search index.", e);
- }
- try
- {
flush();
}
catch (IOException e)
{
log.error("Exception while closing search index.", e);
}
- volatileIndex.close();
- for (int i = 0; i < indexes.size(); i++)
- {
- ((PersistentIndex)indexes.get(i)).close();
- }
+ }
+ volatileIndex.close();
+ for (int i = 0; i < indexes.size(); i++)
+ {
+ ((PersistentIndex)indexes.get(i)).close();
+ }
- // close indexing queue
- indexingQueue.close();
+ // close indexing queue
+ indexingQueue.close();
- // finally close directory
- try
- {
- indexDir.close();
- }
- catch (IOException e)
- {
- log.error("Exception while closing directory.", e);
- }
+ // finally close directory
+ try
+ {
+ indexDir.close();
}
+ catch (IOException e)
+ {
+ log.error("Exception while closing directory.", e);
+ }
+ this.stopped = true;
}
- this.stopped = true;
}
/**
More information about the exo-jcr-commits
mailing list