From do-not-reply at jboss.org Fri Feb 18 04:33:14 2011
Content-Type: multipart/mixed; boundary="===============8321678861164921763=="
MIME-Version: 1.0
From: do-not-reply at jboss.org
To: exo-jcr-commits at lists.jboss.org
Subject: [exo-jcr-commits] exo-jcr SVN: r3988 - in
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query:
lucene and 1 other directory.
Date: Fri, 18 Feb 2011 04:33:14 -0500
Message-ID: <201102180933.p1I9XEfJ025566@svn01.web.mwc.hst.phx2.redhat.com>
--===============8321678861164921763==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
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/servi=
ces/jcr/impl/core/query/IndexRecovery.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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.
+ */
+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 Anatoliy=
Bazko
+ * @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 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 RepositoryExcep=
tion;
+}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi=
ces/jcr/impl/core/query/IndexRecoveryImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 39=
88)
@@ -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.
+ */
+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 Anatoliy=
Bazko
+ * @version $Id: IndexRetrievalImpl.java 34360 2010-11-11 11:11:11Z tolush=
a $
+ */
+public class IndexRecoveryImpl implements IndexRecovery
+{
+
+ /**
+ * Buffer size.
+ */
+ public static final int BUFFER_SIZE =3D 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, fina=
l boolean isSystem, final File indexDirectory)
+ {
+ this.rpcService =3D rpcService;
+
+ getIndexList =3D rpcService.registerCommand(new RemoteCommand()
+ {
+ public String getId()
+ {
+ return "org.exoplatform.services.jcr.impl.core.query.IndexRetr=
ieveImpl-getIndexList-" + wsId + "-"
+ + isSystem;
+ }
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ int indexDirLen =3D PrivilegedFileHelper.getAbsolutePath(index=
Directory).length();
+
+ ArrayList result =3D new ArrayList();
+ for (File file : DirectoryHelper.listFiles(indexDirectory))
+ {
+ if (!file.isDirectory())
+ {
+ result.add(PrivilegedFileHelper.getAbsolutePath(file).su=
bstring(indexDirLen));
+ }
+ }
+
+ return result;
+ }
+ });
+
+ getIndexFile =3D rpcService.registerCommand(new RemoteCommand()
+ {
+ public String getId()
+ {
+ return "org.exoplatform.services.jcr.impl.core.query.IndexRetr=
ieveImpl-getIndexFile-" + wsId + "-"
+ + isSystem;
+ }
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ String filePath =3D (String)args[0];
+ int offset =3D (Integer)args[1];
+
+ RandomAccessFile file =3D new RandomAccessFile(new File(indexD=
irectory, filePath), "r");
+ file.seek(offset);
+ =
+ byte[] buffer =3D new byte[BUFFER_SIZE];
+ int len =3D file.read(buffer);
+ =
+ if (len =3D=3D -1)
+ {
+ return null;
+ }
+ else
+ {
+ byte[] data =3D new byte[len];
+ System.arraycopy(buffer, 0, data, 0, len);
+
+ return data;
+ }
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List getIndexList() throws RepositoryException
+ {
+ try
+ {
+ return (List)rpcService.executeCommandOnCoordinator(getIn=
dexList, true);
+ }
+ catch (SecurityException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (RPCException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public InputStream getIndexFile(String filePath) throws RepositoryExcep=
tion
+ {
+ 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 =3D 0;
+
+ private int bufferOffset =3D 0;
+
+ private byte[] buffer;
+
+ RemoteInputStream(String filePath) throws SecurityException, RPCExce=
ption
+ {
+ this.filePath =3D filePath;
+ readNext();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int read() throws IOException
+ {
+ throw new UnsupportedOperationException(
+ "RemoteStream.read(byte b[], int off, int len) method is not s=
upported");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int available() throws IOException
+ {
+ return buffer =3D=3D null ? 0 : buffer.length - bufferOffset;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int read(byte b[]) throws IOException
+ {
+ if (buffer =3D=3D null)
+ {
+ return -1;
+ }
+ else if (available() =3D=3D 0)
+ {
+ try
+ {
+ readNext();
+
+ if (buffer =3D=3D null)
+ {
+ return -1;
+ }
+ }
+ catch (SecurityException e)
+ {
+ throw new IOException(e);
+ }
+ catch (RPCException e)
+ {
+ throw new IOException(e);
+ }
+ }
+
+ int len =3D Math.min(b.length, available());
+ System.arraycopy(buffer, bufferOffset, b, 0, len);
+ bufferOffset +=3D 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 s=
upported");
+ }
+
+ private void readNext() throws SecurityException, RPCException
+ {
+ this.buffer =3D (byte[])rpcService.executeCommandOnCoordinator(ge=
tIndexFile, true, filePath, fileOffset);
+ if (buffer !=3D null)
+ {
+ this.fileOffset +=3D this.buffer.length;
+ this.bufferOffset =3D 0;
+ }
+ }
+ }
+}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser=
vices/jcr/impl/core/query/IndexRetrieve.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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.
- */
-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 Anatoliy=
Bazko
- * @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 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 RepositoryExcep=
tion;
-}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser=
vices/jcr/impl/core/query/IndexRetrieveImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 39=
87)
+++ 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 39=
88)
@@ -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.
- */
-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 Anatoliy=
Bazko
- * @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 =3D 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, fina=
l boolean isSystem, final File indexDirectory)
- {
- this.rpcService =3D rpcService;
-
- getIndexList =3D rpcService.registerCommand(new RemoteCommand()
- {
- public String getId()
- {
- return "org.exoplatform.services.jcr.impl.core.query.IndexRetr=
ieveImpl-getIndexList-" + wsId + "-"
- + isSystem;
- }
-
- public Serializable execute(Serializable[] args) throws Throwable
- {
- int indexDirLen =3D PrivilegedFileHelper.getAbsolutePath(index=
Directory).length();
-
- StringBuilder result =3D new StringBuilder();
- for (File file : DirectoryHelper.listFiles(indexDirectory))
- {
- if (!file.isDirectory())
- {
- result.append(PrivilegedFileHelper.getAbsolutePath(file)=
.substring(indexDirLen)).append('\n');
- }
- }
-
- return result.toString();
- }
- });
-
- getIndexFile =3D rpcService.registerCommand(new RemoteCommand()
- {
- public String getId()
- {
- return "org.exoplatform.services.jcr.impl.core.query.IndexRetr=
ieveImpl-getIndexFile-" + wsId + "-"
- + isSystem;
- }
-
- public Serializable execute(Serializable[] args) throws Throwable
- {
- String filePath =3D (String)args[0];
- int offset =3D (Integer)args[1];
-
- RandomAccessFile file =3D new RandomAccessFile(new File(indexD=
irectory, filePath), "r");
- file.seek(offset);
- =
- byte[] buffer =3D new byte[BUFFER_SIZE];
- int len =3D file.read(buffer);
- =
- if (len =3D=3D -1)
- {
- return null;
- }
- else
- {
- byte[] data =3D new byte[len];
- System.arraycopy(buffer, 0, data, 0, len);
-
- return data;
- }
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- public List getIndexList() throws RepositoryException
- {
- try
- {
- List result =3D new ArrayList();
-
- String data =3D (String)rpcService.executeCommandOnCoordinator(ge=
tIndexList, true);
- String[] files =3D 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 RepositoryExcep=
tion
- {
- 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 =3D 0;
-
- private int bufferOffset =3D 0;
-
- private byte[] buffer;
-
- RemoteInputStream(String filePath) throws SecurityException, RPCExce=
ption
- {
- this.filePath =3D filePath;
- readNext();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int read() throws IOException
- {
- throw new UnsupportedOperationException(
- "RemoteStream.read(byte b[], int off, int len) method is not s=
upported");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int available() throws IOException
- {
- return buffer =3D=3D null ? 0 : buffer.length - bufferOffset;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int read(byte b[]) throws IOException
- {
- if (buffer =3D=3D null)
- {
- return -1;
- }
- else if (available() =3D=3D 0)
- {
- try
- {
- readNext();
-
- if (buffer =3D=3D null)
- {
- return -1;
- }
- }
- catch (SecurityException e)
- {
- throw new IOException(e);
- }
- catch (RPCException e)
- {
- throw new IOException(e);
- }
- }
-
- int len =3D Math.min(b.length, available());
- System.arraycopy(buffer, bufferOffset, b, 0, len);
- bufferOffset +=3D 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 s=
upported");
- }
-
- private void readNext() throws SecurityException, RPCException
- {
- this.buffer =3D (byte[])rpcService.executeCommandOnCoordinator(ge=
tIndexFile, true, filePath, fileOffset);
- if (buffer !=3D null)
- {
- this.fileOffset +=3D this.buffer.length;
- this.bufferOffset =3D 0;
- }
- }
- }
-}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se=
rvices/jcr/impl/core/query/QueryHandlerContext.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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, ItemData=
Consumer stateMgr, IndexingTree indexingTree,
NodeTypeDataManager nodeTypeDataManager, NamespaceRegistryImpl nsReg=
istry, QueryHandler parentHandler,
String indexDirectory, DocumentReaderService extractor, boolean crea=
teInitialIndex,
- LuceneVirtualTableResolver virtualTableResolver, IndexRetrieve index=
Retrieve)
+ LuceneVirtualTableResolver virtualTableResolver, IndexRecovery index=
Recovery)
{
- this.indexRetrieve =3D indexRetrieve;
+ this.indexRecovery =3D indexRecovery;
this.container =3D container;
this.stateMgr =3D stateMgr;
this.indexingTree =3D 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/se=
rvices/jcr/impl/core/query/SearchManager.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 =3D
- rpcService =3D=3D null ? null : new IndexRetrieveImpl(rpcService,=
getWsId(), parentHandler =3D=3D null,
+ IndexRecovery indexRecovery =3D
+ rpcService =3D=3D null ? null : new IndexRecoveryImpl(rpcService,=
getWsId(), parentHandler =3D=3D null,
getIndexDirectory());
=
QueryHandlerContext context =3D
new QueryHandlerContext(container, itemMgr, indexingTree, nodeTyp=
eDataManager, nsReg, parentHandler,
PrivilegedFileHelper.getAbsolutePath(getIndexDirectory()), ext=
ractor, true, virtualTableResolver,
- indexRetrieve);
+ indexRecovery);
=
return context;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se=
rvices/jcr/impl/core/query/lucene/MultiIndex.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 39=
87)
+++ 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 39=
88)
@@ -438,10 +438,10 @@
try
{
if (handler.getIndexRecoveryMode().equals(SearchIndex.INDEX_RE=
COVERY_MODE_FROM_COORDINATOR)
- && handler.getContext().getIndexRetrieve() !=3D null)
+ && handler.getContext().getIndexRecovery() !=3D null)
{
log.info("Retrieving index from coordinator...");
- retreiveIndexFromCoordinator();
+ recoveryIndexFromCoordinator();
=
indexNames.read();
refreshIndexList();
@@ -3347,7 +3347,7 @@
* @throws RepositoryException. =
* @throws FileNotFoundException. =
*/
- private void retreiveIndexFromCoordinator() throws FileNotFoundExceptio=
n, RepositoryException, IOException,
+ private void recoveryIndexFromCoordinator() throws FileNotFoundExceptio=
n, RepositoryException, IOException,
SuspendException
{
List suspendableComponents =3D
@@ -3366,7 +3366,7 @@
}
=
File indexDirectory =3D new File(handler.getContext().getIndexDir=
ectory());
- for (String filePath : handler.getContext().getIndexRetrieve().ge=
tIndexList())
+ for (String filePath : handler.getContext().getIndexRecovery().ge=
tIndexList())
{
File indexFile =3D new File(indexDirectory, filePath);
if (!PrivilegedFileHelper.exists(indexFile.getParentFile()))
@@ -3375,7 +3375,7 @@
}
=
// transfer file =
- InputStream in =3D handler.getContext().getIndexRetrieve().get=
IndexFile(filePath);
+ InputStream in =3D handler.getContext().getIndexRecovery().get=
IndexFile(filePath);
OutputStream out =3D PrivilegedFileHelper.fileOutputStream(ind=
exFile);
try
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se=
rvices/jcr/impl/core/query/lucene/SearchIndex.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 3=
987)
+++ 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 3=
988)
@@ -2932,7 +2932,7 @@
if (mode =3D=3D IndexerIoMode.READ_WRITE)
{
// reprocess any notfinished notifies;
- log.info("Proceessing error log ...");
+ log.info("Processing error log ...");
recoverErrorLog(errorLog);
}
}
--===============8321678861164921763==--