Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Factored out API and factored Solr indexer into new module

  • Loading branch information...
ajs6f committed Jan 7, 2014
1 parent a9269e1 commit 8ec51e6206474295f6e683c44bbeddb51fba6afd
Showing with 644 additions and 215 deletions.
  1. +42 −0 fcrepo-jms-indexer-api/pom.xml
  2. 0 ...po-jms-indexer-core → fcrepo-jms-indexer-api}/src/main/java/org/fcrepo/indexer/AsynchIndexer.java
  3. 0 {fcrepo-jms-indexer-core → fcrepo-jms-indexer-api}/src/main/java/org/fcrepo/indexer/Indexer.java
  4. 0 {fcrepo-jms-indexer-core → fcrepo-jms-indexer-api}/src/main/java/org/fcrepo/indexer/NamedFields.java
  5. 0 ...epo-jms-indexer-core → fcrepo-jms-indexer-api}/src/main/java/org/fcrepo/indexer/SynchIndexer.java
  6. +5 −11 ...ContentRetriever.java → fcrepo-jms-indexer-api/src/main/java/org/fcrepo/indexer/package-info.java
  7. 0 {fcrepo-jms-indexer-core → fcrepo-jms-indexer-api}/src/main/resources/indexing.cnd
  8. +1 −0 fcrepo-jms-indexer-core/.gitignore
  9. +34 −46 fcrepo-jms-indexer-core/pom.xml
  10. +3 −22 fcrepo-jms-indexer-core/src/test/java/org/fcrepo/indexer/system/IndexingIT.java
  11. +0 −3 fcrepo-jms-indexer-core/src/test/resources/indexingtest.cnd
  12. +7 −35 fcrepo-jms-indexer-core/src/test/resources/spring-test/indexer-core.xml
  13. +55 −1 fcrepo-jms-indexer-elasticsearch/pom.xml
  14. +2 −0 ...-indexer-elasticsearch/src/test/java/org/fcrepo/indexer/elastic/integration/ElasticIndexerIT.java
  15. +204 −0 fcrepo-jms-indexer-solr/pom.xml
  16. +11 −13 ...ms-indexer-core → fcrepo-jms-indexer-solr}/src/main/java/org/fcrepo/indexer/solr/SolrIndexer.java
  17. 0 ...e → fcrepo-jms-indexer-solr}/src/test/java/org/fcrepo/indexer/integration/solr/SolrIndexerIT.java
  18. 0 ...ndexer-core → fcrepo-jms-indexer-solr}/src/test/java/org/fcrepo/indexer/solr/SolrIndexerTest.java
  19. +2 −2 ...dexer-core → fcrepo-jms-indexer-solr}/src/test/java/org/fcrepo/indexer/system/SolrMappingsIT.java
  20. 0 {fcrepo-jms-indexer-core → fcrepo-jms-indexer-solr}/src/test/resources/ldpath/dublin_core.ldpath
  21. 0 {fcrepo-jms-indexer-core → fcrepo-jms-indexer-solr}/src/test/resources/solr/solr.xml
  22. 0 {fcrepo-jms-indexer-core → fcrepo-jms-indexer-solr}/src/test/resources/solr/testCore/conf/schema.xml
  23. 0 ...-jms-indexer-core → fcrepo-jms-indexer-solr}/src/test/resources/solr/testCore/conf/solrconfig.xml
  24. 0 {fcrepo-jms-indexer-core → fcrepo-jms-indexer-solr}/src/test/resources/solr/testCore/core.properties
  25. +24 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/eventing.xml
  26. +36 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/indexer-core.xml
  27. +47 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/indexer-events.xml
  28. +30 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/jms.xml
  29. +14 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/master.xml
  30. +20 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/repo.xml
  31. +13 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/rest.xml
  32. +17 −0 fcrepo-jms-indexer-solr/src/test/resources/spring-test/test-container.xml
  33. +38 −0 fcrepo-jms-indexer-solr/src/test/resources/web.xml
  34. +22 −4 fcrepo-jms-indexer-webapp/pom.xml
  35. +17 −78 pom.xml
@@ -0,0 +1,42 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-jms-indexer-pluggable</artifactId>
<version>4.0.0-alpha-3-SNAPSHOT</version>
</parent>
<artifactId>fcrepo-jms-indexer-api</artifactId>
<name>Indexer API</name>
<description>Contains types for Java and JCR.</description>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -13,18 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.fcrepo.indexer;

import java.io.InputStream;
import java.util.concurrent.Callable;

/**
* Implemented by classes that retrieve indexable content for a resource.
*
*
*/
/**
* @author ajs6f
* @date Dec 6, 2013
* @date Jan 7, 2014
*/
public interface IndexableContentRetriever extends Callable<InputStream> {

}
package org.fcrepo.indexer;
@@ -0,0 +1 @@
/target
@@ -14,9 +14,16 @@
<packaging>jar</packaging>

<dependencies>

<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-jms-indexer-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
@@ -121,36 +128,7 @@
<groupId>org.apache.jena</groupId>
<artifactId>jena-fuseki</artifactId>
<scope>test</scope>
<!-- <exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions> -->
</dependency>
<!-- Start of Solr Indexer libs -->
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-test-framework</artifactId>
</dependency> -->
<!-- HttpClient are used for create standardalone SolrIndexer Server client.
They seem to be included with Solr 3.6.2?
Ver 4.2.5 aim to fit JENA included version -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
<!-- End of Solr Indexer libs -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
@@ -165,7 +143,16 @@
</resource>
</resources>
<plugins>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.2</version>
@@ -245,9 +232,24 @@
</goals>
</execution>
</executions>

</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
<configuration>
<resourceBundles>
<resourceBundle>org.fcrepo:fcrepo-jms-indexer-api:${project.version}</resourceBundle>
</resourceBundles>
</configuration>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
@@ -263,18 +265,4 @@
</plugins>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${solr.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-facet</artifactId>
<version>${solr.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
@@ -79,33 +79,14 @@ public void setUp() throws ClientProtocolException, IOException {
LOGGER.debug("Installing indexing type information...");
update = new HttpPost(serverAddress + "fcr:nodetypes");
update.setHeader("Content-Type", "text/cnd");
HttpEntity cnd =
final HttpEntity cnd =
new StringEntity(Files.toString(new File(
"target/classes/indexing.cnd"), defaultCharset()));
"target/maven-shared-archive-resources/indexing.cnd"),
defaultCharset()));
update.setEntity(cnd);
response = client.execute(update);
assertEquals("Failed to install indexing type information!",
SC_NO_CONTENT, response.getStatusLine().getStatusCode());

LOGGER.debug("Installing indexing test type information...");
update = new HttpPost(serverAddress + "fcr:nodetypes");
update.setHeader("Content-Type", "text/cnd");
cnd =
new StringEntity(Files.toString(new File(
"target/test-classes/indexingtest.cnd"), defaultCharset()));
update.setEntity(cnd);
response = client.execute(update);
assertEquals("Failed to install indexing test type information!",
SC_NO_CONTENT, response.getStatusLine().getStatusCode());
/*HttpGet nsRequest = new HttpGet(serverAddress + "fcr:namespaces");
nsRequest.setHeader("Content-Type", WebContent.contentTypeN3Alt1);
LOGGER.debug("Now registered namespaces include:\n{}", IOUtils
.toString(client.execute(nsRequest).getEntity().getContent()));
nsRequest = new HttpGet(serverAddress + "fcr:nodetypes");
nsRequest.setHeader("Content-Type", WebContent.contentTypeN3Alt1);
LOGGER.debug("and registered node types:\n{}", IOUtils.toString(client
.execute(nsRequest).getEntity().getContent()));*/

}


This file was deleted.

Oops, something went wrong.
@@ -3,50 +3,23 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd">

<!-- sparql-update indexer -->
<bean id="sparqlUpdate" class="org.fcrepo.indexer.sparql.SparqlIndexer">

<!-- fuseki -->
<property name="queryBase"
value="http://localhost:${test.fuseki.port:3030}/test/query"/>
<property name="updateBase"
value="http://localhost:${test.fuseki.port:3030}/test/update"/>
<property name="formUpdates">
<value type="java.lang.Boolean">false</value>
</property>

</bean>
<bean id="sparqlUpdate" class="org.fcrepo.indexer.sparql.SparqlIndexer"
p:queryBase="http://localhost:${test.fuseki.port:3030}/test/query"
p:updateBase="http://localhost:${test.fuseki.port:3030}/test/update"
p:formUpdates="false"/>

<!-- test indexer -->
<bean id="testIndexer" class="org.fcrepo.indexer.TestIndexer"/>

<!-- file serializer -->
<bean id="fileSerializer" class="org.fcrepo.indexer.FileSerializer">
<property name="path" value="./target/test-classes/fileSerializer/"/>
</bean>

<!-- Solr Indexer START-->
<bean id="solrIndexer" class="org.fcrepo.indexer.solr.SolrIndexer"/>

<bean class="java.io.File" id="solrConfig">
<constructor-arg type="String">
<value>target/test-classes/solr/solr.xml</value>
</constructor-arg>
</bean>

<!--Embedded Server -->
<bean id="multiCore" class="org.apache.solr.core.CoreContainer"
factory-method="createAndLoad" c:solrHome="target/test-classes/solr"
c:configFile-ref="solrConfig"/>

<bean id="solrServer"
class="org.apache.solr.client.solrj.embedded.EmbeddedSolrServer"
c:coreContainer-ref="multiCore" c:coreName="testCore"/>
<!-- Solr Indexer END-->
<bean id="fileSerializer" class="org.fcrepo.indexer.FileSerializer"
p:path="./target/test-classes/fileSerializer/"/>

<!-- Message Driven POJO (MDP) that manages individual indexers -->
<bean id="indexerGroup" class="org.fcrepo.indexer.IndexerGroup">
@@ -56,7 +29,6 @@
<ref bean="testIndexer"/>
<ref bean="fileSerializer"/>
<ref bean="sparqlUpdate"/>
<ref bean="solrIndexer"/>
</set>
</property>
</bean>
@@ -10,14 +10,24 @@
<description>Fedora JMS-driven indexer for Elasticsearch</description>

<properties>
<es.lucene.version>4.5.1</es.lucene.version>
<es.lucene.version>4.6.0</es.lucene.version>
</properties>

<dependencies>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-jms-indexer-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-jms-indexer-core</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
@@ -46,12 +56,36 @@
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-memory</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-join</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-join</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-suggest</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-codecs</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
@@ -70,6 +104,26 @@
<artifactId>lucene-facet</artifactId>
<version>${es.lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-join</artifactId>
<version>${es.lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>${es.lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-suggest</artifactId>
<version>${es.lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-codecs</artifactId>
<version>${es.lucene.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Oops, something went wrong.

0 comments on commit 8ec51e6

Please sign in to comment.
You can’t perform that action at this time.