exo-jcr SVN: r4197 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-03-31 10:18:33 -0400 (Thu, 31 Mar 2011)
New Revision: 4197
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
Log:
EXOJCR-577: Fixing
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2011-03-31 14:14:00 UTC (rev 4196)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2011-03-31 14:18:33 UTC (rev 4197)
@@ -332,6 +332,10 @@
// update numResults
numResults = result.getSize();
}
+ catch (IndexOfflineIOException e)
+ {
+ throw new IndexOfflineRepositoryException(e.getMessage(), e);
+ }
catch (IOException e)
{
log.error("Exception while executing query: ", e);
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-03-31 14:14:00 UTC (rev 4196)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-03-31 14:18:33 UTC (rev 4197)
@@ -663,7 +663,7 @@
catch (IOException e)
{
log
- .error("Error while reindexing the workspace. Please fix the problem, delete index and restart server.");
+ .error("Error while reindexing the workspace. Please fix the problem, delete index and restart server.", e);
}
}
}, "Reindexing-" + context.getContainer().getWorkspaceName()).start();
14 years, 11 months
exo-jcr SVN: r4196 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-03-31 10:14:00 -0400 (Thu, 31 Mar 2011)
New Revision: 4196
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
Log:
EXOJCR-577: Handle state when reindexing the worksapce.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2011-03-31 12:14:39 UTC (rev 4195)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2011-03-31 14:14:00 UTC (rev 4196)
@@ -32,6 +32,7 @@
import org.exoplatform.services.jcr.ext.registry.RegistryEntry;
import org.exoplatform.services.jcr.ext.registry.RegistryService;
import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference;
+import org.exoplatform.services.jcr.impl.core.query.lucene.IndexOfflineRepositoryException;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.ext.groovy.GroovyClassLoaderProvider;
@@ -73,6 +74,7 @@
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.observation.Event;
+import javax.jcr.query.InvalidQueryException;
import javax.jcr.query.Query;
import javax.jcr.query.QueryResult;
import javax.ws.rs.Consumes;
@@ -117,6 +119,8 @@
/** Service name. */
private static final String SERVICE_NAME = "GroovyScript2RestLoader";
+ private static final int DELAYED_AUTOLOAD_TIMEOUT = 20000; // 20 sec
+
/** See {@link InitParams}. */
protected InitParams initParams;
@@ -274,50 +278,80 @@
try
{
// Deploy auto-load scripts and start Observation Listeners.
- String repositoryName = observationListenerConfiguration.getRepository();
+ final String repositoryName = observationListenerConfiguration.getRepository();
List<String> workspaceNames = observationListenerConfiguration.getWorkspaces();
- ManageableRepository repository = repositoryService.getRepository(repositoryName);
+ final ManageableRepository repository = repositoryService.getRepository(repositoryName);
+ // JCR it offers an asynchronous workspace reindexing (since 1.14.0-CR2). But while it
+ // is performed in background queries can't be executed. In this case autoload scripts could only
+ // be loaded after reindexing finished.
+ final Set<String> delayedWorkspacePublishing = new HashSet<String>();
+
for (String workspaceName : workspaceNames)
{
Session session = repository.getSystemSession(workspaceName);
+ try
+ {
+ autoLoadScripts(session);
+ }
+ catch (IndexOfflineRepositoryException e)
+ {
+ delayedWorkspacePublishing.add(workspaceName);
+ }
- String xpath = "//element(*, " + getNodeType() + ")[@exo:autoload='true']";
- Query query = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
-
- QueryResult result = query.execute();
- NodeIterator nodeIterator = result.getNodes();
- while (nodeIterator.hasNext())
+ session.getWorkspace().getObservationManager().addEventListener(
+ new GroovyScript2RestUpdateListener(repositoryName, workspaceName, this, session),
+ Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED, "/", true, null,
+ new String[]{getNodeType()}, false);
+ }
+ if (!delayedWorkspacePublishing.isEmpty())
+ {
+ LOG.warn("The following workspaces are being reindexed now: " + delayedWorkspacePublishing
+ + ". Groove scripts from those workspaces marked as AutoLoad will be loaded later.");
+ // lauch delayed autoLoad
+ new Thread(new Runnable()
{
- Node node = nodeIterator.nextNode();
-
- if (node.getPath().startsWith("/jcr:system"))
+ public void run()
{
- continue;
+ while (true)
+ {
+ if (delayedWorkspacePublishing.isEmpty())
+ {
+ // finish thread
+ return;
+ }
+ for (Iterator iterator = delayedWorkspacePublishing.iterator(); iterator.hasNext();)
+ {
+ String workspaceName = (String)iterator.next();
+ try
+ {
+ Session session = repository.getSystemSession(workspaceName);
+ autoLoadScripts(session);
+ // if no exception, then remove item from set
+ iterator.remove();
+ }
+ catch (IndexOfflineRepositoryException e)
+ {
+ //it's okay. Retrying;
+ }
+ catch (Exception e)
+ {
+ // skip
+ LOG.error(e);
+ }
+ }
+ try
+ {
+ Thread.sleep(DELAYED_AUTOLOAD_TIMEOUT);
+ }
+ catch (InterruptedException e)
+ {
+ // skip
+ }
+ }
}
-
- try
- {
- groovyPublisher.publishPerRequest(node.getProperty("jcr:data").getStream(), new NodeScriptKey(
- repositoryName, workspaceName, node), null);
- }
- catch (CompilationFailedException e)
- {
- LOG.error(e.getMessage(), e);
- }
- catch (ResourcePublicationException e)
- {
- LOG.error(e.getMessage(), e);
- }
- }
-
- session
- .getWorkspace()
- .getObservationManager()
- .addEventListener(new GroovyScript2RestUpdateListener(repositoryName, workspaceName, this, session),
- Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED, "/", true, null,
- new String[]{getNodeType()}, false);
+ }, "GrooveSrciptDelayedAutoLoader-" + repositoryName).start();
}
}
catch (Exception e)
@@ -334,6 +368,41 @@
binder.addResource(this, null);
}
+ private void autoLoadScripts(Session session) throws RepositoryException
+ {
+ String workspaceName = session.getWorkspace().getName();
+ String repositoryName = observationListenerConfiguration.getRepository();
+
+ String xpath = "//element(*, " + getNodeType() + ")[@exo:autoload='true']";
+ Query query = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
+
+ QueryResult result = query.execute();
+ NodeIterator nodeIterator = result.getNodes();
+ while (nodeIterator.hasNext())
+ {
+ Node node = nodeIterator.nextNode();
+
+ if (node.getPath().startsWith("/jcr:system"))
+ {
+ continue;
+ }
+
+ try
+ {
+ groovyPublisher.publishPerRequest(node.getProperty("jcr:data").getStream(), new NodeScriptKey(
+ repositoryName, workspaceName, node), null);
+ }
+ catch (CompilationFailedException e)
+ {
+ LOG.error(e.getMessage(), e);
+ }
+ catch (ResourcePublicationException e)
+ {
+ LOG.error(e.getMessage(), e);
+ }
+ }
+ }
+
/**
* @see org.picocontainer.Startable#stop()
*/
@@ -526,7 +595,8 @@
Document doc;
try
{
- doc = AccessController.doPrivileged(new PrivilegedExceptionAction<Document>() {
+ doc = AccessController.doPrivileged(new PrivilegedExceptionAction<Document>()
+ {
public Document run() throws ParserConfigurationException
{
return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
@@ -851,7 +921,9 @@
throws MalformedScriptException
{
if (name != null && name.length() > 0 && name.startsWith("/"))
+ {
name = name.substring(1);
+ }
groovyPublisher.validateResource(script, name, src, files);
}
@@ -1090,9 +1162,9 @@
{
if (null == groovyPublisher.unpublishResource(key))
{
- return Response.status(Response.Status.BAD_REQUEST)
- .entity("Can't unbind script " + path + ", not bound or has wrong mapping to the resource class ")
- .type(MediaType.TEXT_PLAIN).build();
+ return Response.status(Response.Status.BAD_REQUEST).entity(
+ "Can't unbind script " + path + ", not bound or has wrong mapping to the resource class ").type(
+ MediaType.TEXT_PLAIN).build();
}
}
return Response.status(Response.Status.NO_CONTENT).build();
@@ -1240,9 +1312,8 @@
sessionProviderService.getSessionProvider(null).getSession(workspace,
repositoryService.getRepository(repository));
Node scriptFile = (Node)ses.getItem("/" + path);
- return Response.status(Response.Status.OK)
- .entity(scriptFile.getNode("jcr:content").getProperty("jcr:data").getStream()).type("script/groovy")
- .build();
+ return Response.status(Response.Status.OK).entity(
+ scriptFile.getNode("jcr:content").getProperty("jcr:data").getStream()).type("script/groovy").build();
}
catch (PathNotFoundException e)
{
@@ -1417,9 +1488,13 @@
String str = sources.get(i);
URL url = null;
if (str.startsWith("jcr://"))
+ {
url = new URL(null, str, UnifiedNodeReference.getURLStreamHandler());
+ }
else
+ {
url = new URL(str);
+ }
src[i] = new SourceFolder(url);
}
}
@@ -1437,9 +1512,13 @@
String str = files.get(i);
URL url = null;
if (str.startsWith("jcr://"))
+ {
url = new URL(null, str, UnifiedNodeReference.getURLStreamHandler());
+ }
else
+ {
url = new URL(str);
+ }
srcFiles[i] = new SourceFile(url);
}
}
14 years, 11 months
exo-jcr SVN: r4195 - in jcr/trunk/exo.jcr.component.core/src: main/resources/conf/portal and 2 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-03-31 08:14:39 -0400 (Thu, 31 Mar 2011)
New Revision: 4195
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-1271: decrease table lock name
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java 2011-03-31 12:04:39 UTC (rev 4194)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java 2011-03-31 12:14:39 UTC (rev 4195)
@@ -116,7 +116,7 @@
// configure cache loader parameters with correct DB data-types
configureJDBCCacheLoader(config.getLockManager());
- cache = factory.createCache("Lock_" + config.getUniqueName(), config.getLockManager());
+ cache = factory.createCache(config.getUniqueName().replace("_", ""), config.getLockManager());
// Context recall is a workaround of JDBCCacheLoader starting.
context.recall();
Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml 2011-03-31 12:04:39 UTC (rev 4194)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml 2011-03-31 12:14:39 UTC (rev 4195)
@@ -75,7 +75,7 @@
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
<property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -136,7 +136,7 @@
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
<property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -197,7 +197,7 @@
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
<property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-03-31 12:04:39 UTC (rev 4194)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-03-31 12:14:39 UTC (rev 4195)
@@ -75,7 +75,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -141,7 +141,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -207,7 +207,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -296,7 +296,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -371,7 +371,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -435,7 +435,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -519,7 +519,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -592,7 +592,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -668,7 +668,7 @@
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
<property name="jgroups-configuration" value="udp-mux.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-03-31 12:04:39 UTC (rev 4194)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-03-31 12:14:39 UTC (rev 4195)
@@ -75,7 +75,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -130,7 +130,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -185,7 +185,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -262,7 +262,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -325,7 +325,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -378,7 +378,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -451,7 +451,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -512,7 +512,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -576,7 +576,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-03-31 12:04:39 UTC (rev 4194)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-03-31 12:14:39 UTC (rev 4195)
@@ -75,7 +75,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -130,7 +130,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -185,7 +185,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -262,7 +262,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -325,7 +325,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -378,7 +378,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -451,7 +451,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -512,7 +512,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
@@ -576,7 +576,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
<property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
<property name="infinispan-cl-cache.jdbc.id.column" value="id" />
14 years, 11 months
exo-jcr SVN: r4194 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query: lucene and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-03-31 08:04:39 -0400 (Thu, 31 Mar 2011)
New Revision: 4194
Modified:
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/lucene/MultiIndex.java
Log:
EXOJCR-577: Fixing RPC commands.
Modified: 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 2011-03-31 07:43:45 UTC (rev 4193)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java 2011-03-31 12:04:39 UTC (rev 4194)
@@ -308,7 +308,7 @@
{
try
{
- return (Boolean)rpcService.executeCommandOnCoordinator(changeIndexMode, true, true);
+ return (Boolean)rpcService.executeCommandOnCoordinator(checkIndexReady, true);
}
catch (SecurityException e)
{
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-03-31 07:43:45 UTC (rev 4193)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-03-31 12:04:39 UTC (rev 4194)
@@ -464,7 +464,7 @@
else
{
log
- .info("Index can'b be retrieved from coordinator now, because it is offline. Possibly coordinator node performs reindexing now.");
+ .info("Index can'b be retrieved from coordinator now, because it is offline. Possibly coordinator node performs reindexing now. Switching to local re-indexing.");
}
}
14 years, 11 months
exo-jcr SVN: r4193 - jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-03-31 03:43:45 -0400 (Thu, 31 Mar 2011)
New Revision: 4193
Modified:
jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch
Log:
JCR-1605: patch fix
Modified: jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch 2011-03-31 07:33:39 UTC (rev 4192)
+++ jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch 2011-03-31 07:43:45 UTC (rev 4193)
@@ -3,20 +3,20 @@
--- exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java (revision 4188)
+++ exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java (working copy)
@@ -32,7 +32,6 @@
- import java.io.OutputStream;
- import java.io.UnsupportedEncodingException;
- import java.net.URISyntaxException;
--import java.net.URLDecoder;
- import java.util.Set;
-
- import javax.jcr.RepositoryException;
+ import java.io.OutputStream;
+ import java.io.UnsupportedEncodingException;
+ import java.net.URISyntaxException;
+-import java.net.URLDecoder;
+ import java.util.Set;
+
+ import javax.jcr.RepositoryException;
@@ -172,7 +171,8 @@
- xmlStreamWriter.writeStartElement("DAV:", "response");
-
- xmlStreamWriter.writeStartElement("DAV:", "href");
-- String href = URLDecoder.decode(resource.getIdentifier().toASCIIString(), "UTF-8");
-+ String href = resource.getIdentifier().toASCIIString();
-+
- if (resource.isCollection())
- {
- xmlStreamWriter.writeCharacters(href + "/");
+ xmlStreamWriter.writeStartElement("DAV:", "response");
+
+ xmlStreamWriter.writeStartElement("DAV:", "href");
+- String href = URLDecoder.decode(resource.getIdentifier().toASCIIString(), "UTF-8");
++ String href = resource.getIdentifier().toASCIIString();
++
+ if (resource.isCollection())
+ {
+ xmlStreamWriter.writeCharacters(href + "/");
14 years, 11 months
exo-jcr SVN: r4192 - in jcr/branches/1.12.x/patch/1.12.9-GA: JCR-1605 and 1 other directory.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-03-31 03:33:39 -0400 (Thu, 31 Mar 2011)
New Revision: 4192
Added:
jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/
jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch
Log:
JCR-1605: patch proposed
Added: jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1605/JCR-1605.patch 2011-03-31 07:33:39 UTC (rev 4192)
@@ -0,0 +1,22 @@
+Index: exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java
+===================================================================
+--- exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java (revision 4188)
++++ exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java (working copy)
+@@ -32,7 +32,6 @@
+ import java.io.OutputStream;
+ import java.io.UnsupportedEncodingException;
+ import java.net.URISyntaxException;
+-import java.net.URLDecoder;
+ import java.util.Set;
+
+ import javax.jcr.RepositoryException;
+@@ -172,7 +171,8 @@
+ xmlStreamWriter.writeStartElement("DAV:", "response");
+
+ xmlStreamWriter.writeStartElement("DAV:", "href");
+- String href = URLDecoder.decode(resource.getIdentifier().toASCIIString(), "UTF-8");
++ String href = resource.getIdentifier().toASCIIString();
++
+ if (resource.isCollection())
+ {
+ xmlStreamWriter.writeCharacters(href + "/");
14 years, 11 months
exo-jcr SVN: r4191 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-03-31 02:23:38 -0400 (Thu, 31 Mar 2011)
New Revision: 4191
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineIOException.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineRepositoryException.java
Log:
EXOJCR-577: Initial implementation of asynchronous reindexing.
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineIOException.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineIOException.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineIOException.java 2011-03-31 06:23:38 UTC (rev 4191)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.core.query.lucene;
+
+import java.io.IOException;
+
+/**
+ * Used to notify IndexSearcher that index is currently offline and queries can't be executed.
+ *
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: IndexOfflineIOException.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class IndexOfflineIOException extends IOException
+{
+ /**
+ * @param string description
+ */
+ public IndexOfflineIOException(String string)
+ {
+ super(string);
+ }
+
+}
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineIOException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineRepositoryException.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineRepositoryException.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineRepositoryException.java 2011-03-31 06:23:38 UTC (rev 4191)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.core.query.lucene;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: IndexOfflineRepositoryException.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class IndexOfflineRepositoryException extends RepositoryException
+{
+
+ /**
+ * Constructs a new instance of this class with the specified detail
+ * message and root cause.
+ *
+ * @param message the detail message. The detail message is saved for
+ * later retrieval by the {@link #getMessage()} method.
+ * @param rootCause root failure cause
+ */
+ public IndexOfflineRepositoryException(String message, Throwable rootCause)
+ {
+ super(message);
+ this.rootCause = rootCause;
+ }
+
+}
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexOfflineRepositoryException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 11 months
exo-jcr SVN: r4190 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/query and 2 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-03-30 10:08:40 -0400 (Wed, 30 Mar 2011)
New Revision: 4190
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
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
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.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/OfflinePersistentIndex.java
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/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java
Log:
EXOJCR-577: Initial implementation of asynchronous reindexing.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2011-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -114,4 +114,7 @@
public static final String PARAM_RDBMS_REINDEXING = "rdbms-reindexing";
public static final String PARAM_INDEX_RECOVERY_MODE = "index-recovery-mode";
+
+ public static final String PARAM_ASYNC_REINDEXING = "async-reindexing";
+
}
Modified: 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 2011-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecovery.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -66,4 +66,12 @@
* if any exception occurred
*/
public InputStream getIndexFile(String filePath) throws RepositoryException;
+
+ /**
+ * Check if index is ready and can be retrieved.
+ *
+ * @return
+ * @throws RepositoryException if error occurs.
+ */
+ public boolean checkIndexReady() throws RepositoryException;
}
Modified: 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 2011-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -80,6 +80,11 @@
private RemoteCommand changeIndexMode;
/**
+ * Remote command to check if index can be retrieved.
+ */
+ private RemoteCommand checkIndexReady;
+
+ /**
* Remote command to check if node responsible for set index online leave the cluster.
*/
private RemoteCommand requestForResponsibleToSetIndexOnline;
@@ -201,6 +206,20 @@
}
});
+ checkIndexReady = rpcService.registerCommand(new RemoteCommand()
+ {
+ public String getId()
+ {
+ return "org.exoplatform.services.jcr.impl.core.query.IndexRecoveryImpl-checkIndexIsReady-" + commandSuffix;
+ }
+
+ public Serializable execute(Serializable[] args) throws Throwable
+ {
+ // if index is currently online, then it can be retrieved
+ return new Boolean(searchManager.isOnline());
+ }
+ });
+
rpcService.registerTopologyChangeListener(this);
}
@@ -281,6 +300,25 @@
throw new RepositoryException(e);
}
}
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.IndexRecovery#checkIndexReady()
+ */
+ public boolean checkIndexReady() throws RepositoryException
+ {
+ try
+ {
+ return (Boolean)rpcService.executeCommandOnCoordinator(changeIndexMode, true, true);
+ }
+ catch (SecurityException e)
+ {
+ throw new RepositoryException(e);
+ }
+ catch (RPCException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
/**
* Allows to read data from remote machine.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java 2011-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -87,7 +87,7 @@
* @return a {@link ChangesHolder} instance that contains all the changes
*/
ChangesHolder getChanges(Iterator<String> remove, Iterator<NodeData> add);
-
+
/**
* Applies the given changes to the indes in an atomic operation
* @param changes the changes to apply
@@ -95,7 +95,7 @@
* @throws IOException if an error occurs while updating the index.
*/
void apply(ChangesHolder changes) throws RepositoryException, IOException;
-
+
/**
* Closes this <code>QueryHandler</code> and frees resources attached
* to this handler.
@@ -179,7 +179,7 @@
* @param indexInfos
*/
void setIndexInfos(IndexInfos indexInfos);
-
+
/**
* Returns {@link IndexInfos} instance that was set into QueryHandler.
* @return
@@ -204,4 +204,12 @@
*/
void setOnline(boolean isOnline) throws IOException;
+ /**
+ * Offline mode means that new indexing data is collected but index is guaranteed to be unmodified during
+ * offline state.
+ *
+ * @return the state of index.
+ */
+ boolean isOnline();
+
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2011-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -198,5 +198,9 @@
{
searchIndex.setIndexRecoveryMode(value);
}
+ else if (QueryHandlerParams.PARAM_ASYNC_REINDEXING.equals(name))
+ {
+ searchIndex.setAsyncReindexing(Boolean.parseBoolean(value));
+ }
}
}
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-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -56,6 +56,8 @@
import org.exoplatform.services.jcr.impl.core.SessionImpl;
import org.exoplatform.services.jcr.impl.core.query.lucene.ChangesHolder;
import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames;
+import org.exoplatform.services.jcr.impl.core.query.lucene.IndexOfflineIOException;
+import org.exoplatform.services.jcr.impl.core.query.lucene.IndexOfflineRepositoryException;
import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTableResolver;
import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits;
import org.exoplatform.services.jcr.impl.core.query.lucene.ScoreNode;
@@ -922,6 +924,10 @@
result.add(sn.getNodeId());
}
}
+ catch (IndexOfflineIOException e)
+ {
+ throw new IndexOfflineRepositoryException(e.getMessage(), e);
+ }
catch (IOException e)
{
throw new RepositoryException(e.getLocalizedMessage(), e);
@@ -1041,6 +1047,11 @@
handler.setOnline(isOnline);
}
+ public boolean isOnline()
+ {
+ return handler.isOnline();
+ }
+
/**
* {@inheritDoc}
*/
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-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -441,6 +441,7 @@
void createInitialIndex(ItemDataConsumer stateMgr) throws IOException
{
// only do an initial index if there are no indexes at all
+ boolean indexCreated = false;
if (indexNames.size() == 0)
{
setOnline(false);
@@ -453,12 +454,21 @@
&& handler.getContext().getRPCService().isCoordinator() == false)
{
log.info("Retrieving index from coordinator...");
- recoveryIndexFromCoordinator();
+ indexCreated = recoveryIndexFromCoordinator();
- indexNames.read();
- refreshIndexList();
+ if (indexCreated)
+ {
+ indexNames.read();
+ refreshIndexList();
+ }
+ else
+ {
+ log
+ .info("Index can'b be retrieved from coordinator now, because it is offline. Possibly coordinator node performs reindexing now.");
+ }
}
- else
+
+ if (!indexCreated)
{
if (handler.getIndexRecoveryMode().equals(SearchIndex.INDEX_RECOVERY_MODE_FROM_COORDINATOR))
{
@@ -3312,6 +3322,20 @@
}
}
+ /**
+ * @return true if index is online. It means that there is no background indexing or index retrieval jobs
+ */
+ public boolean isOnline()
+ {
+ return online;
+ }
+
+ /**
+ * Switches index mode
+ *
+ * @param isOnline
+ * @throws IOException
+ */
public synchronized void setOnline(boolean isOnline) throws IOException
{
// if mode really changed
@@ -3337,6 +3361,10 @@
flush();
}
}
+ else if (!online)
+ {
+ throw new IOException("Index is already in OFFLINE mode.");
+ }
}
/**
@@ -3568,12 +3596,17 @@
* @throws RepositoryException.
* @throws FileNotFoundException.
*/
- private void recoveryIndexFromCoordinator() throws FileNotFoundException, RepositoryException, IOException,
+ private boolean recoveryIndexFromCoordinator() throws FileNotFoundException, RepositoryException, IOException,
SuspendException
{
try
{
IndexRecovery indexRecovery = handler.getContext().getIndexRecovery();
+ // check if index not ready
+ if (!indexRecovery.checkIndexReady())
+ {
+ return false;
+ }
indexRecovery.setIndexOffline();
File indexDirectory = new File(handler.getContext().getIndexDirectory());
@@ -3617,6 +3650,7 @@
finally
{
}
+ return true;
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/OfflinePersistentIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/OfflinePersistentIndex.java 2011-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/OfflinePersistentIndex.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -73,6 +73,7 @@
{
int count = super.removeDocument(idTerm);
processedIDs.add(idTerm.text());
+ System.out.println("RM: " + idTerm.text());
return count;
}
@@ -82,6 +83,7 @@
super.addDocuments(docs);
for (Document doc : docs)
{
+ System.out.println("add: " + doc.get(FieldNames.UUID));
processedIDs.add(doc.get(FieldNames.UUID));
}
}
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-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -183,6 +183,11 @@
*/
public static final boolean DEFAULT_RDBMS_REINDEXING = true;
+ /**
+ * The default value for {@link #asyncReindexing}.
+ */
+ public static final boolean DEFAULT_ASYNC_REINDEXING = false;
+
/**
* The default value for {@link #indexRecoveryMode}.
*/
@@ -494,6 +499,11 @@
private String indexRecoveryMode = INDEX_RECOVERY_MODE_FROM_INDEXING;
/**
+ * Defines reindexing synchronization policy. Whether or not start it asynchronously
+ */
+ private boolean asyncReindexing = DEFAULT_ASYNC_REINDEXING;
+
+ /**
* Working constructor.
*
* @throws RepositoryConfigurationException
@@ -635,39 +645,33 @@
// if RW mode, create initial index and start check
if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
{
- if (index.numDocs() == 0 && context.isCreateInitialIndex())
+ final boolean doReindexing = (index.numDocs() == 0 && context.isCreateInitialIndex());
+ final boolean doCheck = (consistencyCheckEnabled && (index.getRedoLogApplied() || forceConsistencyCheck));
+ final ItemDataConsumer itemStateManager = context.getItemStateManager();
+
+ if (isAsyncReindexing() && doReindexing)
{
- index.createInitialIndex(context.getItemStateManager());
- }
- if (consistencyCheckEnabled && (index.getRedoLogApplied() || forceConsistencyCheck))
- {
- log.info("Running consistency check...");
- try
+ log.info("Launching reindexing in asynchronous mode.");
+ new Thread(new Runnable()
{
- ConsistencyCheck check = ConsistencyCheck.run(index, context.getItemStateManager());
- if (autoRepair)
+ public void run()
{
- check.repair(true);
- }
- else
- {
- List<ConsistencyCheckError> errors = check.getErrors();
- if (errors.size() == 0)
+ try
{
- log.info("No errors detected.");
+ reindex(doReindexing, doCheck, itemStateManager);
}
- for (Iterator<ConsistencyCheckError> it = errors.iterator(); it.hasNext();)
+ catch (IOException e)
{
- ConsistencyCheckError err = it.next();
- log.info(err.toString());
+ log
+ .error("Error while reindexing the workspace. Please fix the problem, delete index and restart server.");
}
}
- }
- catch (Exception e)
- {
- log.warn("Failed to run consistency check on index: " + e);
- }
+ }, "Reindexing-" + context.getContainer().getWorkspaceName()).start();
}
+ else
+ {
+ reindex(doReindexing, doCheck, itemStateManager);
+ }
}
// initialize spell checker
spellChecker = createSpellChecker();
@@ -690,6 +694,43 @@
modeHandler.addIndexerIoModeListener(this);
}
+ private void reindex(boolean doReindexing, boolean doCheck, ItemDataConsumer itemStateManager) throws IOException
+ {
+ if (doReindexing)
+ {
+ index.createInitialIndex(itemStateManager);
+ }
+ if (doCheck)
+ {
+ log.info("Running consistency check...");
+ try
+ {
+ ConsistencyCheck check = ConsistencyCheck.run(index, itemStateManager);
+ if (autoRepair)
+ {
+ check.repair(true);
+ }
+ else
+ {
+ List<ConsistencyCheckError> errors = check.getErrors();
+ if (errors.size() == 0)
+ {
+ log.info("No errors detected.");
+ }
+ for (Iterator<ConsistencyCheckError> it = errors.iterator(); it.hasNext();)
+ {
+ ConsistencyCheckError err = it.next();
+ log.info(err.toString());
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.warn("Failed to run consistency check on index: " + e);
+ }
+ }
+ }
+
/**
* @return the errorLogfileSize
*/
@@ -1217,6 +1258,12 @@
*/
protected IndexReader getIndexReader(boolean includeSystemIndex) throws IOException
{
+ // deny query execution if index in offline mode
+ // TODO Replace with special Exception Type
+ if (!index.isOnline())
+ {
+ throw new IndexOfflineIOException("Index is offline");
+ }
QueryHandler parentHandler = getContext().getParentHandler();
CachingMultiIndexReader parentReader = null;
if (parentHandler instanceof SearchIndex && includeSystemIndex)
@@ -2731,6 +2778,14 @@
return rdbmsReindexing;
}
+ /**
+ * @return the current value for asyncReindexing
+ */
+ public boolean isAsyncReindexing()
+ {
+ return asyncReindexing;
+ }
+
/**
* @return the current value for indexRecoveryMode
*/
@@ -2804,6 +2859,17 @@
this.indexRecoveryMode = indexRecoveryMode;
}
+ /**
+ * Set a new value for asyncReindexing.
+ *
+ * @param indexRecoveryMode
+ * the new value for asyncReindexing
+ */
+ public void setAsyncReindexing(boolean asyncReindexing)
+ {
+ this.asyncReindexing = asyncReindexing;
+ }
+
// ----------------------------< internal
// >----------------------------------
@@ -2970,6 +3036,14 @@
checkOpen();
index.setOnline(isOnline);
}
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#isOnline()
+ */
+ public boolean isOnline()
+ {
+ return index.isOnline();
+ }
/**
* {@inheritDoc}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java 2011-03-29 14:53:18 UTC (rev 4189)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java 2011-03-30 14:08:40 UTC (rev 4190)
@@ -115,4 +115,12 @@
// TODO Auto-generated method stub
}
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#isOnline()
+ */
+ public boolean isOnline()
+ {
+ return true;
+ }
}
14 years, 11 months
exo-jcr SVN: r4189 - in jcr/trunk: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-03-29 10:53:18 -0400 (Tue, 29 Mar 2011)
New Revision: 4189
Modified:
jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
Log:
EXOJCR-1257 : exobackup tool was simplified command-line interface.
Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2011-03-29 12:26:31 UTC (rev 4188)
+++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2011-03-29 14:53:18 UTC (rev 4189)
@@ -268,12 +268,24 @@
String repositoryName = getRepositoryName(pathToWS);
String workspaceName = (pathToWS.split("/").length == 3 ? getWorkspaceName(pathToWS) : null);
+
+ String backupDir;
if (curArg == args.length)
{
- System.out.println(INCORRECT_PARAM + "There is no path to backup dir parameter.");
- return;
+ backupDir = null;
}
- String backupDir = args[curArg++];
+ else
+ {
+ //check is incremental job period
+ if (args[curArg].matches("[0-9]+"))
+ {
+ backupDir = null;
+ }
+ else
+ {
+ backupDir = args[curArg++];
+ }
+ }
if (curArg == args.length)
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2011-03-29 12:26:31 UTC (rev 4188)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2011-03-29 14:53:18 UTC (rev 4189)
@@ -327,11 +327,20 @@
try
{
- File backupDir = new File(bConfigBeen.getBackupDir());
- if (!PrivilegedFileHelper.exists(backupDir))
- throw new BackupDirNotFoundException("The backup folder not exists : "
- + PrivilegedFileHelper.getAbsolutePath(backupDir));
+ File backupDir;
+ if (bConfigBeen.getBackupDir() == null)
+ {
+ backupDir = backupManager.getBackupDirectory();
+ }
+ else
+ {
+ backupDir = new File(bConfigBeen.getBackupDir());
+ if (!PrivilegedFileHelper.exists(backupDir))
+ throw new BackupDirNotFoundException("The backup folder not exists : "
+ + PrivilegedFileHelper.getAbsolutePath(backupDir));
+ }
+
BackupConfig config = new BackupConfig();
config.setBackupType(bConfigBeen.getBackupType());
config.setRepository(repository);
@@ -427,12 +436,19 @@
try
{
- File backupDir = new File(bConfigBeen.getBackupDir());
- if (!PrivilegedFileHelper.exists(backupDir))
+ File backupDir;
+
+ if (bConfigBeen.getBackupDir() == null)
{
- throw new BackupDirNotFoundException("The backup folder not exists : "
- + PrivilegedFileHelper.getAbsolutePath(backupDir));
+ backupDir = backupManager.getBackupDirectory();
}
+ else
+ {
+ backupDir = new File(bConfigBeen.getBackupDir());
+ if (!PrivilegedFileHelper.exists(backupDir))
+ throw new BackupDirNotFoundException("The backup folder not exists : "
+ + PrivilegedFileHelper.getAbsolutePath(backupDir));
+ }
RepositoryBackupConfig config = new RepositoryBackupConfig();
config.setBackupType(bConfigBeen.getBackupType());
14 years, 11 months
exo-jcr SVN: r4188 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-03-29 08:26:31 -0400 (Tue, 29 Mar 2011)
New Revision: 4188
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
Log:
EXOJCR-834 : fixing offline index invoking problem (concurrent modification)
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-03-29 10:10:32 UTC (rev 4187)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-03-29 12:26:31 UTC (rev 4188)
@@ -3322,9 +3322,9 @@
{
log.info("Setting index back online");
offlineIndex.commit(true);
+ online = true;
//invoking offline index
invokeOfflineIndex();
- online = true;
}
// switching to OFFLINE
else
14 years, 11 months