diff --git a/fluss-filesystems/fluss-fs-s3/pom.xml b/fluss-filesystems/fluss-fs-s3/pom.xml index 2151dccea8..1126bfc6fe 100644 --- a/fluss-filesystems/fluss-fs-s3/pom.xml +++ b/fluss-filesystems/fluss-fs-s3/pom.xml @@ -34,6 +34,8 @@ 1.12.319 + + 2.23.19 @@ -233,8 +235,18 @@ org.slf4j slf4j-reload4j + + software.amazon.awssdk + bundle + + + + software.amazon.awssdk + s3-transfer-manager + ${aws-java-sdk-v2.version} + diff --git a/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/exception/InvalidCredentialsException.java b/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/exception/InvalidCredentialsException.java new file mode 100644 index 0000000000..4806c887f7 --- /dev/null +++ b/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/exception/InvalidCredentialsException.java @@ -0,0 +1,32 @@ +/* + * 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.fluss.fs.s3.exception; + +/** Exception thrown when no credentials were found. */ +public class InvalidCredentialsException extends RuntimeException { + + public static final String E_NO_AWS_CREDENTIALS = "No AWS Credentials"; + + public InvalidCredentialsException(String credentialProvider) { + this(credentialProvider, null); + } + + public InvalidCredentialsException(String credentialProvider, Throwable throwable) { + super(credentialProvider + ": " + E_NO_AWS_CREDENTIALS, throwable); + } +} diff --git a/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/DynamicTemporaryAWSCredentialsProvider.java b/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/DynamicTemporaryAWSCredentialsProvider.java index 415ea61a03..c02c44e31c 100644 --- a/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/DynamicTemporaryAWSCredentialsProvider.java +++ b/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/DynamicTemporaryAWSCredentialsProvider.java @@ -17,12 +17,12 @@ package org.apache.fluss.fs.s3.token; +import org.apache.fluss.fs.s3.exception.InvalidCredentialsException; import org.apache.fluss.fs.token.Credentials; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.auth.BasicSessionCredentials; -import org.apache.hadoop.fs.s3a.auth.NoAwsCredentialsException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,7 +46,7 @@ public AWSCredentials getCredentials() { Credentials credentials = S3DelegationTokenReceiver.getCredentials(); if (credentials == null) { - throw new NoAwsCredentialsException(COMPONENT); + throw new InvalidCredentialsException(COMPONENT); } LOG.debug("Providing session credentials"); return new BasicSessionCredentials( diff --git a/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/S3DelegationTokenReceiver.java b/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/S3DelegationTokenReceiver.java index e3e2d73466..4fd59bed0b 100644 --- a/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/S3DelegationTokenReceiver.java +++ b/fluss-filesystems/fluss-fs-s3/src/main/java/org/apache/fluss/fs/s3/token/S3DelegationTokenReceiver.java @@ -17,12 +17,12 @@ package org.apache.fluss.fs.s3.token; +import org.apache.fluss.fs.s3.exception.InvalidCredentialsException; import org.apache.fluss.fs.token.Credentials; import org.apache.fluss.fs.token.CredentialsJsonSerde; import org.apache.fluss.fs.token.ObtainedSecurityToken; import org.apache.fluss.fs.token.SecurityTokenReceiver; -import org.apache.hadoop.fs.s3a.auth.NoAwsCredentialsException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,7 +63,7 @@ public static void updateHadoopConfig(org.apache.hadoop.conf.Configuration hadoo if (additionInfos == null) { // if addition info is null, it also means we have not received any token, // we throw InvalidCredentialsException - throw new NoAwsCredentialsException(DynamicTemporaryAWSCredentialsProvider.COMPONENT); + throw new InvalidCredentialsException(DynamicTemporaryAWSCredentialsProvider.COMPONENT); } else { for (Map.Entry entry : additionInfos.entrySet()) { hadoopConfig.set(entry.getKey(), entry.getValue()); diff --git a/fluss-filesystems/fluss-fs-s3/src/main/resources/META-INF/NOTICE b/fluss-filesystems/fluss-fs-s3/src/main/resources/META-INF/NOTICE index eefe37c541..41e6848457 100644 --- a/fluss-filesystems/fluss-fs-s3/src/main/resources/META-INF/NOTICE +++ b/fluss-filesystems/fluss-fs-s3/src/main/resources/META-INF/NOTICE @@ -26,6 +26,8 @@ This project bundles the following dependencies under the Apache Software Licens - io.dropwizard.metrics:metrics-core:3.2.4 - io.netty:netty-buffer:4.1.100.Final - io.netty:netty-codec:4.1.100.Final +- io.netty:netty-codec-http2:4.1.100.Final +- io.netty:netty-codec-http:4.1.100.Final - io.netty:netty-common:4.1.100.Final - io.netty:netty-handler:4.1.100.Final - io.netty:netty-resolver:4.1.100.Final @@ -52,9 +54,37 @@ This project bundles the following dependencies under the Apache Software Licens - org.apache.kerby:kerby-util:2.0.3 - org.bouncycastle:bcprov-jdk15on:1.70 - org.codehaus.jettison:jettison:1.5.4 +- org.reactivestreams:reactive-streams:1.0.4 - org.wildfly.openssl:wildfly-openssl:1.1.3.Final - org.xerial.snappy:snappy-java:1.1.10.4 -- software.amazon.awssdk:bundle:2.23.19 +- software.amazon.awssdk:annotations:2.23.19 +- software.amazon.awssdk:apache-client:2.23.19 +- software.amazon.awssdk:arns:2.23.19 +- software.amazon.awssdk:auth:2.23.19 +- software.amazon.awssdk:aws-core:2.23.19 +- software.amazon.awssdk:aws-query-protocol:2.23.19 +- software.amazon.awssdk:aws-xml-protocol:2.23.19 +- software.amazon.awssdk:checksums-spi:2.23.19 +- software.amazon.awssdk:checksums:2.23.19 +- software.amazon.awssdk:crt-core:2.23.19 +- software.amazon.awssdk:endpoints-spi:2.23.19 +- software.amazon.awssdk:http-auth-aws:2.23.19 +- software.amazon.awssdk:http-auth-spi:2.23.19 +- software.amazon.awssdk:http-auth:2.23.19 +- software.amazon.awssdk:http-client-spi:2.23.19 +- software.amazon.awssdk:identity-spi:2.23.19 +- software.amazon.awssdk:json-utils:2.23.19 +- software.amazon.awssdk:metrics-spi:2.23.19 +- software.amazon.awssdk:netty-nio-client:2.23.19 +- software.amazon.awssdk:profiles:2.23.19 +- software.amazon.awssdk:protocol-core:2.23.19 +- software.amazon.awssdk:regions:2.23.19 +- software.amazon.awssdk:s3:2.23.19 +- software.amazon.awssdk:s3-transfer-manager:2.23.19 +- software.amazon.awssdk:sdk-core:2.23.19 +- software.amazon.awssdk:third-party-jackson-core:2.23.19 +- software.amazon.awssdk:utils:2.23.19 +- software.amazon.eventstream:eventstream:1.0.1 - software.amazon.ion:ion-java:1.0.2 This project bundles the following dependencies under BSD-2 License (https://opensource.org/licenses/BSD-2-Clause).