From 9f1138f5687eb52a64ee3873e1d51e8bf1844c9a Mon Sep 17 00:00:00 2001 From: rajdchak Date: Wed, 8 Jan 2025 17:22:54 +0000 Subject: [PATCH] Changed to stream context --- .../main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java | 6 +++--- .../java/org/apache/hadoop/fs/s3a/S3ASeekableStream.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java index 01b827a710913..ee2c445600a48 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java @@ -229,7 +229,7 @@ import org.apache.hadoop.util.SemaphoredDelegatingExecutor; import org.apache.hadoop.util.concurrent.HadoopExecutors; import org.apache.hadoop.util.functional.CallableRaisingIOE; -import software.amazon.s3.analyticsaccelerator.request.AuditHeaders; +import software.amazon.s3.analyticsaccelerator.request.StreamContext; import software.amazon.s3.analyticsaccelerator.request.ObjectClient; import static java.util.Objects.requireNonNull; @@ -1960,13 +1960,13 @@ private FSDataInputStream executeOpen( if (this.analyticsAcceleratorEnabled) { ActiveAuditManagerS3A.WrappingAuditSpan wrappingAuditSpan = (ActiveAuditManagerS3A.WrappingAuditSpan) auditSpan; LoggingAuditor.LoggingAuditSpan loggingAuditSpan = (LoggingAuditor.LoggingAuditSpan) wrappingAuditSpan.getSpan(); - AuditHeaders auditHeaders = new S3AAuditHeaders(loggingAuditSpan.getReferrer()); + StreamContext streamContext = new S3AStreamContext(loggingAuditSpan.getReferrer()); return new FSDataInputStream( new S3ASeekableStream( this.bucket, pathToKey(path), s3SeekableInputStreamFactory, - auditHeaders)); + streamContext)); } if (this.prefetchEnabled) { diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ASeekableStream.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ASeekableStream.java index 7b9329069a2fb..f97ced1727ddf 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ASeekableStream.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ASeekableStream.java @@ -31,7 +31,7 @@ import software.amazon.s3.analyticsaccelerator.S3SeekableInputStream; import software.amazon.s3.analyticsaccelerator.S3SeekableInputStreamFactory; -import software.amazon.s3.analyticsaccelerator.request.AuditHeaders; +import software.amazon.s3.analyticsaccelerator.request.StreamContext; import software.amazon.s3.analyticsaccelerator.util.S3URI; public class S3ASeekableStream extends FSInputStream implements StreamCapabilities { @@ -43,8 +43,8 @@ public class S3ASeekableStream extends FSInputStream implements StreamCapabiliti public static final Logger LOG = LoggerFactory.getLogger(S3ASeekableStream.class); - public S3ASeekableStream(String bucket, String key, S3SeekableInputStreamFactory s3SeekableInputStreamFactory, AuditHeaders auditHeaders) { - this.inputStream = s3SeekableInputStreamFactory.createStream(S3URI.of(bucket, key), auditHeaders); + public S3ASeekableStream(String bucket, String key, S3SeekableInputStreamFactory s3SeekableInputStreamFactory, StreamContext streamContext) { + this.inputStream = s3SeekableInputStreamFactory.createStream(S3URI.of(bucket, key), streamContext); this.key = key; }