Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tajo-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<protobuf.version>2.5.0</protobuf.version>
<tajo.version>0.11.0-SNAPSHOT</tajo.version>
<hbase.version>0.98.7-hadoop2</hbase.version>
<kafka.version>0.8.2.0</kafka.version>
<kafka.artifactId>kafka_2.10</kafka.artifactId>
<netty.version>4.0.25.Final</netty.version>
<jersey.version>2.6</jersey.version>
<tajo.root>${project.parent.relativePath}/..</tajo.root>
Expand Down Expand Up @@ -763,6 +765,11 @@
<artifactId>tajo-storage-hbase</artifactId>
<version>${tajo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tajo</groupId>
<artifactId>tajo-storage-kafka</artifactId>
<version>${tajo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tajo</groupId>
<artifactId>tajo-pullserver</artifactId>
Expand Down
1 change: 1 addition & 0 deletions tajo-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<module>tajo-storage-common</module>
<module>tajo-storage-hdfs</module>
<module>tajo-storage-hbase</module>
<module>tajo-storage-kafka</module>
</modules>

<build>
Expand Down
257 changes: 257 additions & 0 deletions tajo-storage/tajo-storage-kafka/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2012 Database Lab., Korea Univ.

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.
-->

<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">
<parent>
<artifactId>tajo-project</artifactId>
<groupId>org.apache.tajo</groupId>
<version>0.11.0-SNAPSHOT</version>
<relativePath>../../tajo-project</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>tajo-storage-kafka</artifactId>
<packaging>jar</packaging>
<name>Tajo Kafka Storage</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<repositories>
<repository>
<id>repository.jboss.org</id>
<url>https://repository.jboss.org/nexus/content/repositories/releases/
</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemProperties>
<tajo.test>TRUE</tajo.test>
</systemProperties>
<argLine>-Xms512m -Xmx1024m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create-protobuf-generated-sources-directory</id>
<phase>initialize</phase>
<configuration>
<target>
<mkdir dir="target/generated-sources/proto" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<executable>protoc</executable>
<arguments>
<argument>-Isrc/main/proto/</argument>
<argument>--proto_path=../../tajo-common/src/main/proto</argument>
<argument>--proto_path=../../tajo-catalog/tajo-catalog-common/src/main/proto</argument>
<argument>--java_out=target/generated-sources/proto</argument>
<argument>src/main/proto/StorageFragmentProtos.proto</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/proto</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.tajo</groupId>
<artifactId>tajo-common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tajo</groupId>
<artifactId>tajo-catalog-common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tajo</groupId>
<artifactId>tajo-plan</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tajo</groupId>
<artifactId>tajo-storage-common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tajo</groupId>
<artifactId>tajo-storage-hdfs</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>${kafka.artifactId}</artifactId>
<version>${kafka.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>testing</artifactId>
<version>0.88</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<scope>test</scope>
<version>0.4</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>docs</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<!-- build javadoc jars per jar for publishing to maven -->
<id>module-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<destDir>${project.build.directory}</destDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.15</version>
</plugin>
</plugins>
</reporting>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.apache.tajo.storage.kafka;

import java.io.IOException;

import org.apache.tajo.catalog.statistics.TableStats;
import org.apache.tajo.storage.Appender;
import org.apache.tajo.storage.Tuple;

//is not supported yet.
public class KafkaAppender implements Appender {

@Override
public void init() throws IOException {
}

@Override
public void addTuple(Tuple t) throws IOException {
throw new IOException("It is not supported.");
}

@Override
public void flush() throws IOException {
throw new IOException("It is not supported.");
}

@Override
public long getEstimatedOutputSize() throws IOException {
return 0;
}

@Override
public void close() throws IOException {
}

@Override
public void enableStats() {
}

@Override
public TableStats getStats() {
return null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.apache.tajo.storage.kafka;

import org.apache.tajo.storage.StorageConstants;

public class KafkaStorageConstants extends StorageConstants {
public static final String KAFKA_TOPIC = "kafka.topic";
public static final String KAFKA_BROKER = "kafka.broker";
public static final String KAFKA_TOPIC_PARTITION = "kafka.topic.partition";
public static final String DEFAULT_KAFKA_SERDE_CLASS = "org.apache.tajo.storage.kafka.serDe.KafkaTextSerDe";
public static final String KAFKA_SERDE_CLASS = "kafka.serde";
public static final String KAFKA_FRAGMENT_SIZE = "kafka.fragment.size";
}
Loading