Permalink
Browse files

initial implementation of st9 river / elasticsearch indexer

  • Loading branch information...
0 parents commit b76e55bf993a2191e6fd7f05f3ddf5f87601c85d @sunnygleason committed Apr 12, 2012
@@ -0,0 +1,10 @@
+/data
+/work
+/logs
+/.idea
+/target
+.DS_Store
+*.iml
+/.settings
+/.project
+/.classpath
@@ -0,0 +1,32 @@
+St9 River Plugin for ElasticSearch
+==================================
+
+The St9 River plugin allows St9 content to be indexed by elasticsearch.
+
+In order to install the plugin, simply run: `bin/plugin -install sunnygleason/elasticsearch-river-st9/0.0.1`.
+
+ --------------------------------------
+ | St9 Plugin | ElasticSearch |
+ --------------------------------------
+ | master | 0.19 -> master |
+ --------------------------------------
+ | 0.0.1 | 0.19 -> master |
+ --------------------------------------
+
+St9 River allows elasticsearch to automatically index content via redis pubsub.
+
+Creating the st9 river is as simple as (all configuration parameters are provided, with default values):
+
+ curl -XPUT 'localhost:9200/_river/my_river/_meta' -d '{
+ "type" : "st9",
+ "st9" : {
+ "redisHost" : "localhost",
+ "redisPort" : 6379,
+ "indexName" : "st9_index"
+ },
+ "index" : {
+ "bulk_size" : 100
+ }
+ }'
+
+The river will automatically bulk index queue messages when the queue is overloaded, allowing for faster catch-up with content streamed into the queue.
160 pom.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <name>elasticsearch-river-st9</name>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.elasticsearch</groupId>
+ <artifactId>elasticsearch-river-st9</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <description>St9 River for ElasticSearch</description>
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <scm>
+ <connection>scm:git:git@github.com:sunnygleason/elasticsearch-river-st9.git</connection>
+ <developerConnection>scm:git:git@github.com:sunnygleason/elasticsearch-river-st9.git</developerConnection>
+ <url>http://github.com/sunnygleason/elasticsearch-river-st9</url>
+ </scm>
+
+ <parent>
+ <groupId>org.sonatype.oss</groupId>
+ <artifactId>oss-parent</artifactId>
+ <version>7</version>
+ </parent>
+
+ <properties>
+ <elasticsearch.version>0.19.2</elasticsearch.version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>g414 Repository</id>
+ <url>http://mvn.g414.com/</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.elasticsearch</groupId>
+ <artifactId>elasticsearch</artifactId>
+ <version>${elasticsearch.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>redis.clients</groupId>
+ <artifactId>jedis</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.8.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.8.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-smile</artifactId>
+ <version>1.8.5</version>
+ </dependency>
+ <dependency>
+ <groupId>com.g414.codec</groupId>
+ <artifactId>g414-codec</artifactId>
+ <version>0.1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.3.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <version>1.3.RC2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>1.3.RC2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.11</version>
+ <configuration>
+ <includes>
+ <include>**/*Tests.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <outputDirectory>${project.build.directory}/releases/</outputDirectory>
+ <descriptors>
+ <descriptor>${basedir}/src/main/assemblies/plugin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<assembly>
+ <id>plugin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveFiltering>true</useTransitiveFiltering>
+ <excludes>
+ <exclude>org.elasticsearch:elasticsearch</exclude>
+ </excludes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveFiltering>true</useTransitiveFiltering>
+ <includes>
+ <include>redis.clients:jedis</include>
+ <include>org.codehaus.jackson:jackson-core-asl</include>
+ <include>org.codehaus.jackson:jackson-mapper-asl</include>
+ <include>org.codehaus.jackson:jackson-smile</include>
+ <include>com.g414.codec:g414-codec</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
@@ -0,0 +1,49 @@
+/*
+ * Licensed to ElasticSearch and Shay Banon under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. ElasticSearch licenses this
+ * file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.elasticsearch.plugin.river.st9;
+
+import org.elasticsearch.common.inject.Inject;
+import org.elasticsearch.plugins.AbstractPlugin;
+import org.elasticsearch.river.RiversModule;
+import org.elasticsearch.river.st9.St9RiverModule;
+
+/**
+ *
+ */
+public class St9RiverPlugin extends AbstractPlugin {
+
+ @Inject
+ public St9RiverPlugin() {
+ }
+
+ @Override
+ public String name() {
+ return "river-st9";
+ }
+
+ @Override
+ public String description() {
+ return "River St9 Plugin";
+ }
+
+ public void onModule(RiversModule module) {
+ module.registerRiver("st9", St9RiverModule.class);
+ }
+}
Oops, something went wrong.

0 comments on commit b76e55b

Please sign in to comment.