public class S3ARemoteObject extends Object
Constructor and Description |
---|
S3ARemoteObject(S3AReadOpContext context,
S3ObjectAttributes s3Attributes,
S3AInputStream.InputStreamCallbacks client,
S3AInputStreamStatistics streamStatistics,
ChangeTracker changeTracker)
Initializes a new instance of the
S3ARemoteObject class. |
Modifier and Type | Method and Description |
---|---|
String |
getPath()
Gets the path of this file.
|
static String |
getPath(S3ObjectAttributes s3Attributes)
Gets the path corresponding to the given s3Attributes.
|
Invoker |
getReadInvoker()
Gets an instance of
Invoker for interacting with S3 API. |
S3AInputStreamStatistics |
getStatistics()
Gets an instance of
S3AInputStreamStatistics used for reporting access metrics. |
software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectResponse> |
openForRead(long offset,
int size)
Opens a section of the file for reading.
|
long |
size()
Gets the size of this file.
|
public S3ARemoteObject(S3AReadOpContext context, S3ObjectAttributes s3Attributes, S3AInputStream.InputStreamCallbacks client, S3AInputStreamStatistics streamStatistics, ChangeTracker changeTracker)
S3ARemoteObject
class.context
- read-specific operation context.s3Attributes
- attributes of the S3 object being read.client
- callbacks used for interacting with the underlying S3 client.streamStatistics
- statistics about stream access.changeTracker
- helps enforce change tracking policy.IllegalArgumentException
- if context is null.IllegalArgumentException
- if s3Attributes is null.IllegalArgumentException
- if client is null.IllegalArgumentException
- if streamStatistics is null.IllegalArgumentException
- if changeTracker is null.public Invoker getReadInvoker()
Invoker
for interacting with S3 API.Invoker
for interacting with S3 API.public S3AInputStreamStatistics getStatistics()
S3AInputStreamStatistics
used for reporting access metrics.S3AInputStreamStatistics
used for reporting access metrics.public String getPath()
public static String getPath(S3ObjectAttributes s3Attributes)
s3Attributes
- attributes of an S3 object.public long size()
public software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectResponse> openForRead(long offset, int size) throws IOException
offset
- Start offset (0 based) of the section to read.size
- Size of the section to read.InputStream
corresponding to the given section of this file.IOException
- if there is an error opening this file section for reading.IllegalArgumentException
- if offset is negative.IllegalArgumentException
- if offset is greater than or equal to file size.IllegalArgumentException
- if size is greater than the remaining bytes.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.