@InterfaceAudience.Private @InterfaceStability.Unstable public class ChangeTracker extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CHANGE_REPORTED_BY_S3 |
Constructor and Description |
---|
ChangeTracker(String uri,
ChangeDetectionPolicy policy,
ChangeTrackerStatistics versionMismatches,
S3ObjectAttributes s3ObjectAttributes)
Create a change tracker.
|
Modifier and Type | Method and Description |
---|---|
String |
getRevisionId() |
ChangeDetectionPolicy.Source |
getSource() |
long |
getVersionMismatches() |
boolean |
maybeApplyConstraint(software.amazon.awssdk.services.s3.model.CopyObjectRequest.Builder requestBuilder)
Apply any revision control set by the policy if it is to be
enforced on the server.
|
boolean |
maybeApplyConstraint(software.amazon.awssdk.services.s3.model.GetObjectRequest.Builder builder)
Apply any revision control set by the policy if it is to be
enforced on the server.
|
boolean |
maybeApplyConstraint(software.amazon.awssdk.services.s3.model.HeadObjectRequest.Builder requestBuilder) |
void |
processException(software.amazon.awssdk.core.exception.SdkException e,
String operation)
Process an exception generated against the change policy.
|
void |
processMetadata(software.amazon.awssdk.services.s3.model.GetObjectResponse getObjectResponse,
String operation)
Process the response from server for validation against the change
policy.
|
void |
processMetadata(software.amazon.awssdk.services.s3.model.HeadObjectResponse metadata,
String operation)
Process metadata response from server for validation against the change
policy.
|
void |
processResponse(software.amazon.awssdk.services.s3.model.CopyObjectResponse copyObjectResponse)
Process the response from the server for validation against the
change policy.
|
void |
processResponse(software.amazon.awssdk.services.s3.model.GetObjectResponse object,
String operation,
long pos)
Process the response from the server for validation against the
change policy.
|
String |
toString() |
public static final String CHANGE_REPORTED_BY_S3
public ChangeTracker(String uri, ChangeDetectionPolicy policy, ChangeTrackerStatistics versionMismatches, S3ObjectAttributes s3ObjectAttributes)
uri
- URI of object being trackedpolicy
- policy to track.versionMismatches
- reference to the version mismatch counters3ObjectAttributes
- attributes of the object, potentially including
an eTag or versionId to match depending on policy
public String getRevisionId()
public ChangeDetectionPolicy.Source getSource()
@VisibleForTesting public long getVersionMismatches()
public boolean maybeApplyConstraint(software.amazon.awssdk.services.s3.model.GetObjectRequest.Builder builder)
builder
- request builder to modifypublic boolean maybeApplyConstraint(software.amazon.awssdk.services.s3.model.CopyObjectRequest.Builder requestBuilder)
requestBuilder
- copy object request builder to modifypublic boolean maybeApplyConstraint(software.amazon.awssdk.services.s3.model.HeadObjectRequest.Builder requestBuilder)
public void processResponse(software.amazon.awssdk.services.s3.model.GetObjectResponse object, String operation, long pos) throws org.apache.hadoop.fs.PathIOException
object
- object returned; may be null.operation
- operation in progress.pos
- offset of readorg.apache.hadoop.fs.PathIOException
- raised on failureRemoteFileChangedException
- if the remote file has changed.public void processResponse(software.amazon.awssdk.services.s3.model.CopyObjectResponse copyObjectResponse) throws org.apache.hadoop.fs.PathIOException
copyObjectResponse
- response of a copy operationorg.apache.hadoop.fs.PathIOException
- raised on failureRemoteFileChangedException
- if the remote file has changed.public void processException(software.amazon.awssdk.core.exception.SdkException e, String operation) throws RemoteFileChangedException
RemoteFileChangedException
with the original exception as the
cause.e
- the exceptionoperation
- the operation performed when the exception was
generated (e.g. "copy", "read").RemoteFileChangedException
- if the remote file has changed.public void processMetadata(software.amazon.awssdk.services.s3.model.HeadObjectResponse metadata, String operation) throws org.apache.hadoop.fs.PathIOException
metadata
- metadata returned from serveroperation
- operation in progressorg.apache.hadoop.fs.PathIOException
- raised on failureRemoteFileChangedException
- if the remote file has changed.public void processMetadata(software.amazon.awssdk.services.s3.model.GetObjectResponse getObjectResponse, String operation) throws org.apache.hadoop.fs.PathIOException
getObjectResponse
- response returned from serveroperation
- operation in progressorg.apache.hadoop.fs.PathIOException
- raised on failureRemoteFileChangedException
- if the remote file has changed.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.