[infinispan-commits] Infinispan SVN: r842 - in trunk: core/src/main/java/org/infinispan/factories and 7 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Wed Sep 23 10:10:02 EDT 2009
Author: navssurtani
Date: 2009-09-23 10:10:01 -0400 (Wed, 23 Sep 2009)
New Revision: 842
Removed:
trunk/query/src/test/java/org/infinispan/query/backend/
Modified:
trunk/core/src/main/java/org/infinispan/factories/InterceptorChainFactory.java
trunk/pom.xml
trunk/query/infinispan-query.iml
trunk/query/pom.xml
trunk/query/src/main/java/org/infinispan/query/CacheQuery.java
trunk/query/src/main/java/org/infinispan/query/QueryFactory.java
trunk/query/src/main/java/org/infinispan/query/backend/IndexSearcherCloser.java
trunk/query/src/main/java/org/infinispan/query/backend/LocalQueryInterceptor.java
trunk/query/src/main/java/org/infinispan/query/backend/QueryHelper.java
trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java
trunk/query/src/main/java/org/infinispan/query/backend/SearchableCacheConfiguration.java
trunk/query/src/main/java/org/infinispan/query/backend/TransactionalEventTransactionContext.java
trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java
trunk/query/src/main/java/org/infinispan/query/impl/CacheQueryImpl.java
trunk/query/src/main/java/org/infinispan/query/impl/EagerIterator.java
trunk/query/src/test/java/org/infinispan/query/blackbox/ClusteredCacheTest.java
trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheProfilerTest.java
trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java
trunk/query/src/test/java/org/infinispan/query/test/Person.java
Log:
[ISPN-32] Moved query module into trunk. Classes javadocced and tests run. createInterceptor() in InterceptorChainFactory is now a public method.
Modified: trunk/core/src/main/java/org/infinispan/factories/InterceptorChainFactory.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/InterceptorChainFactory.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/core/src/main/java/org/infinispan/factories/InterceptorChainFactory.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -40,7 +40,7 @@
*/
@DefaultFactoryFor(classes = InterceptorChain.class)
public class InterceptorChainFactory extends AbstractNamedCacheComponentFactory implements AutoInstantiableFactory {
- private CommandInterceptor createInterceptor(Class<? extends CommandInterceptor> clazz) throws IllegalAccessException, InstantiationException {
+ public CommandInterceptor createInterceptor(Class<? extends CommandInterceptor> clazz) throws IllegalAccessException, InstantiationException {
CommandInterceptor chainedInterceptor = componentRegistry.getComponent(clazz);
if (chainedInterceptor == null) {
chainedInterceptor = clazz.newInstance();
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/pom.xml 2009-09-23 14:10:01 UTC (rev 842)
@@ -22,6 +22,7 @@
<modules>
<module>parent</module>
<module>core</module>
+ <module>query</module>
<module>tree</module>
<module>cachestore/bdbje</module>
<module>cachestore/s3</module>
Modified: trunk/query/infinispan-query.iml
===================================================================
--- trunk/query/infinispan-query.iml 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/infinispan-query.iml 2009-09-23 14:10:01 UTC (rev 842)
@@ -11,6 +11,10 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="infinispan-core" />
+ <orderEntry type="module" module-name="infinispan-tree" />
+ <orderEntry type="module" module-name="infinispan-core" />
+ <orderEntry type="module" module-name="infinispan-tree" />
<orderEntry type="module-library">
<library>
<CLASSES>
@@ -36,140 +40,182 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.13/log4j-1.2.13.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.13/log4j-1.2.13-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module" module-name="infinispan-core" />
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/jgroups/jgroups/2.8.0.Beta1/jgroups-2.8.0.Beta1.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/jgroups/jgroups/2.8.0.Beta1/jgroups-2.8.0.Beta1-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/transaction/jta/1.1/jta-1.1.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/jgroups/jgroups/2.8.0.CR1/jgroups-2.8.0.CR1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/jgroups/jgroups/2.8.0.CR1/jgroups-2.8.0.CR1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-spi/2.1.0.GA/jboss-logging-spi-2.1.0.GA.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/5.9/testng-5.9-jdk15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-spi/2.1.0.GA/jboss-logging-spi-2.1.0.GA-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/5.9/testng-5.9-jdk15-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/marshalling-api/1.2.0.CR2/marshalling-api-1.2.0.CR2.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/marshalling-api/1.2.0.CR2/marshalling-api-1.2.0.CR2-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/river/1.2.0.CR2/river-1.2.0.CR2.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/javaee/jboss-transaction-api/1.0.1.GA/jboss-transaction-api-1.0.1.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/river/1.2.0.CR2/river-1.2.0.CR2-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/javaee/jboss-transaction-api/1.0.1.GA/jboss-transaction-api-1.0.1.GA-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymockclassextension/2.4/easymockclassextension-2.4.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/river/1.2.0.CR3/river-1.2.0.CR3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymockclassextension/2.4/easymockclassextension-2.4-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/river/1.2.0.CR3/river-1.2.0.CR3-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymock/2.4/easymock-2.4.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/marshalling-api/1.2.0.CR3/marshalling-api-1.2.0.CR3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymock/2.4/easymock-2.4-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/marshalling-api/1.2.0.CR3/marshalling-api-1.2.0.CR3-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/jboss-common-core/2.2.14.GA/jboss-common-core-2.2.14.GA-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module" module-name="infinispan-tree" />
- <orderEntry type="module" module-name="infinispan-core" />
- <orderEntry type="module" module-name="infinispan-tree" />
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/jboss/jbossts/jbossjta/4.4.0.GA/jbossjta-4.4.0.GA.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES />
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar!/" />
+ </SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymockclassextension/2.4/easymockclassextension-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymockclassextension/2.4/easymockclassextension-2.4-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymock/2.4/easymock-2.4.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/easymock/easymock/2.4/easymock-2.4-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar!/" />
</CLASSES>
<JAVADOC />
@@ -236,58 +282,47 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/transaction/jta/1.1/jta-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/javax/transaction/jta/1.1/jta-1.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/apache/lucene/lucene-core/2.4.0/lucene-core-2.4.0.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/apache/lucene/lucene-core/2.4.0/lucene-core-2.4.0-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/5.8/testng-5.8-jdk15.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/apache/lucene/lucene-core/2.4.0/lucene-core-2.4.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/org/testng/testng/5.8/testng-5.8-jdk15-sources.jar!/" />
+ <root url="jar://$MAVEN_REPOSITORY$/org/apache/lucene/lucene-core/2.4.0/lucene-core-2.4.0-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES>
- <root url="jar://$MAVEN_REPOSITORY$/junit/junit/3.8.1/junit-3.8.1-sources.jar!/" />
- </SOURCES>
- </library>
- </orderEntry>
</component>
</module>
Modified: trunk/query/pom.xml
===================================================================
--- trunk/query/pom.xml 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/pom.xml 2009-09-23 14:10:01 UTC (rev 842)
@@ -10,15 +10,14 @@
<relativePath>../parent/pom.xml</relativePath>
</parent>
- <groupId>org.infinispan</groupId>
<artifactId>infinispan-query</artifactId>
<name>Infinispan Query API</name>
<description>Infinispan Query API module</description>
<dependencies>
<dependency>
- <groupId>${project-package}</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>infinispan-core</artifactId>
- <version>${project-version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
@@ -28,28 +27,14 @@
</dependency>
<dependency>
- <groupId>${project-package}</groupId>
- <artifactId>infinispan-tree</artifactId>
- <version>${project-version}</version>
- </dependency>
-
- <dependency>
- <groupId>${project-package}</groupId>
+ <groupId>${project.groupId}</groupId>
<artifactId>infinispan-core</artifactId>
- <version>${project-version}</version>
+ <version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>${project-package}</groupId>
- <artifactId>infinispan-tree</artifactId>
- <version>${project-version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.4.2</version>
Modified: trunk/query/src/main/java/org/infinispan/query/CacheQuery.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/CacheQuery.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/CacheQuery.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -29,13 +29,14 @@
import java.util.List;
/**
- * A cache-query is what will be returned when the createQuery() method is run. This object can have methods such
+ * A cache-query is what will be returned when the getQuery() method is run on {@link QueryFactory}. This object can have methods such
* as list, setFirstResult,setMaxResults, setFetchSize, getResultSize and setSort.
*
* <p/>
- * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
- * @author Navin Surtani (<a href="mailto:nsurtani at redhat.com">nsurtani at redhat.com</a>)
- * @see org.infinispan.query.SearchableCache#createQuery(org.apache.lucene.search.Query, Class[])
+ * @author Manik Surtani
+ * @author Navin Surtani
+ * @see QueryFactory#getQuery(org.apache.lucene.search.Query)
+ * @see QueryFactory#getBasicQuery(String, String)
*/
public interface CacheQuery extends Iterable
{
Modified: trunk/query/src/main/java/org/infinispan/query/QueryFactory.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/QueryFactory.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/QueryFactory.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -6,10 +6,13 @@
import org.hibernate.search.engine.SearchFactoryImplementor;
import org.infinispan.Cache;
import org.infinispan.query.impl.CacheQueryImpl;
+import org.infinispan.query.backend.QueryHelper;
/**
- * // TODO: navssurtani --> Document this
+ * Class that is used to build {@link org.infinispan.query.CacheQuery}
*
+ *
+ *
* @author Navin Surtani
* @since 4.0
*/
@@ -20,9 +23,9 @@
private Cache cache;
private SearchFactoryImplementor searchFactory;
- public QueryFactory(Cache cache, SearchFactoryImplementor searchFactory){
+ public QueryFactory(Cache cache, QueryHelper qh){
this.cache = cache;
- this.searchFactory = searchFactory;
+ searchFactory = qh.getSearchFactory();
}
/**
Modified: trunk/query/src/main/java/org/infinispan/query/backend/IndexSearcherCloser.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/backend/IndexSearcherCloser.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/backend/IndexSearcherCloser.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -32,6 +32,8 @@
/**
* Class with static method that is called by {@link org.infinispan.query.impl.CacheQueryImpl} and {@link org.infinispan.query.impl.EagerIterator}
* <p />
+ *
+ * Simply an abstraction for one method to reduce unneccesary code replication.
* @author Navin Surtani
*/
public class IndexSearcherCloser
Modified: trunk/query/src/main/java/org/infinispan/query/backend/LocalQueryInterceptor.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/backend/LocalQueryInterceptor.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/backend/LocalQueryInterceptor.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -12,11 +12,10 @@
import java.util.Map;
/**
- * // TODO: Document this
* <p/>
* This class is an interceptor that will index data only if it has come from a local source.
* <p/>
- * Currently, this is a property that is determined by setting "indexLocal" as a System property to "true".
+ * Currently, this is a property that is determined by setting "infinispan.query.indexLocalOnly" as a System property to "true".
*
* @author Navin Surtani
* @since 4.0
@@ -25,11 +24,6 @@
public class LocalQueryInterceptor extends QueryInterceptor {
-
- // TODO: navssurtani --> check to make sure that these fields will be assigned properly on superclass method so that they can be used correctly when needed.
-
-
-
@Inject
public void init(SearchFactoryImplementor searchFactory, TransactionManager transactionManager) {
Modified: trunk/query/src/main/java/org/infinispan/query/backend/QueryHelper.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/backend/QueryHelper.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/backend/QueryHelper.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -15,10 +15,13 @@
import java.util.Properties;
/**
- * // TODO: Document this
* <p/>
- * This is a TEMPORARY helper class that will be used to add the QueryInterceptor to the chain.
+ * This is a TEMPORARY helper class that will be used to add the QueryInterceptor to the chain and provide Classes to
+ * Hibernate Search.
*
+ * This class needs to be instantiated and then have applyProperties() called on it. This class WILL be removed once other hooks come into Infinispan
+ * for versions 4.1 etc.
+ *
* @author Navin Surtani
* @since 4.0
*/
@@ -26,6 +29,9 @@
public class QueryHelper {
+ public static final String QUERY_ENABLED_PROPERTY = "infinispan.query.enabled";
+ public static final String QUERY_INDEX_LOCAL_ONLY_PROPERTY = "infinispan.query.indexLocalOnly";
+
private Cache cache;
private Properties properties;
private Class[] classes;
@@ -33,7 +39,6 @@
Log log = LogFactory.getLog(getClass());
-
/**
* Constructor that will take in 3 params and build the searchFactory for Hibernate Search.
* <p/>
@@ -47,8 +52,6 @@
*/
public QueryHelper(Cache cache, Properties properties, Class... classes) {
-
-
// assume cache is already created and running.
// otherwise, start the cache!!
if (cache.getStatus().needToInitializeBeforeStart()) {
@@ -98,25 +101,18 @@
throws Exception {
- log.debug("Entered QueryHelper.applyProperties()");
+ if (log.isDebugEnabled()) log.debug("Entered QueryHelper.applyProperties()");
// If the query property is set to true, i.e. we want to query objects in the cache, then we need to add the QueryInterceptor.
+ boolean query = Boolean.getBoolean(QUERY_ENABLED_PROPERTY);
- if (System.getProperty("query").equals("true")) {
+ if (query) {
- String indexLocal = System.getProperty("indexLocal");
+ boolean indexLocal = Boolean.getBoolean(QUERY_INDEX_LOCAL_ONLY_PROPERTY);
- // Validation check first to make sure there isn't some gibberish passed in.
- if (!indexLocal.equals("true") && !indexLocal.equals("false")) {
- throw new IllegalArgumentException("Incorrect system property passed into QueryHelper. indexLocal must be set" +
- " to either true or false. Cannot be " + indexLocal);
- }
-
-
- if (indexLocal.equals("true")) {
+ if (indexLocal) {
// Add a LocalQueryInterceptor to the chain
addInterceptor(LocalQueryInterceptor.class);
-
}
// We're indexing data even if it comes from other sources
Modified: trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/backend/QueryInterceptor.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -16,8 +16,12 @@
import java.util.Map;
/**
- * // TODO: navssurtani --> Document this
+ * This interceptor will be created when the System Property "infinispan.query.indexLocalOnly" is "false"
*
+ * This type of interceptor will allow the indexing of data even when it comes from other caches within a cluster.
+ *
+ * However, if the a cache would not be putting the data locally, the interceptor will not index it.
+ *
* @author Navin Surtani
* @since 4.0
*/
@@ -42,7 +46,7 @@
// This method will get the put() calls on the cache and then send them into Lucene once it's successful.
- log.debug("Entered the searchable core interceptor visitPutKeyValueCommand()");
+ if (log.isDebugEnabled())log.debug("Entered the searchable core interceptor visitPutKeyValueCommand()");
// do the actual put first.
Object toReturn = invokeNextInterceptor(ctx, command);
@@ -60,7 +64,7 @@
// remove the object out of the cache first.
Object valueRemoved = invokeNextInterceptor(ctx, command);
- System.out.println("Transaction Manager is " + transactionManager);
+ if (log.isDebugEnabled()) log.debug("Transaction Manager is " + transactionManager);
if (command.isSuccessful()) {
removeFromIndexes(valueRemoved, command.getKey().toString());
Modified: trunk/query/src/main/java/org/infinispan/query/backend/SearchableCacheConfiguration.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/backend/SearchableCacheConfiguration.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/backend/SearchableCacheConfiguration.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -77,6 +77,9 @@
return null;
}
+
+ //TODO: Will have to be uncommented when dependency is changed to HS 3.2
+
// public SearchMapping getProgrammaticMapping() {
//
// // Documentation on interface says "returns the programmatic configuration or null".
Modified: trunk/query/src/main/java/org/infinispan/query/backend/TransactionalEventTransactionContext.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/backend/TransactionalEventTransactionContext.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/backend/TransactionalEventTransactionContext.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -39,7 +39,6 @@
* Hibernate Search {@link org.hibernate.search.backend.Work} object.
* <p/>
* <p/>
- * // TODO: navssurtani--> Document up this class. Clean up old JBCS stuff etc etc.
*
* @author Navin Surtani
* @see QueryInterceptor
@@ -57,7 +56,6 @@
* @throws NullPointerException if event is null.
*/
public TransactionalEventTransactionContext(TransactionManager transactionManager) {
-// if (transactionManager == null) throw new NullPointerException("transaction manager cannot be null");
this.transactionManager = transactionManager;
}
Modified: trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/impl/AbstractIterator.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -10,6 +10,8 @@
* been put onto a separate class.
*
* @author Navin Surtani
+ * @see org.infinispan.query.impl.EagerIterator
+ * @see org.infinispan.query.impl.LazyIterator
* @since 4.0
*/
Modified: trunk/query/src/main/java/org/infinispan/query/impl/CacheQueryImpl.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/impl/CacheQueryImpl.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/impl/CacheQueryImpl.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -63,8 +63,6 @@
* Implementation class of the CacheQuery interface.
* <p/>
*
- * //TODO: navssurtani --> Document this up.
- *
* @author Navin Surtani
*/
public class CacheQueryImpl implements CacheQuery
Modified: trunk/query/src/main/java/org/infinispan/query/impl/EagerIterator.java
===================================================================
--- trunk/query/src/main/java/org/infinispan/query/impl/EagerIterator.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/main/java/org/infinispan/query/impl/EagerIterator.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -24,10 +24,9 @@
import net.jcip.annotations.NotThreadSafe;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.infinispan.Cache;
-import org.infinispan.query.impl.AbstractIterator;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
import java.util.Arrays;
import java.util.List;
@@ -39,7 +38,6 @@
* <p/>
* <p/>
*
- * //TODO: navssurtani --> Document this.
*
* @author Navin Surtani
*/
@@ -49,8 +47,6 @@
//private final int size;
private List<Object> idList;
- private int lowerLimit = 0;
- private int upperLimit = 0;
private static final Log log = LogFactory.getLog(EagerIterator.class);
@@ -98,8 +94,6 @@
{
// This method does not need to do anything for this type of iterator as when an instace of it is
// created, the iterator() method in CacheQueryImpl closes everything that needs to be closed.
-
- // TODO: Should I be throwing an exception here?
}
/**
Modified: trunk/query/src/test/java/org/infinispan/query/blackbox/ClusteredCacheTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/blackbox/ClusteredCacheTest.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/test/java/org/infinispan/query/blackbox/ClusteredCacheTest.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -1,7 +1,5 @@
package org.infinispan.query.blackbox;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
@@ -15,9 +13,9 @@
import org.infinispan.query.test.Person;
import org.infinispan.test.MultipleCacheManagersTest;
import org.infinispan.test.TestingUtil;
-import org.infinispan.tree.Fqn;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.List;
@@ -26,8 +24,7 @@
* @author Navin Surtani
*/
@Test(groups = "functional")
-public class ClusteredCacheTest extends MultipleCacheManagersTest
-{
+public class ClusteredCacheTest extends MultipleCacheManagersTest {
Cache<String, Person> cache1, cache2;
Person person1;
Person person2;
@@ -47,45 +44,46 @@
cleanup = CleanupPhase.AFTER_METHOD;
}
- @BeforeMethod
protected void createCacheManagers() throws Throwable {
- Configuration cacheCfg = new Configuration();
- cacheCfg.setCacheMode(Configuration.CacheMode.REPL_SYNC);
- cacheCfg.setFetchInMemoryState(false);
- List<Cache<String, Person>> caches = createClusteredCaches(2, "infinispan-query", cacheCfg);
+ Configuration cacheCfg = new Configuration();
+ cacheCfg.setCacheMode(Configuration.CacheMode.REPL_SYNC);
+ cacheCfg.setFetchInMemoryState(false);
- cache1 = caches.get(0);
- cache2 = caches.get(1);
+ List<Cache<String, Person>> caches = createClusteredCaches(2, "infinispan-query", cacheCfg);
- // We will put objects into cache1 and then try and run the queries on cache2. This would mean that indexLocal
- // must be set to false.
+ cache1 = caches.get(0);
+ cache2 = caches.get(1);
- System.setProperty("query", "true");
- System.setProperty("indexLocal", "false");
+ // We will put objects into cache1 and then try and run the queries on cache2. This would mean that indexLocal
+ // must be set to false.
- qh = new QueryHelper(cache2, null, Person.class);
- qh.applyProperties();
+ System.setProperty(QueryHelper.QUERY_ENABLED_PROPERTY, "true");
+ System.setProperty(QueryHelper.QUERY_INDEX_LOCAL_ONLY_PROPERTY, "false");
- TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
+ qh = new QueryHelper(cache2, null, Person.class);
+ qh.applyProperties();
- person1 = new Person();
- person1.setName("Navin Surtani");
- person1.setBlurb("Likes playing WoW");
+ TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
- person2 = new Person();
- person2.setName("BigGoat");
- person2.setBlurb("Eats grass");
+ person1 = new Person();
+ person1.setName("Navin Surtani");
+ person1.setBlurb("Likes playing WoW");
- person3 = new Person();
- person3.setName("MiniGoat");
- person3.setBlurb("Eats cheese");
+ person2 = new Person();
+ person2.setName("BigGoat");
+ person2.setBlurb("Eats grass");
- //Put the 3 created objects in the cache1.
+ person3 = new Person();
+ person3.setName("MiniGoat");
+ person3.setBlurb("Eats cheese");
- cache1.put(key1, person1);
- cache1.put(key2, person2);
- cache1.put(key3, person3);
+ //Put the 3 created objects in the cache1.
+
+ cache1.put(key1, person1);
+ cache1.put(key2, person2);
+ cache1.put(key3, person3);
+
}
@AfterMethod
@@ -93,25 +91,20 @@
IndexCleanUp.cleanUpIndexes();
}
- public void testSimple() throws ParseException
- {
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory())
+ public void testSimple() throws ParseException {
+ cacheQuery = new QueryFactory(cache2, qh)
.getBasicQuery("blurb", "playing");
+
found = cacheQuery.list();
assert found.size() == 1;
- if(found.get(0) == null)
- {
+ if (found.get(0) == null) {
log.warn("found.get(0) is null");
- Person p1 = (Person) cache2.get(key1);
- if(p1 == null)
- {
+ Person p1 = cache2.get(key1);
+ if (p1 == null) {
log.warn("Person p1 is null in sc2 and cannot actually see the data of person1 in sc1");
- }
-
- else
- {
+ } else {
log.trace("p1 name is " + p1.getName());
}
@@ -121,11 +114,10 @@
}
- public void testModified() throws ParseException
- {
+ public void testModified() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache2, qh).getQuery(luceneQuery);
found = cacheQuery.list();
@@ -138,7 +130,7 @@
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("pizza");
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache2, qh).getQuery(luceneQuery);
found = cacheQuery.list();
@@ -146,15 +138,13 @@
assert found.get(0).equals(person1);
}
- public void testAdded() throws ParseException
- {
+ public void testAdded() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("eats");
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache2, qh).getQuery(luceneQuery);
found = cacheQuery.list();
- System.out.println("found.size() is " + found.size());
assert found.size() == 2 : "Size of list should be 2";
assert found.contains(person2);
@@ -168,7 +158,7 @@
cache1.put("mighty", person4);
luceneQuery = queryParser.parse("eats");
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache2, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 3 : "Size of list should be 3";
@@ -177,35 +167,34 @@
assert found.contains(person4) : "This should now contain object person4";
}
- public void testRemoved() throws ParseException
- {
+ public void testRemoved() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("eats");
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache2, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
assert found.contains(person2);
assert found.contains(person3) : "This should still contain object person3";
- cache1.remove(Fqn.fromString("/a/b/c/"), key3);
+ cache1.remove(key3);
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("eats");
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache2, qh).getQuery(luceneQuery);
found = cacheQuery.list();
- System.out.println("list is: - " + found);
-
}
- public void testGetResultSize() throws ParseException{
+ public void testGetResultSize() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache2, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache2, qh).getQuery(luceneQuery);
+ found = cacheQuery.list();
- System.out.println("Result size is: - " + cacheQuery.getResultSize());
+ assert found.size() == 1;
+
}
Modified: trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheProfilerTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheProfilerTest.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheProfilerTest.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -59,8 +59,8 @@
@BeforeMethod
public void setUp() throws Exception {
- System.setProperty("query", "true");
- System.setProperty("indexLocal", "true");
+ System.setProperty(QueryHelper.QUERY_ENABLED_PROPERTY, "true");
+ System.setProperty(QueryHelper.QUERY_INDEX_LOCAL_ONLY_PROPERTY, "false");
cache = createCacheManager().getCache();
@@ -102,7 +102,7 @@
@Test (invocationCount = 2000, enabled = false)
public void testSimple() throws ParseException {
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getBasicQuery("blurb", "playing");
+ cacheQuery = new QueryFactory(cache, qh).getBasicQuery("blurb", "playing");
found = cacheQuery.list();
@@ -113,7 +113,7 @@
@Test (invocationCount = 2000, enabled = false)
public void testEagerIterator() throws ParseException {
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).
+ cacheQuery = new QueryFactory(cache, qh).
getBasicQuery("blurb", "playing");
QueryIterator found = cacheQuery.iterator();
@@ -128,7 +128,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -141,7 +141,7 @@
public void testModified() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
@@ -153,7 +153,7 @@
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("pizza");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
@@ -166,7 +166,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2 : "Size of list should be 2";
@@ -181,7 +181,7 @@
cache.put("mighty", person4);
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 3 : "Size of list should be 3";
@@ -195,7 +195,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -205,7 +205,7 @@
cache.remove(key3);
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 1;
@@ -225,7 +225,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -244,7 +244,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -263,7 +263,7 @@
public void testLazyIterator() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
QueryIterator found = cacheQuery.lazyIterator();
@@ -277,7 +277,7 @@
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
assert cacheQuery.getResultSize() == 1;
}
Modified: trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/test/java/org/infinispan/query/blackbox/LocalCacheTest.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -59,16 +59,14 @@
@BeforeMethod
public void setUp() throws Exception {
- System.setProperty("query", "true");
- System.setProperty("indexLocal", "true");
+ System.setProperty(QueryHelper.QUERY_ENABLED_PROPERTY, "true");
+ System.setProperty(QueryHelper.QUERY_INDEX_LOCAL_ONLY_PROPERTY, "true");
cache = createCacheManager().getCache();
qh = new QueryHelper(cache, null, Person.class);
qh.applyProperties();
-
-
person1 = new Person();
person1.setName("Navin Surtani");
@@ -100,7 +98,7 @@
}
public void testSimple() throws ParseException {
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getBasicQuery("blurb", "playing");
+ cacheQuery = new QueryFactory(cache, qh).getBasicQuery("blurb", "playing");
found = cacheQuery.list();
@@ -110,7 +108,7 @@
public void testEagerIterator() throws ParseException {
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).
+ cacheQuery = new QueryFactory(cache, qh).
getBasicQuery("blurb", "playing");
QueryIterator found = cacheQuery.iterator();
@@ -124,7 +122,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -136,7 +134,7 @@
public void testModified() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
@@ -148,7 +146,7 @@
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("pizza");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
@@ -160,7 +158,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2 : "Size of list should be 2";
@@ -175,7 +173,7 @@
cache.put("mighty", person4);
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 3 : "Size of list should be 3";
@@ -188,7 +186,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -198,7 +196,7 @@
cache.remove(key3);
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 1;
@@ -217,7 +215,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("Goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -235,7 +233,7 @@
queryParser = new QueryParser("name", new StandardAnalyzer());
luceneQuery = queryParser.parse("goat");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
found = cacheQuery.list();
assert found.size() == 2;
@@ -253,7 +251,7 @@
public void testLazyIterator() throws ParseException {
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
QueryIterator found = cacheQuery.lazyIterator();
@@ -266,7 +264,7 @@
queryParser = new QueryParser("blurb", new StandardAnalyzer());
luceneQuery = queryParser.parse("playing");
- cacheQuery = new QueryFactory(cache, qh.getSearchFactory()).getQuery(luceneQuery);
+ cacheQuery = new QueryFactory(cache, qh).getQuery(luceneQuery);
assert cacheQuery.getResultSize() == 1;
}
Modified: trunk/query/src/test/java/org/infinispan/query/test/Person.java
===================================================================
--- trunk/query/src/test/java/org/infinispan/query/test/Person.java 2009-09-22 11:23:04 UTC (rev 841)
+++ trunk/query/src/test/java/org/infinispan/query/test/Person.java 2009-09-23 14:10:01 UTC (rev 842)
@@ -1,8 +1,6 @@
package org.infinispan.query.test;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.FieldBridge;
import org.hibernate.search.annotations.Index;
@@ -10,6 +8,8 @@
import org.hibernate.search.annotations.ProvidedId;
import org.hibernate.search.annotations.Store;
import org.hibernate.search.bridge.builtin.StringBridge;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
import java.io.Serializable;
More information about the infinispan-commits
mailing list