Skip to content

Commit f20831f

Browse files
committed
suppress deprecation warnings
1 parent 5f81bce commit f20831f

File tree

7 files changed

+9
-14
lines changed

7 files changed

+9
-14
lines changed

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/TemporaryAWSCredentialsProvider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.apache.hadoop.classification.InterfaceAudience;
2929
import org.apache.hadoop.classification.InterfaceStability;
3030
import org.apache.hadoop.conf.Configuration;
31-
import org.apache.hadoop.fs.s3a.auth.AbstractSessionCredentialsProvider;
3231
import org.apache.hadoop.fs.s3a.auth.MarshalledCredentialBinding;
3332
import org.apache.hadoop.fs.s3a.auth.MarshalledCredentials;
3433
import org.apache.hadoop.fs.s3a.auth.NoAuthWithAWSException;
@@ -51,7 +50,7 @@
5150
@InterfaceStability.Stable
5251
@Deprecated
5352
public class TemporaryAWSCredentialsProvider extends
54-
AbstractSessionCredentialsProvider {
53+
org.apache.hadoop.fs.s3a.auth.AbstractSessionCredentialsProvider {
5554

5655
public static final String NAME
5756
= "org.apache.hadoop.fs.s3a.TemporaryAWSCredentialsProvider";

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/MarshalledCredentialProvider.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@
3737
* This is <i>not</i> intended for explicit use in job/app configurations,
3838
* instead it is returned by Delegation Token Bindings, as needed.
3939
* The constructor implicitly prevents explicit use.
40-
*
41-
* @deprecated This class will be replaced by one that implements AWS SDK V2's AwsCredentialProvider
42-
* as part of upgrading S3A to SDK V2. See HADOOP-18073.
4340
*/
4441
@InterfaceAudience.Private
4542
@InterfaceStability.Unstable
46-
@Deprecated
4743
public class MarshalledCredentialProvider extends
4844
AbstractSessionCredentialsProvider {
4945

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/RoleTokenBinding.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.slf4j.LoggerFactory;
3131

3232
import org.apache.hadoop.conf.Configuration;
33-
import org.apache.hadoop.fs.s3a.AWSCredentialProviderList;
3433
import org.apache.hadoop.fs.s3a.Retries;
3534
import org.apache.hadoop.fs.s3a.auth.MarshalledCredentialProvider;
3635
import org.apache.hadoop.fs.s3a.auth.MarshalledCredentials;
@@ -98,7 +97,7 @@ protected void serviceInit(final Configuration conf) throws Exception {
9897
*/
9998
@Override
10099
@SuppressWarnings("deprecation")
101-
public AWSCredentialProviderList bindToTokenIdentifier(
100+
public org.apache.hadoop.fs.s3a.AWSCredentialProviderList bindToTokenIdentifier(
102101
final AbstractS3ATokenIdentifier retrievedIdentifier)
103102
throws IOException {
104103
RoleTokenIdentifier tokenIdentifier =
@@ -108,7 +107,7 @@ public AWSCredentialProviderList bindToTokenIdentifier(
108107
MarshalledCredentials marshalledCredentials
109108
= tokenIdentifier.getMarshalledCredentials();
110109
setExpirationDateTime(marshalledCredentials.getExpirationDateTime());
111-
return new AWSCredentialProviderList(
110+
return new org.apache.hadoop.fs.s3a.AWSCredentialProviderList(
112111
"Role Token Binding",
113112
new MarshalledCredentialProvider(
114113
COMPONENT,

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/S3ADelegationTokens.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.apache.commons.lang3.StringUtils;
3434
import org.apache.hadoop.classification.InterfaceAudience;
3535
import org.apache.hadoop.conf.Configuration;
36-
import org.apache.hadoop.fs.s3a.AWSCredentialProviderList;
3736
import org.apache.hadoop.fs.s3a.auth.RoleModel;
3837
import org.apache.hadoop.fs.s3a.impl.StoreContext;
3938
import org.apache.hadoop.fs.s3a.statistics.DelegationTokenStatistics;
@@ -470,7 +469,7 @@ public DelegationTokenIssuer[] getAdditionalTokenIssuers()
470469
* @throws IllegalStateException if this instance is not bound to a DT
471470
*/
472471
@SuppressWarnings("deprecation")
473-
public AWSCredentialProviderList getCredentialProviders()
472+
public org.apache.hadoop.fs.s3a.AWSCredentialProviderList getCredentialProviders()
474473
throws IOException {
475474
return credentialProviders.orElseThrow(
476475
() -> new DelegationTokenIOException("Not yet bonded"));

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3ATemporaryCredentials.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public class ITestS3ATemporaryCredentials extends AbstractS3ATestBase {
7171
private static final Logger LOG =
7272
LoggerFactory.getLogger(ITestS3ATemporaryCredentials.class);
7373

74+
@SuppressWarnings("deprecation")
7475
private static final String TEMPORARY_AWS_CREDENTIALS
7576
= TemporaryAWSCredentialsProvider.NAME;
7677

@@ -175,6 +176,7 @@ protected String getStsRegion(final Configuration conf) {
175176
}
176177

177178
@Test
179+
@SuppressWarnings("deprecation")
178180
public void testTemporaryCredentialValidation() throws Throwable {
179181
Configuration conf = new Configuration();
180182
conf.set(ACCESS_KEY, "accesskey");

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/S3ATestUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ public static void unsetHadoopCredentialProviders(final Configuration conf) {
607607
* @return a set of credentials
608608
* @throws IOException on a failure
609609
*/
610+
@SuppressWarnings("deprecation")
610611
public static AWSCredentialsProvider buildAwsCredentialsProvider(
611612
final Configuration conf)
612613
throws IOException {

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/delegation/ITestSessionDelegationTokens.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.apache.hadoop.conf.Configuration;
3333
import org.apache.hadoop.fs.s3a.S3AEncryptionMethods;
3434
import org.apache.hadoop.fs.s3a.S3AFileSystem;
35-
import org.apache.hadoop.fs.s3a.TemporaryAWSCredentialsProvider;
3635
import org.apache.hadoop.fs.s3a.auth.MarshalledCredentials;
3736
import org.apache.hadoop.io.IOUtils;
3837
import org.apache.hadoop.io.Text;
@@ -249,7 +248,7 @@ public void testCreateWithRenewer() throws Throwable {
249248
* @return the retrieved DT. This is only for error reporting.
250249
* @throws IOException failure.
251250
*/
252-
@SuppressWarnings("OptionalGetWithoutIsPresent")
251+
@SuppressWarnings({"OptionalGetWithoutIsPresent", "deprecation"})
253252
protected AbstractS3ATokenIdentifier verifyCredentialPropagation(
254253
final S3AFileSystem fs,
255254
final MarshalledCredentials session,
@@ -260,7 +259,7 @@ protected AbstractS3ATokenIdentifier verifyCredentialPropagation(
260259
// for authentication.
261260
unsetHadoopCredentialProviders(conf);
262261
conf.set(DELEGATION_TOKEN_CREDENTIALS_PROVIDER,
263-
TemporaryAWSCredentialsProvider.NAME);
262+
org.apache.hadoop.fs.s3a.TemporaryAWSCredentialsProvider.NAME);
264263
session.setSecretsInConfiguration(conf);
265264
try(S3ADelegationTokens delegationTokens2 = new S3ADelegationTokens()) {
266265
delegationTokens2.bindToFileSystem(

0 commit comments

Comments
 (0)