CAMEL-7249: camel-hdfs2 polished and added to the dist
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e2deddad Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e2deddad Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e2deddad Branch: refs/heads/master Commit: e2deddadf3b0493bd95eeaae7441f63f27dada49 Parents: cd10164 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Mar 12 14:21:05 2014 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Mar 12 14:21:05 2014 +0100 ---------------------------------------------------------------------- apache-camel/pom.xml | 4 + .../src/main/descriptors/common-bin.xml | 1 + components/camel-hbase/pom.xml | 2 + components/camel-hdfs2/pom.xml | 192 ++++++++++--------- .../camel/component/hdfs2/HdfsOsgiHelper.java | 7 +- .../camel/component/hdfs2/HdfsProducerTest.java | 1 - components/pom.xml | 1 + parent/pom.xml | 23 --- 8 files changed, 111 insertions(+), 120 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/apache-camel/pom.xml ---------------------------------------------------------------------- diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index 9f258a6..080eb0b 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -237,6 +237,10 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-hdfs2</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-http</artifactId> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/apache-camel/src/main/descriptors/common-bin.xml ---------------------------------------------------------------------- diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index 933de1a..86e6931 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -73,6 +73,7 @@ <include>org.apache.camel:camel-hazelcast</include> <include>org.apache.camel:camel-hbase</include> <include>org.apache.camel:camel-hdfs</include> + <include>org.apache.camel:camel-hdfs2</include> <include>org.apache.camel:camel-http</include> <include>org.apache.camel:camel-http4</include> <include>org.apache.camel:camel-ibatis</include> http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/components/camel-hbase/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-hbase/pom.xml b/components/camel-hbase/pom.xml index ad5b28c..84608b3 100644 --- a/components/camel-hbase/pom.xml +++ b/components/camel-hbase/pom.xml @@ -47,11 +47,13 @@ <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase</artifactId> + <version>${hbase-version}</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-core</artifactId> + <version>${hadoop-version}</version> <exclusions> <exclusion> <groupId>commons-codec</groupId> http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/components/camel-hdfs2/pom.xml ---------------------------------------------------------------------- diff --git a/components/camel-hdfs2/pom.xml b/components/camel-hdfs2/pom.xml index 0570e51..6408e11 100644 --- a/components/camel-hdfs2/pom.xml +++ b/components/camel-hdfs2/pom.xml @@ -17,104 +17,112 @@ 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/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel</groupId> - <artifactId>components</artifactId> - <version>2.13-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>components</artifactId> + <version>2.13-SNAPSHOT</version> + </parent> - <artifactId>camel-hdfs2</artifactId> - <packaging>bundle</packaging> - <name>Camel :: HDFS2</name> - <description>Camel HDFS support with Hadoop 2.x libraries</description> + <artifactId>camel-hdfs2</artifactId> + <packaging>bundle</packaging> + <name>Camel :: HDFS2</name> + <description>Camel HDFS support with Hadoop 2.x libraries</description> - <properties> - <camel.osgi.export.pkg>org.apache.camel.component.hdfs2.*</camel.osgi.export.pkg> - <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=hdfs2</camel.osgi.export.service> - <camel.osgi.import.additional> - org.apache.hadoop.hdfs, - org.apache.hadoop.hdfs.client, - org.apache.hadoop.hdfs.protocolPB, - org.apache.hadoop.hdfs.util, - org.apache.hadoop.hdfs.net, - org.apache.hadoop.hdfs.security.token.block, - org.apache.hadoop.hdfs.security.token.delegation, - org.apache.hadoop.hdfs.protocol, - org.apache.hadoop.hdfs.protocol.proto, - org.apache.hadoop.hdfs.protocol.datatransfer - </camel.osgi.import.additional> - </properties> + <properties> + <camel.osgi.export.pkg>org.apache.camel.component.hdfs2.*</camel.osgi.export.pkg> + <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=hdfs2</camel.osgi.export.service> + <camel.osgi.import.additional> + org.apache.hadoop.hdfs, + org.apache.hadoop.hdfs.client, + org.apache.hadoop.hdfs.protocolPB, + org.apache.hadoop.hdfs.util, + org.apache.hadoop.hdfs.net, + org.apache.hadoop.hdfs.security.token.block, + org.apache.hadoop.hdfs.security.token.delegation, + org.apache.hadoop.hdfs.protocol, + org.apache.hadoop.hdfs.protocol.proto, + org.apache.hadoop.hdfs.protocol.datatransfer + </camel.osgi.import.additional> + </properties> - <dependencies> + <dependencies> - <dependency> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-common</artifactId> - </dependency> - <dependency> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-hdfs</artifactId> - </dependency> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>${commons-codec-version}</version> - </dependency> - <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - </dependency> - <dependency> - <groupId>commons-configuration</groupId> - <artifactId>commons-configuration</artifactId> - <version>${commons-configuration-version}</version> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>${commons-lang-version}</version> - </dependency> - <dependency> - <groupId>commons-net</groupId> - <artifactId>commons-net</artifactId> - <version>${commons-net-version}</version> - </dependency> - <dependency> - <groupId>org.codehaus.jackson</groupId> - <artifactId>jackson-core-asl</artifactId> - <version>${jackson-version}</version> - </dependency> - <dependency> - <groupId>org.codehaus.jackson</groupId> - <artifactId>jackson-mapper-asl</artifactId> - <version>${jackson-version}</version> - </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-core</artifactId> + </dependency> - <!-- testing --> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <scope>test</scope> - </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-common</artifactId> + <version>${hadoop2-version}</version> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-hdfs</artifactId> + <version>${hadoop2-version}</version> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>${commons-codec-version}</version> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </dependency> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + <version>${commons-configuration-version}</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>${commons-lang-version}</version> + </dependency> + <dependency> + <groupId>commons-net</groupId> + <artifactId>commons-net</artifactId> + <version>${commons-net-version}</version> + </dependency> + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-core-asl</artifactId> + <version>${jackson-version}</version> + </dependency> + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-mapper-asl</artifactId> + <version>${jackson-version}</version> + </dependency> - </dependencies> + <!-- testing --> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>test</scope> + </dependency> + + </dependencies> </project> http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java ---------------------------------------------------------------------- diff --git a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java index 3d1cfdd..5077fbd 100644 --- a/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java +++ b/components/camel-hdfs2/src/main/java/org/apache/camel/component/hdfs2/HdfsOsgiHelper.java @@ -1,4 +1,4 @@ -/* +/** * 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. @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.camel.component.hdfs2; import java.net.URI; @@ -32,7 +31,7 @@ import org.slf4j.LoggerFactory; */ public class HdfsOsgiHelper { - private static Logger LOG = LoggerFactory.getLogger(HdfsOsgiHelper.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(HdfsOsgiHelper.class); /** * By using this constructor it is possible to perform static initialization of {@link FileSystem}. @@ -42,7 +41,7 @@ public class HdfsOsgiHelper { // get bundle classloader for camel-hdfs2 bundle ClassLoader cl = getClass().getClassLoader(); Configuration conf = new Configuration(); - for (String key: fileSystems.keySet()) { + for (String key : fileSystems.keySet()) { URI uri = URI.create(key); conf.setClass(String.format("fs.%s.impl", uri.getScheme()), cl.loadClass(fileSystems.get(key)), FileSystem.class); FileSystem.get(uri, conf); http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsProducerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsProducerTest.java b/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsProducerTest.java index 18e1ff7..5f2071b 100644 --- a/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsProducerTest.java +++ b/components/camel-hdfs2/src/test/java/org/apache/camel/component/hdfs2/HdfsProducerTest.java @@ -23,7 +23,6 @@ import java.net.URL; import org.apache.camel.Exchange; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.hdfs2.HdfsConstants; import org.apache.camel.util.IOHelper; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/components/pom.xml ---------------------------------------------------------------------- diff --git a/components/pom.xml b/components/pom.xml index 4bcf05b..fe03984 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -95,6 +95,7 @@ <module>camel-hazelcast</module> <module>camel-hbase</module> <module>camel-hdfs</module> + <module>camel-hdfs2</module> <module>camel-hl7</module> <module>camel-ibatis</module> <module>camel-ical</module> http://git-wip-us.apache.org/repos/asf/camel/blob/e2deddad/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index ee7bab5..3e6f2f6 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -1904,29 +1904,6 @@ <version>${ehcache-version}</version> </dependency> - <!-- Hadoop, Hbase --> - <dependency> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-core</artifactId> - <version>${hadoop-version}</version> - </dependency> - <dependency> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-common</artifactId> - <version>${hadoop2-version}</version> - </dependency> - <dependency> - <groupId>org.apache.hadoop</groupId> - <artifactId>hadoop-hdfs</artifactId> - <version>${hadoop2-version}</version> - </dependency> - - <dependency> - <groupId>org.apache.hbase</groupId> - <artifactId>hbase</artifactId> - <version>${hbase-version}</version> - </dependency> - <!-- hibernate and other db systems --> <dependency> <groupId>org.hibernate</groupId>