[exo-jcr-commits] exo-jcr SVN: r957 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Dec 9 04:09:10 EST 2009
Author: skabashnyuk
Date: 2009-12-09 04:09:09 -0500 (Wed, 09 Dec 2009)
New Revision: 957
Added:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoMode.java
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java
Log:
EXOJCR-291: Io mode added
Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoMode.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoMode.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoMode.java 2009-12-09 09:09:09 UTC (rev 957)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2009 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;
+
+/**
+ * @author <a href="mailto:Sergey.Kabashnyuk at exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
+ *
+ */
+public enum IndexerIoMode {
+ /**
+ * Only query
+ */
+ READ_ONLY,
+ /**
+ * query on index and write changes
+ */
+ READ_WRITE
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoMode.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java 2009-12-09 09:06:55 UTC (rev 956)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java 2009-12-09 09:09:09 UTC (rev 957)
@@ -110,22 +110,7 @@
*/
void logErrorChanges(Set<String> removed, Set<String> added) throws IOException;
- // /**
- // * Creates a new query by specifying the query object model. If the query
- // * object model is considered invalid for the implementing class, an
- // * InvalidQueryException is thrown.
- // *
- // * @param session the session of the current user creating the query
- // * object.
- // * @param itemMgr the item manager of the current user.
- // * @param qomTree query query object model tree.
- // * @return A <code>Query</code> object.
- // * @throws InvalidQueryException if the query object model tree is invalid.
- // */
- // ExecutableQuery createExecutableQuery(SessionImpl session,
- // ItemManager itemMgr,
- // QueryObjectModelTree qomTree)
- // throws InvalidQueryException;
+ void setIndexerIoMode(IndexerIoMode ioMode) throws IOException, RepositoryException;
/**
* @return the name of the query class to use.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2009-12-09 09:06:55 UTC (rev 956)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2009-12-09 09:09:09 UTC (rev 957)
@@ -52,6 +52,7 @@
import org.exoplatform.services.jcr.impl.core.query.DefaultQueryNodeFactory;
import org.exoplatform.services.jcr.impl.core.query.ErrorLog;
import org.exoplatform.services.jcr.impl.core.query.ExecutableQuery;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
import org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext;
import org.exoplatform.services.jcr.impl.core.query.SearchIndexConfigurationHelper;
@@ -415,6 +416,11 @@
private final ConfigurationManager cfm;
/**
+ * Indexer io mode
+ */
+ private IndexerIoMode ioMode;
+
+ /**
* Working constructor.
*
* @throws RepositoryConfigurationException
@@ -2639,4 +2645,13 @@
return new LuceneQueryHits(reader, searcher, query);
}
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setIndexerIoMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
+ */
+ public void setIndexerIoMode(IndexerIoMode ioMode) throws IOException, RepositoryException
+ {
+ this.ioMode = ioMode;
+
+ }
+
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java 2009-12-09 09:06:55 UTC (rev 956)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java 2009-12-09 09:09:09 UTC (rev 957)
@@ -22,6 +22,7 @@
import org.exoplatform.services.jcr.impl.core.SessionImpl;
import org.exoplatform.services.jcr.impl.core.query.AbstractQueryHandler;
import org.exoplatform.services.jcr.impl.core.query.ExecutableQuery;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext;
import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits;
@@ -38,6 +39,8 @@
public class SlowQueryHandler extends AbstractQueryHandler
{
+ private IndexerIoMode ioMode;
+
protected void doInit() throws IOException, RepositoryException
{
// sleep for 10 seconds then try to read from the item state manager
@@ -93,4 +96,13 @@
return null;
}
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setIndexerIoMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
+ */
+ public void setIndexerIoMode(IndexerIoMode ioMode) throws IOException, RepositoryException
+ {
+ this.ioMode = ioMode;
+
+ }
+
}
More information about the exo-jcr-commits
mailing list