@InterfaceAudience.Private @InterfaceStability.Unstable public class ChangeTracker extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CHANGE_REPORTED_BY_S3 |
static int |
SC_PRECONDITION_FAILED
412 Precondition Failed (HTTP/1.1 - RFC 2616) |
| 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(com.amazonaws.services.s3.model.CopyObjectRequest request)
Apply any revision control set by the policy if it is to be
enforced on the server.
|
boolean |
maybeApplyConstraint(com.amazonaws.services.s3.model.GetObjectMetadataRequest request) |
boolean |
maybeApplyConstraint(com.amazonaws.services.s3.model.GetObjectRequest request)
Apply any revision control set by the policy if it is to be
enforced on the server.
|
void |
processException(com.amazonaws.SdkBaseException e,
String operation)
Process an exception generated against the change policy.
|
void |
processMetadata(com.amazonaws.services.s3.model.ObjectMetadata metadata,
String operation)
Process metadata response from server for validation against the change
policy.
|
void |
processResponse(com.amazonaws.services.s3.transfer.model.CopyResult copyResult)
Process the response from the server for validation against the
change policy.
|
void |
processResponse(com.amazonaws.services.s3.model.S3Object object,
String operation,
long pos)
Process the response from the server for validation against the
change policy.
|
String |
toString() |
public static final int SC_PRECONDITION_FAILED
412 Precondition Failed (HTTP/1.1 - RFC 2616)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 policypublic String getRevisionId()
public ChangeDetectionPolicy.Source getSource()
public long getVersionMismatches()
public boolean maybeApplyConstraint(com.amazonaws.services.s3.model.GetObjectRequest request)
request - request to modifypublic boolean maybeApplyConstraint(com.amazonaws.services.s3.model.CopyObjectRequest request)
request - request to modifypublic boolean maybeApplyConstraint(com.amazonaws.services.s3.model.GetObjectMetadataRequest request)
public void processResponse(com.amazonaws.services.s3.model.S3Object 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(com.amazonaws.services.s3.transfer.model.CopyResult copyResult)
throws org.apache.hadoop.fs.PathIOException
copyResult - result of a copy operationorg.apache.hadoop.fs.PathIOException - raised on failureRemoteFileChangedException - if the remote file has changed.public void processException(com.amazonaws.SdkBaseException 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", "select").RemoteFileChangedException - if the remote file has changed.public void processMetadata(com.amazonaws.services.s3.model.ObjectMetadata 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.Copyright © 2008–2022 Apache Software Foundation. All rights reserved.