Skip to content

Commit

Permalink
[FLINK-5706] [file systems] Add S3 file systems without Hadoop depend…
Browse files Browse the repository at this point in the history
…encies

This adds two implementations of a file system that write to S3.
Both are not actual re-implementations but wrap other implementations and shade dependencies.

(1) A wrapper around Hadoop's s3a file system. By pulling a smaller dependency tree and
    shading all dependencies away, this keeps the appearance of Flink being Hadoop-free,
    from a dependency perspective.

(2) The second S3 file system is from the Presto Project.
    Initial simple tests seem to indicate that it responds slightly faster
    and in a bit more lightweight manner to write/read/list requests, compared
    to the Hadoop s3a FS, but it has some semantical differences.

This closes apache#4818
  • Loading branch information
StephanEwen committed Oct 13, 2017
1 parent a3d9db2 commit 991af36
Show file tree
Hide file tree
Showing 19 changed files with 1,672 additions and 2 deletions.
18 changes: 16 additions & 2 deletions flink-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ under the License.
<artifactId>flink-hadoop-fs</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-mapr-fs</artifactId>
Expand Down Expand Up @@ -297,7 +297,21 @@ under the License.
<version>${project.version}</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-s3-fs-hadoop</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-s3-fs-presto</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<!-- end optional Flink libraries -->

<!-- test dependencies -->
Expand Down
14 changes: 14 additions & 0 deletions flink-dist/src/main/assemblies/opt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,19 @@
<destName>flink-metrics-datadog-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-filesystems/flink-s3-fs-hadoop/target/flink-s3-fs-hadoop-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-s3-fs-hadoop-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-filesystems/flink-s3-fs-presto/target/flink-s3-fs-presto-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-s3-fs-presto-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>
</files>
</assembly>
271 changes: 271 additions & 0 deletions flink-filesystems/flink-s3-fs-hadoop/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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:https://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:https://maven.apache.org/POM/4.0.0" xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-filesystems</artifactId>
<version>1.4-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>flink-s3-fs-hadoop</artifactId>
<name>flink-s3-fs-hadoop</name>

<packaging>jar</packaging>

<properties>
<s3hadoop.hadoop.version>2.8.1</s3hadoop.hadoop.version>
<s3hadoop.aws.version>1.11.95</s3hadoop.aws.version>
</properties>

<dependencies>

<!-- Flink core -->

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<!-- File system builds on the Hadoop file system support -->

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-hadoop-fs</artifactId>
<version>${project.version}</version>

<!-- this exclusion is only needed to run tests in the IDE, pre shading,
because the optional Hadoop dependency is also pulled in for tests -->
<exclusions>
<exclusion>
<groupId>org.apache.flink</groupId>
<artifactId>flink-shaded-hadoop2</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Hadoop's S3a file system -->

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${s3hadoop.hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-jobclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-app</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-kerberos-codec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-aws</artifactId>
<version>${s3hadoop.hadoop.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-kms</artifactId>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
</dependency>

<!-- make sure that also logger and JSR is provided -->

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>

<!-- test dependencies -->

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<!-- We need to bump the AWS dependencies compared to the ones referenced
by Hadoop, because the older versions have bugs affecting this project -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>${s3hadoop.aws.version}</version>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-kms</artifactId>
<version>${s3hadoop.aws.version}</version>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>${s3hadoop.aws.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>

<!-- we need to explicitly override this version, because the -->
<!-- earlier versions of the shade plugin have a bug relocating services -->
<version>3.0.0</version>

<executions>
<execution>
<id>shade-flink</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org</pattern>
<shadedPattern>org.apache.flink.s3hadoop.shaded.org</shadedPattern>
</relocation>
<relocation>
<pattern>com</pattern>
<shadedPattern>org.apache.flink.s3hadoop.shaded.com</shadedPattern>
</relocation>
<relocation>
<pattern>net</pattern>
<shadedPattern>org.apache.flink.s3hadoop.shaded.net</shadedPattern>
</relocation>
<relocation>
<pattern>okio</pattern>
<shadedPattern>org.apache.flink.s3hadoop.shaded.okio</shadedPattern>
</relocation>
<relocation>
<pattern>software</pattern>
<shadedPattern>org.apache.flink.s3hadoop.shaded.software</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*</artifact>
<excludes>
<exclude>log4j.properties</exclude>
<exclude>mime.types</exclude>
<exclude>properties.dtd</exclude>
<exclude>PropertyList-1.0.dtd</exclude>
<exclude>models/**</exclude>
<exclude>mozilla/**</exclude>
<exclude>META-INF/maven/com*/**</exclude>
<exclude>META-INF/maven/net*/**</exclude>
<exclude>META-INF/maven/software*/**</exclude>
<exclude>META-INF/maven/joda*/**</exclude>
<exclude>META-INF/maven/org.mortbay.jetty/**</exclude>
<exclude>META-INF/maven/org.apache.h*/**</exclude>
<exclude>META-INF/maven/org.apache.commons/**</exclude>
<exclude>META-INF/maven/org.apache.flink/flink-hadoop-fs/**</exclude>
<exclude>META-INF/maven/org.apache.flink/force-shading/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit 991af36

Please sign in to comment.