@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class ChangeDetectionPolicy extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ChangeDetectionPolicy.Mode
What to do when change is detected.
|
static class |
ChangeDetectionPolicy.Source
The S3 object attribute used to detect change.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CHANGE_DETECTED |
| Modifier | Constructor and Description |
|---|---|
protected |
ChangeDetectionPolicy(ChangeDetectionPolicy.Mode mode,
boolean requireVersion) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
applyRevisionConstraint(com.amazonaws.services.s3.model.GetObjectRequest request,
String revisionId)
Applies the given
revisionId
as a server-side qualification on the GetObjectRequest. |
static ChangeDetectionPolicy |
createPolicy(ChangeDetectionPolicy.Mode mode,
ChangeDetectionPolicy.Source source,
boolean requireVersion)
Create a policy.
|
LogExactlyOnce |
getLogNoVersionSupport() |
ChangeDetectionPolicy.Mode |
getMode() |
static ChangeDetectionPolicy |
getPolicy(org.apache.hadoop.conf.Configuration configuration)
Reads the change detection policy from Configuration.
|
abstract String |
getRevisionId(com.amazonaws.services.s3.model.ObjectMetadata objectMetadata,
String uri)
Pulls the attribute this policy uses to detect change out of the S3 object
metadata.
|
abstract ChangeDetectionPolicy.Source |
getSource() |
boolean |
isRequireVersion() |
org.apache.commons.lang3.tuple.ImmutablePair<Boolean,RemoteFileChangedException> |
onChangeDetected(String revisionId,
String newRevisionId,
String uri,
long position,
String operation,
long timesAlreadyDetected)
Takes appropriate action based on
mode when a change has
been detected. |
public static final String CHANGE_DETECTED
protected ChangeDetectionPolicy(ChangeDetectionPolicy.Mode mode, boolean requireVersion)
public ChangeDetectionPolicy.Mode getMode()
public abstract ChangeDetectionPolicy.Source getSource()
public boolean isRequireVersion()
public LogExactlyOnce getLogNoVersionSupport()
public static ChangeDetectionPolicy getPolicy(org.apache.hadoop.conf.Configuration configuration)
configuration - the configurationpublic static ChangeDetectionPolicy createPolicy(ChangeDetectionPolicy.Mode mode, ChangeDetectionPolicy.Source source, boolean requireVersion)
mode - mode pf checkssource - source of changerequireVersion - throw exception when no version available?public abstract String getRevisionId(com.amazonaws.services.s3.model.ObjectMetadata objectMetadata, String uri)
revisionId.objectMetadata - the s3 object metadatauri - the URI of the objectpublic abstract void applyRevisionConstraint(com.amazonaws.services.s3.model.GetObjectRequest request,
String revisionId)
revisionId
as a server-side qualification on the GetObjectRequest.request - the requestrevisionId - the revision idpublic org.apache.commons.lang3.tuple.ImmutablePair<Boolean,RemoteFileChangedException> onChangeDetected(String revisionId, String newRevisionId, String uri, long position, String operation, long timesAlreadyDetected)
mode when a change has
been detected.revisionId - the expected revision idnewRevisionId - the detected revision iduri - the URI of the object being accessedposition - the position being read in the objectoperation - the operation being performed on the object (e.g. open or
re-open) that triggered the change detectiontimesAlreadyDetected - number of times a change has already been
detected on the current streamCopyright © 2008–2021 Apache Software Foundation. All rights reserved.