Author: tolusha
Date: 2011-02-18 04:33:14 -0500 (Fri, 18 Feb 2011)
New Revision: 3988
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecovery.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieve.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieveImpl.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
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/SearchIndex.java
Log:
EXOJCR-1193: Index retrieval from coordinator node
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecovery.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecovery.java
(rev 0)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecovery.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.core.query;
+
+import java.io.InputStream;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 16.02.2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy
Bazko</a>
+ * @version $Id: IndexRecovery.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public interface IndexRecovery
+{
+ /**
+ * Get list of relative paths of all files from index directory.
+ *
+ * @return List
+ * @throws RepositoryException
+ * if any exception occurred
+ */
+ public List<String> getIndexList() throws RepositoryException;
+
+ /**
+ * Get input stream of index file.
+ * @param filePath
+ * String, relative file path
+ * @return InputStream
+ * @throws RepositoryException
+ * if any exception occurred
+ */
+ public InputStream getIndexFile(String filePath) throws RepositoryException;
+}
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
(rev 0)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.core.query;
+
+import org.exoplatform.commons.utils.PrivilegedFileHelper;
+import org.exoplatform.services.jcr.impl.util.io.DirectoryHelper;
+import org.exoplatform.services.rpc.RPCException;
+import org.exoplatform.services.rpc.RPCService;
+import org.exoplatform.services.rpc.RemoteCommand;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 16.02.2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy
Bazko</a>
+ * @version $Id: IndexRetrievalImpl.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class IndexRecoveryImpl implements IndexRecovery
+{
+
+ /**
+ * Buffer size.
+ */
+ public static final int BUFFER_SIZE = 1024 * 1024;
+
+ /**
+ * The service for executing commands on all nodes of cluster.
+ */
+ protected final RPCService rpcService;
+
+ /**
+ * Remote command responsible for getting the list of relative paths of all files from
index directory.
+ */
+ private RemoteCommand getIndexList;
+
+ /**
+ * Remote command responsible for getting data of target file.
+ */
+ private RemoteCommand getIndexFile;
+
+ /**
+ * Constructor IndexRetrieveImpl.
+ */
+ public IndexRecoveryImpl(RPCService rpcService, final String wsId, final boolean
isSystem, final File indexDirectory)
+ {
+ this.rpcService = rpcService;
+
+ getIndexList = rpcService.registerCommand(new RemoteCommand()
+ {
+ public String getId()
+ {
+ return
"org.exoplatform.services.jcr.impl.core.query.IndexRetrieveImpl-getIndexList-" +
wsId + "-"
+ + isSystem;
+ }
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ int indexDirLen =
PrivilegedFileHelper.getAbsolutePath(indexDirectory).length();
+
+ ArrayList<String> result = new ArrayList<String>();
+ for (File file : DirectoryHelper.listFiles(indexDirectory))
+ {
+ if (!file.isDirectory())
+ {
+
result.add(PrivilegedFileHelper.getAbsolutePath(file).substring(indexDirLen));
+ }
+ }
+
+ return result;
+ }
+ });
+
+ getIndexFile = rpcService.registerCommand(new RemoteCommand()
+ {
+ public String getId()
+ {
+ return
"org.exoplatform.services.jcr.impl.core.query.IndexRetrieveImpl-getIndexFile-" +
wsId + "-"
+ + isSystem;
+ }
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ String filePath = (String)args[0];
+ int offset = (Integer)args[1];
+
+ RandomAccessFile file = new RandomAccessFile(new File(indexDirectory,
filePath), "r");
+ file.seek(offset);
+
+ byte[] buffer = new byte[BUFFER_SIZE];
+ int len = file.read(buffer);
+
+ if (len == -1)
+ {
+ return null;
+ }
+ else
+ {
+ byte[] data = new byte[len];
+ System.arraycopy(buffer, 0, data, 0, len);
+
+ return data;
+ }
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<String> getIndexList() throws RepositoryException
+ {
+ try
+ {
+ return (List<String>)rpcService.executeCommandOnCoordinator(getIndexList,
true);
+ }
+ catch (SecurityException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (RPCException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public InputStream getIndexFile(String filePath) throws RepositoryException
+ {
+ try
+ {
+ return new RemoteInputStream(filePath);
+ }
+ catch (SecurityException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (RPCException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+
+ /**
+ * Allows to read data from remote machine.
+ */
+ class RemoteInputStream extends InputStream
+ {
+ private final String filePath;
+
+ private int fileOffset = 0;
+
+ private int bufferOffset = 0;
+
+ private byte[] buffer;
+
+ RemoteInputStream(String filePath) throws SecurityException, RPCException
+ {
+ this.filePath = filePath;
+ readNext();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int read() throws IOException
+ {
+ throw new UnsupportedOperationException(
+ "RemoteStream.read(byte b[], int off, int len) method is not
supported");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int available() throws IOException
+ {
+ return buffer == null ? 0 : buffer.length - bufferOffset;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int read(byte b[]) throws IOException
+ {
+ if (buffer == null)
+ {
+ return -1;
+ }
+ else if (available() == 0)
+ {
+ try
+ {
+ readNext();
+
+ if (buffer == null)
+ {
+ return -1;
+ }
+ }
+ catch (SecurityException e)
+ {
+ throw new IOException(e);
+ }
+ catch (RPCException e)
+ {
+ throw new IOException(e);
+ }
+ }
+
+ int len = Math.min(b.length, available());
+ System.arraycopy(buffer, bufferOffset, b, 0, len);
+ bufferOffset += len;
+
+ return len;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int read(byte b[], int off, int len) throws IOException
+ {
+ throw new UnsupportedOperationException(
+ "RemoteStream.read(byte b[], int off, int len) method is not
supported");
+ }
+
+ private void readNext() throws SecurityException, RPCException
+ {
+ this.buffer = (byte[])rpcService.executeCommandOnCoordinator(getIndexFile, true,
filePath, fileOffset);
+ if (buffer != null)
+ {
+ this.fileOffset += this.buffer.length;
+ this.bufferOffset = 0;
+ }
+ }
+ }
+}
Deleted:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieve.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieve.java 2011-02-18
08:30:00 UTC (rev 3987)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieve.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2003-2010 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.services.jcr.impl.core.query;
-
-import java.io.InputStream;
-import java.util.List;
-
-import javax.jcr.RepositoryException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * Date: 16.02.2011
- *
- * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy
Bazko</a>
- * @version $Id: IndexRetrieve.java 34360 2010-11-11 11:11:11Z tolusha $
- */
-public interface IndexRetrieve
-{
- /**
- * Get list of relative paths of all files from index directory.
- *
- * @return List
- * @throws RepositoryException
- * if any exception occurred
- */
- public List<String> getIndexList() throws RepositoryException;
-
- /**
- * Get input stream of index file.
- * @param filePath
- * String, relative file path
- * @return InputStream
- * @throws RepositoryException
- * if any exception occurred
- */
- public InputStream getIndexFile(String filePath) throws RepositoryException;
-}
Deleted:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieveImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieveImpl.java 2011-02-18
08:30:00 UTC (rev 3987)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRetrieveImpl.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -1,276 +0,0 @@
-/*
- * Copyright (C) 2003-2010 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.services.jcr.impl.core.query;
-
-import org.exoplatform.commons.utils.PrivilegedFileHelper;
-import org.exoplatform.services.jcr.impl.util.io.DirectoryHelper;
-import org.exoplatform.services.rpc.RPCException;
-import org.exoplatform.services.rpc.RPCService;
-import org.exoplatform.services.rpc.RemoteCommand;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.RandomAccessFile;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.RepositoryException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * Date: 16.02.2011
- *
- * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy
Bazko</a>
- * @version $Id: IndexRetrieveImpl.java 34360 2010-11-11 11:11:11Z tolusha $
- */
-public class IndexRetrieveImpl implements IndexRetrieve
-{
-
- /**
- * Buffer size.
- */
- public static final int BUFFER_SIZE = 1024 * 1024;
-
- /**
- * The service for executing commands on all nodes of cluster.
- */
- protected final RPCService rpcService;
-
- /**
- * Remote command responsible for getting the list of relative paths of all files from
index directory.
- */
- private RemoteCommand getIndexList;
-
- /**
- * Remote command responsible for getting data of target file.
- */
- private RemoteCommand getIndexFile;
-
- /**
- * Constructor IndexRetrieveImpl.
- */
- public IndexRetrieveImpl(RPCService rpcService, final String wsId, final boolean
isSystem, final File indexDirectory)
- {
- this.rpcService = rpcService;
-
- getIndexList = rpcService.registerCommand(new RemoteCommand()
- {
- public String getId()
- {
- return
"org.exoplatform.services.jcr.impl.core.query.IndexRetrieveImpl-getIndexList-" +
wsId + "-"
- + isSystem;
- }
-
- public Serializable execute(Serializable[] args) throws Throwable
- {
- int indexDirLen =
PrivilegedFileHelper.getAbsolutePath(indexDirectory).length();
-
- StringBuilder result = new StringBuilder();
- for (File file : DirectoryHelper.listFiles(indexDirectory))
- {
- if (!file.isDirectory())
- {
-
result.append(PrivilegedFileHelper.getAbsolutePath(file).substring(indexDirLen)).append('\n');
- }
- }
-
- return result.toString();
- }
- });
-
- getIndexFile = rpcService.registerCommand(new RemoteCommand()
- {
- public String getId()
- {
- return
"org.exoplatform.services.jcr.impl.core.query.IndexRetrieveImpl-getIndexFile-" +
wsId + "-"
- + isSystem;
- }
-
- public Serializable execute(Serializable[] args) throws Throwable
- {
- String filePath = (String)args[0];
- int offset = (Integer)args[1];
-
- RandomAccessFile file = new RandomAccessFile(new File(indexDirectory,
filePath), "r");
- file.seek(offset);
-
- byte[] buffer = new byte[BUFFER_SIZE];
- int len = file.read(buffer);
-
- if (len == -1)
- {
- return null;
- }
- else
- {
- byte[] data = new byte[len];
- System.arraycopy(buffer, 0, data, 0, len);
-
- return data;
- }
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- public List<String> getIndexList() throws RepositoryException
- {
- try
- {
- List<String> result = new ArrayList<String>();
-
- String data = (String)rpcService.executeCommandOnCoordinator(getIndexList,
true);
- String[] files = data.split("\n");
-
- for (String file : files)
- {
- result.add(file);
- }
-
- return result;
- }
- catch (SecurityException e)
- {
- throw new RepositoryException(e);
- }
- catch (RPCException e)
- {
- throw new RepositoryException(e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public InputStream getIndexFile(String filePath) throws RepositoryException
- {
- try
- {
- return new RemoteInputStream(filePath);
- }
- catch (SecurityException e)
- {
- throw new RepositoryException(e);
- }
- catch (RPCException e)
- {
- throw new RepositoryException(e);
- }
- }
-
- /**
- * Allows to read data from remote machine.
- */
- class RemoteInputStream extends InputStream
- {
- private final String filePath;
-
- private int fileOffset = 0;
-
- private int bufferOffset = 0;
-
- private byte[] buffer;
-
- RemoteInputStream(String filePath) throws SecurityException, RPCException
- {
- this.filePath = filePath;
- readNext();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int read() throws IOException
- {
- throw new UnsupportedOperationException(
- "RemoteStream.read(byte b[], int off, int len) method is not
supported");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int available() throws IOException
- {
- return buffer == null ? 0 : buffer.length - bufferOffset;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int read(byte b[]) throws IOException
- {
- if (buffer == null)
- {
- return -1;
- }
- else if (available() == 0)
- {
- try
- {
- readNext();
-
- if (buffer == null)
- {
- return -1;
- }
- }
- catch (SecurityException e)
- {
- throw new IOException(e);
- }
- catch (RPCException e)
- {
- throw new IOException(e);
- }
- }
-
- int len = Math.min(b.length, available());
- System.arraycopy(buffer, bufferOffset, b, 0, len);
- bufferOffset += len;
-
- return len;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int read(byte b[], int off, int len) throws IOException
- {
- throw new UnsupportedOperationException(
- "RemoteStream.read(byte b[], int off, int len) method is not
supported");
- }
-
- private void readNext() throws SecurityException, RPCException
- {
- this.buffer = (byte[])rpcService.executeCommandOnCoordinator(getIndexFile, true,
filePath, fileOffset);
- if (buffer != null)
- {
- this.fileOffset += this.buffer.length;
- this.bufferOffset = 0;
- }
- }
- }
-}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java 2011-02-18
08:30:00 UTC (rev 3987)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -81,7 +81,7 @@
/**
* The class responsible for index retrieving from other place.
*/
- private final IndexRetrieve indexRetrieve;
+ private final IndexRecovery indexRecovery;
/**
* Creates a new context instance.
@@ -105,15 +105,15 @@
* @param excludedNodeId
* id of the node that should be excluded from indexing. Any
* descendant of that node is also excluded from indexing.
- * @param indexRetrieve
+ * @param indexRecovery
* the index retriever from other place
*/
public QueryHandlerContext(WorkspaceContainerFacade container, ItemDataConsumer
stateMgr, IndexingTree indexingTree,
NodeTypeDataManager nodeTypeDataManager, NamespaceRegistryImpl nsRegistry,
QueryHandler parentHandler,
String indexDirectory, DocumentReaderService extractor, boolean
createInitialIndex,
- LuceneVirtualTableResolver virtualTableResolver, IndexRetrieve indexRetrieve)
+ LuceneVirtualTableResolver virtualTableResolver, IndexRecovery indexRecovery)
{
- this.indexRetrieve = indexRetrieve;
+ this.indexRecovery = indexRecovery;
this.container = container;
this.stateMgr = stateMgr;
this.indexingTree = indexingTree;
@@ -232,9 +232,9 @@
return indexDirectory;
}
- public IndexRetrieve getIndexRetrieve()
+ public IndexRecovery getIndexRecovery()
{
- return indexRetrieve;
+ return indexRecovery;
}
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-02-18
08:30:00 UTC (rev 3987)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -693,14 +693,14 @@
throw new RepositoryConfigurationException(e);
}
- IndexRetrieve indexRetrieve =
- rpcService == null ? null : new IndexRetrieveImpl(rpcService, getWsId(),
parentHandler == null,
+ IndexRecovery indexRecovery =
+ rpcService == null ? null : new IndexRecoveryImpl(rpcService, getWsId(),
parentHandler == null,
getIndexDirectory());
QueryHandlerContext context =
new QueryHandlerContext(container, itemMgr, indexingTree, nodeTypeDataManager,
nsReg, parentHandler,
PrivilegedFileHelper.getAbsolutePath(getIndexDirectory()), extractor, true,
virtualTableResolver,
- indexRetrieve);
+ indexRecovery);
return context;
}
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-02-18
08:30:00 UTC (rev 3987)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -438,10 +438,10 @@
try
{
if
(handler.getIndexRecoveryMode().equals(SearchIndex.INDEX_RECOVERY_MODE_FROM_COORDINATOR)
- && handler.getContext().getIndexRetrieve() != null)
+ && handler.getContext().getIndexRecovery() != null)
{
log.info("Retrieving index from coordinator...");
- retreiveIndexFromCoordinator();
+ recoveryIndexFromCoordinator();
indexNames.read();
refreshIndexList();
@@ -3347,7 +3347,7 @@
* @throws RepositoryException.
* @throws FileNotFoundException.
*/
- private void retreiveIndexFromCoordinator() throws FileNotFoundException,
RepositoryException, IOException,
+ private void recoveryIndexFromCoordinator() throws FileNotFoundException,
RepositoryException, IOException,
SuspendException
{
List<Suspendable> suspendableComponents =
@@ -3366,7 +3366,7 @@
}
File indexDirectory = new File(handler.getContext().getIndexDirectory());
- for (String filePath : handler.getContext().getIndexRetrieve().getIndexList())
+ for (String filePath : handler.getContext().getIndexRecovery().getIndexList())
{
File indexFile = new File(indexDirectory, filePath);
if (!PrivilegedFileHelper.exists(indexFile.getParentFile()))
@@ -3375,7 +3375,7 @@
}
// transfer file
- InputStream in =
handler.getContext().getIndexRetrieve().getIndexFile(filePath);
+ InputStream in =
handler.getContext().getIndexRecovery().getIndexFile(filePath);
OutputStream out = PrivilegedFileHelper.fileOutputStream(indexFile);
try
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-02-18
08:30:00 UTC (rev 3987)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-02-18
09:33:14 UTC (rev 3988)
@@ -2932,7 +2932,7 @@
if (mode == IndexerIoMode.READ_WRITE)
{
// reprocess any notfinished notifies;
- log.info("Proceessing error log ...");
+ log.info("Processing error log ...");
recoverErrorLog(errorLog);
}
}