Commit f67a013c authored by Liquan Pei's avatar Liquan Pei Committed by GitHub
Browse files

Merge pull request #1 from confluentinc/initial-impl

Initial implementation
parents b5836f0a 6a741a84
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+3 −0
Original line number Diff line number Diff line
target
.idea
*.iml
+20 −2
Original line number Diff line number Diff line
Kafka Connect Elasticsearch Connector
-------------------------------------
 No newline at end of file
# Kafka Connect Elasticsearch Connector

kafka-connect-elasticsearch is a [Kafka Connector](http://kafka.apache.org/090/documentation.html#connect)
for copying data between Kafka and Elasticsearch.

# Development

To build a development version you'll need a recent version of Kafka. You can build
kafka-connect-elasticsearch with Maven using the standard lifecycle phases.


# Contribute

- Source Code: https://github.com/confluentinc/kafka-connect-elasticsearch
- Issue Tracker: https://github.com/confluentinc/kafka-connect-elasticsearch/issues


# License

The project is licensed under the Apache 2 license.
 No newline at end of file
+84 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
    "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
     "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
 // Copyright 2015 Confluent Inc.
 //
 // Licensed 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.
-->
<module name="Checker">
  <property name="localeLanguage" value="en"/>

  <module name="FileTabCharacter"/>

  <!-- header -->
  <module name="RegexpHeader">
    <property name="header" value="/\*\*\nCopyright .* Confluent Inc."/>
  </module>

  <module name="TreeWalker">

    <!-- code cleanup -->
    <module name="UnusedImports"/>
    <module name="RedundantImport"/>
    <module name="IllegalImport" />
    <module name="EqualsHashCode"/>
    <module name="SimplifyBooleanExpression"/>
    <module name="OneStatementPerLine"/>
    <module name="SimplifyBooleanReturn"/>

    <!-- style -->
    <module name="DefaultComesLast"/>
    <module name="EmptyStatement"/>
    <module name="ArrayTypeStyle"/>
    <module name="UpperEll"/>
    <module name="LeftCurly"/>
    <module name="RightCurly"/>
    <module name="EmptyStatement"/>
    <module name="ConstantName">
      <property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)|(^log$)"/>
    </module>
    <module name="LocalVariableName"/>
    <module name="LocalFinalVariableName"/>
    <module name="MemberName"/>
    <module name="ClassTypeParameterName">
      <property name="format" value="^[A-Z0-9]*$"/>
    </module>
    <module name="MethodTypeParameterName">
      <property name="format" value="^[A-Z0-9]*$"/>
    </module>
    <module name="PackageName"/>
    <module name="ParameterName"/>
    <module name="StaticVariableName"/>
    <module name="TypeName"/>
    <module name="AvoidStarImport"/>

    <!-- whitespace -->
    <module name="GenericWhitespace"/>
    <module name="NoWhitespaceBefore"/>
    <module name="WhitespaceAfter" />
    <module name="NoWhitespaceAfter"/>
    <module name="WhitespaceAround">
      <property name="allowEmptyConstructors" value="true"/>
      <property name="allowEmptyMethods" value="true"/>
    </module>
    <module name="Indentation">
      <property name="basicOffset" value="2"/>
      <property name="caseIndent" value="2"/>
    </module>
    <module name="MethodParamPad"/>
    <module name="ParenPad"/>
    <module name="TypecastParenPad"/>
  </module>
</module>
+23 −0
Original line number Diff line number Diff line
##
# Copyright 2016 Confluent Inc.
#
# Licensed 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.
##

name=elasticsearch-sink
connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector
tasks.max=1
topics=test-elasticsearch-sink
key.ignore=true
transport.addresses=localhost:9300
type.name=kafka-connect
 No newline at end of file

pom.xml

0 → 100644
+185 −0
Original line number Diff line number Diff line
<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.confluent</groupId>
    <artifactId>kafka-connect-elasticsearch</artifactId>
    <version>3.0.0-SNAPSHOT</version>

    <properties>
        <confluent.version>3.0.0-SNAPSHOT</confluent.version>
        <kafka.version>0.10.1.0-SNAPSHOT</kafka.version>
        <junit.version>4.12</junit.version>
        <es.version>2.2.1</es.version>
        <lucene.version>5.3.1</lucene.version>
        <slf4j.version>1.7.5</slf4j.version>
        <jna.version>4.2.1</jna.version>
        <hamcrest.version>2.0.0.0</hamcrest.version>
        <confluent.maven.repo>http://packages.confluent.io/maven/</confluent.maven.repo>
    </properties>

    <repositories>
        <repository>
            <id>confluent</id>
            <name>Confluent</name>
            <url>${confluent.maven.repo}</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-api</artifactId>
            <version>${kafka.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-json</artifactId>
            <version>${kafka.version}</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>${es.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-expressions</artifactId>
            <version>${lucene.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>${jna.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-junit</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-test-framework</artifactId>
            <version>${lucene.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>${es.version}</version>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <inherited>true</inherited>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/development.xml</descriptor>
                        <descriptor>src/assembly/package.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <argLine>-Djava.awt.headless=true</argLine>
                    <argLine>-Dtests.security.manager=false</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>checkstyle/checkstyle.xml</configLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <includeResources>false</includeResources>
                            <includeTestResources>false</includeTestResources>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <id>standalone</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/standalone.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
Loading